User Mark_Schmucker reports a bug in Data Explorer where group selection for query access fails — typing group names like “moderators” yields no autocomplete, and saved selections disappear. The issue persists despite rebuilding the app and occurs on Discourse 2.4.0.beta6. pfaffman asks if both Discourse and the Data Explorer plugin were updated; markvanlan confirms the feature works on meta but can’t reproduce locally. j.jaffeux suggests testing in safe mode (?safe_mode=no_custom%2Conly_official), which Mark_Schmucker confirms still reproduces the bug, revealing a JavaScript error in the console. j.jaffeux identifies the issue as related to select-kit failing to handle inconsistent group_ids formats (nil, [], ""). A fix is proposed in PR #39, modifying plugin.rb to handle edge cases more robustly, with additional improvements in PR #38 and PR #40. The root cause may stem from earlier buggy code that saved corrupted group ID data. Users are advised to update to the latest plugin version to resolve the issue.
I have this box in Data Explorer:
But it doesn’t work- for example if I type “moderators” (with no quotes), it doesn’t search or auto-complete, and if I save the query and come back to it, the box is empty again, and moderators do not have access to the query.
I’ve tried other groups as well- the problem is not specific to moderators.
I don’t see any related settings- only the setting is to enable Data Explorer.
Nice. But I can still repo. Found this in the console, both with Chrome and Firefox. Will try to drill down further tomorrow, but I’m a bit out of my depth here.
For some reason group_ids were retrieved in 3 formats : nil, [], ""… and select-kit had troubles looping over ""
The important fix is in plugin.rb, but I also tried to make it more resilient at other parts of the code.
@markvanlan I imagine some version of this code were buggy at some point and created some corrupted data like this? Feel free to dig more if you think there’s something to change/migrate.
I also made a few other commits while I was at it: