danyaPostfactum / modx-ace

ACE editor integration into MODx
24 stars 23 forks source link

Resource Overview fatal error #19

Closed Fi1osof closed 11 years ago

Fi1osof commented 11 years ago

Fatal error: Call to a member function get() on a non-object in /paas/c0701/www/core/cache/includes/elements/modplugin/1.include.cache.php on line 122

Error in this line: https://github.com/danyaPostfactum/modx-ace/blob/master/core/components/ace/elements/plugins/ace.plugin.php#L117

danyaPostfactum commented 11 years ago

Fixed https://github.com/danyaPostfactum/modx-ace/commit/2372eb7e8810fcaa224ae2432917f1fb676365a9

Fi1osof commented 11 years ago

if (!$modx->controller->resourceArray) {

It`s not guaranted solution. $modx->controller->resourceArray may exists and not empty, but $modx->getObject('modContentType', $modx->controller->resourceArray['content_type']) still may return no result, and ->get() return fatal error. Required if($content_type = $modx->getObject('modContentType', $modx->controller->resourceArray['content_type'])){ $mimeType = $content_type->get('mime_type'); }