Cannot add sidebar via Objects setting editor

AI-generated summary

Hineroptera, an admin on the image.sc forum, reported a bug preventing the addition of new entries to the Topic List Sidebars component via the Objects setting editor. The error occurs when attempting to save a new sidebar configuration, despite the component being up-to-date and valid tags being used. The user noted that the error message was unhelpful, displaying an index rather than the failing field name, and that the UI layout obscured the error message during the save attempt. A successful workaround involved using the Settings Editor to manually edit the JSON directly, suggesting an issue with the GUI’s save logic regarding tag array wrapping. The issue had not occurred since January 5th. awesomerobot acknowledged the detailed report and confirmed that a fix has been implemented in Discourse, which will be applied upon the next site update.

Hello! I am an admin on the https://forum.image.sc discourse site. This is currently the error I am getting when I try to add a new entry to our Topic List Sidebars component:

Steps to Recreate

  1. Open Admin section
  2. Under Appearance, select Themes & components
  3. Under Components, click Edit next to Topic List Sidebars entry
  4. Click Objects setting editor
  5. Scroll to the bottom and click + sidebar and select the new topic
  6. Scroll back to the top and enter name, tag, and topic_id
  7. Scroll back to the bottom and click Save Changes
  8. Error message appears and sidebar fails to save

Alternatives tried (same failure)

  • Ensuring that the component is up-to-date
  • Adding a category
  • Adding multiple valid tags
  • Removing - from tag name

Workaround

Instead of using the Objects setting editor, if I use the Settings Editor button at the bottom of the Topic List Sidebars component edit page I am able to directly edit the JSON. I was able to successfully manually create an entry with the same data that’s being rejected by the GUI.

This suggests to me that there is an error in the save logic detecting the tags and wrapping it/them into an array.

Last Success

A sidebar was added to the site on Jan 5, at which point the GUI entry was functioning as expected.

Additional Notes

  • In the Edit sidebars setting page, the fact that the sidebars aren’t in a scrolling component means that, with a sufficiently long list of sidebars, the error message and data entry aren’t in view when clicking Save Changes. I actually didn’t even realize there was a problem at first.
  • This was compounded by the error message providing an index instead of the name, which made it unclear what was failing validation.

Thank you for the support!

2 Likes

Thanks for the thorough report, it made it much easier to track down. This required a fix in Discourse, you should receive this the next time your site is updated.

https://github.com/discourse/discourse/pull/37643

4 Likes