Page 1 of 1

illegal string offset

Posted: 2016-04-06 04:35
by wsiconcrete
Trying to set filters for users while maintaining visibility of all information for admins. Maybe I am combining things that I shouldn't, but from the help I came up with the following to apply a filter so long as the logged in user was not a member of the 'Admins' group (added to the 'tablename_init.php' file in the /hooks/ folder:

Code: Select all

	function moistures_init(&$options, $memberInfo, &$args){
		/*
			Added memberInfo[group] to filter out admins
		*/
		if(!$_POST['FilterField'][1] && !$_GET['FilterField'][1] && !$memberInfo['group']['Admins']){
		...rest of code for filters
While it seems to work, when inspecting the code in the browser console I see the following error:

Code: Select all

:  Illegal string offset 'Admins' in .../hooks/tanker_monitor.php on line 32
Should I be worried about this error? It doesn't seem to affect functionality but on some mobile browsers I see portions of the error displayed on the page itself.

Re: illegal string offset

Posted: 2016-04-10 08:52
by a.gneady
Hmm .. try this code instead:

Code: Select all

if(!isset($_REQUEST['FilterField'][1]) && !$memberInfo['group'] == 'Admins'){