modmore / QuickstartButtons

Component for managing Quickstart buttons on your MODX manager Dashboard.
5 stars 7 forks source link

Buttons not showing for Administrator #16

Closed Lefthandmedia closed 8 years ago

Lefthandmedia commented 10 years ago

There is a curious (i don't understand usergroups that well) bug with usergroups. When i'm logged in as administrator , that is belonging to NO usergroup, the QS buttons won't show. I can fix that by adding these lines to dashboardwidget.class.php on line 34 OLD: $usrGroupIds = (array)$this->modx->user->getUserGroups(); NEW: $usrGroupIds = (array)$this->modx->user->getUserGroups(); $groupstring = implode(',', $usrGroupIds); $groupstring = ($groupstring == '') ? 1 : $groupstring;

And in the WHERE clause on line 41: OLD: "(UserGroup.usergroup IN (".implode(',', $usrGroupIds).") OR UserGroup....... NEW: "(UserGroup.usergroup IN (". $groupstring .") OR UserGroup......

RDG

Mark-H commented 8 years ago

Unless there are lots of people running into it (which, by the looks of the activity on this issue, it doesn't appear to be), I think the appropriate solution would be to make sure the admin user has, like, a user group. :P