news-catalyst / google-app-scripts

a collection of scripts for tinynews google docs add-ons
https://script.google.com/a/newscatalyst.org/d/1ILURq69o3cYUy6k1n1X6HwxdMfl9xWNhILYuZxgLfeblb3IR15WCMZSj/edit
1 stars 1 forks source link

bugfix: save selected authors on every form save (preview/publish) #351

Closed jacqui closed 2 years ago

jacqui commented 2 years ago

Closes #350

To test, use latest code on an article, then change the authors and publish. Close & reopen the sidebar, the authors should be correct. You can also verify by checking the published article, but it takes a few moments to update.

This bug was caused by the author field being saved with a single selected author but getting sidestepped for multiple. Oops. It now passes the array no matter what. The plugin that handles tags and authors in the sidebar, select2, sends through either a string for one, an array for multiple. This was being managed correctly for tags already.