« 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: /home/herimaine/public_html/manager/includes/document.parser.class.inc.php Line: 1210 Line 1210 source: foreach ($this->documentMap as $mapEntry) { Parser timing MySQL: 0.0052 s (4 Requests) PHP: 0.0354 s Total: 0.0406 s
print_r($this->documentMap);
function getParentIds($id, $height = 10, $parents = array ()) { $parentId = 0; if (is_array($this->documentMap) && count($this->documentMap) > 0) { foreach ($this->documentMap as $mapEntry) { $parentId = array_search($id, $mapEntry); if ($parentId) { $parentKey = array_search($parentId, $this->documentListing); if (!$parentKey) { $parentKey = "$parentId"; } $parents[$parentKey] = $parentId; break; } } } $height--; if ($parentId && $height) { $parents = $parents+$this->getParentIds($parentId, $height, $parents); } return $parents; }
if (is_array($this->documentMap) && count($this->documentMap) > 0) {
[10-Aug-2009 22:40:29] PHP Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/herimaine/public_html/manager/includes/document.parser.class.inc.php(769) : eval()'d code on line 95 [10-Aug-2009 22:41:24] PHP Parse error: syntax error, unexpected T_STRING, expecting ']' in /home/herimaine/public_html/manager/includes/document.parser.class.inc.php(769) : eval()'d code on line 98 [10-Aug-2009 22:43:08] PHP Parse error: syntax error, unexpected T_STRING, expecting ']' in /home/herimaine/public_html/manager/includes/document.parser.class.inc.php(769) : eval()'d code on line 97 [10-Aug-2009 22:56:26] PHP Parse error: syntax error, unexpected '[', expecting '(' in /home/herimaine/public_html/manager/includes/document.parser.class.inc.php(769) : eval()'d code on line 21 [10-Aug-2009 22:57:00] PHP Parse error: syntax error, unexpected '[', expecting '(' in /home/herimaine/public_html/manager/includes/document.parser.class.inc.php(769) : eval()'d code on line 21 [10-Aug-2009 22:58:03] PHP Parse error: syntax error, unexpected '[', expecting '(' in /home/herimaine/public_html/manager/includes/document.parser.class.inc.php(769) : eval()'d code on line 21 [10-Aug-2009 22:58:39] PHP Parse error: syntax error, unexpected '{' in /home/herimaine/public_html/manager/includes/document.parser.class.inc.php(769) : eval()'d code on line 21
[11-Nov-2009 05:23:45] PHP Warning: include_once(/home/herimaine/public_html/manager//includes/document.parser.class.inc.php) [<a href='function.include-once'>function.include-once</a>]: failed to open stream: No such file or directory in /home/herimaine/public_html/index.php on line 112 [11-Nov-2009 05:23:45] PHP Warning: include_once() [<a href='function.include'>function.include</a>]: Failed opening '/home/herimaine/public_html/manager//includes/document.parser.class.inc.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/herimaine/public_html/index.php on line 112 [11-Nov-2009 05:23:45] PHP Fatal error: Class 'DocumentParser' not found in /home/herimaine/public_html/index.php on line 113
Did this happen after an upgrade of the site (i.e. new MODx version)? If so, running setup in upgrade mode should have cleared the cache and straightened out any other problems.
I usually clear the cache manually in the Manager after any significant change to the site just to be sure.
Your browser cache/cookies can also be a problem sometimes after an upgrade.
You can assure the client that a corrupted cache is very very rare in the normal operation of a MODx site and easily cured by clearing the cache in the Manager.