The problem with the PHP on the website — Illegal string offset. What fixes?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
34 views
After upgrading Modx'and 1.0.5 -> 1.2.1 was there a problem with the plugin ManagerManager. Error reads: Illegal string offset 'template' in root сайта/www/assets/plugins/managermanager/mm.inc.php on line 84. What can be the reason? Lines 83 - 85 add PHP 5.6
$mm_current_page = array(); $mm_current_page['template'] = isset($_POST['template']) ? $_POST['template'] : isset($content['template']) ? $content['template'] : $default_template; $mm_current_page['role'] = $_SESSION['mgrRole'];
by | 34 views

2 Answers

0 like 0 dislike
In $_POST or in $content you have the crap, and do not have any indexes `template`
by
0 like 0 dislike
When using multiple ternary operators highlight the brackets ambiguous expressions
$mm_current_page['template'] = isset($_POST['template']) ? $_POST['template'] : (isset($content['template'] ? $content['template'] : $default_template);

And generally it is bad, then disassemble such structures full plate.
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
3 answers
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
110,608 questions
257,187 answers
0 comments
40,796 users