revolution
revolution copied to clipboard
Missing sanity check in resource/create controller
Bug report
Summary
Modx 2
Line 254 of manager/controllers/default/resource/create.class.php
throws an "empty IN condition error if $usergroups is empty.
array(
'ProfileUserGroup.usergroup:IN' => $userGroups,
array(
'OR:ProfileUserGroup.usergroup:IS' => null,
'AND:UGProfile.active:=' => true,
),
),
Step to reproduce
No sure how to reproduce this, but a user reported it here.
It's Form Customization code, so possibly a user who doesn't belong to a group or a reference to a group that no longer exists.
Other similar examples only make the query if the variable is not empty.
This issue has been mentioned on MODX Community. There might be relevant details there:
https://community.modx.com/t/error-log-question/6359/3