I am using ManagerCheck to display stuff in the front for managers only.
I am getting the following error and I do not have a clue of what it means
or how to troubleshoot it... I have debug turn on but it does not seem to do anything.
The error is:
« MODx Parse Error »
MODx encountered the following error while attempting to parse the requested resource:
« PHP Parse Error »
PHP error debug
Error: Invalid argument supplied for foreach()
Error type/ Nr.: Warning - 2
File: /home2/mercolog/public_html/teampitt/manager/includes/document.parser.class.inc.php(770) : eval()'d code
Line: 114
Parser timing
MySQL: 0.0259 s (191 Requests)
PHP: 0.1091 s
Total: 0.1350 s
my call is as follows:
[[MemberCheck? &groups=`mugSiteAdmin, mugSiteAssistant` &chunk=`crmChunk`]]
Also, how do I include the administrator (the all powerful) in the list?
Thanks
Website: www.mercologia.com
MODX Revo Tutorials: www.modxperience.com
MODX Professional Partner
I’m not sure about the error, it may mean that the parser is getting sent an empty document list.
On the Super Admin, you can just add that user to one of your mug groups.
Thanks for the help Bob,
unfortunately I cannot make it work
so maybe I will try using PHx...
maybe if Susan is lurking around here...
Website: www.mercologia.com
MODX Revo Tutorials: www.modxperience.com
MODX Professional Partner
The most common cause of that error is that the first argument in the foreach call is not an array.
You might try just making sure that you have more than one manager document group and more than one user group.
Otherwise, I see that ManagerCheck has only one foreach. Try changing this:
foreach ($dgn as $k => $v) {
to this:
foreach ( (array) $dgn as $k => $v) {
THanks Bob, I also checked for the only foreach in ManagerCheck
and it is passing an array to $dgn and still it gave me the error.
So instead I used the PHx extender for checking if the user is
logged into the manager (less control but it is what I need) and
it works easily and flawlessly...
Website: www.mercologia.com
MODX Revo Tutorials: www.modxperience.com
MODX Professional Partner
Glad you got it working (though I wonder why the (array) cast didn’t prevent the error).