babel icon indicating copy to clipboard operation
babel copied to clipboard

Babel 'OnDocFormPrerender' Event causes Error in Backend 2.6.5

Open hzuellig opened this issue 7 years ago • 6 comments

I have Problems with Babel in Manager Backend since Upgrading to 2.6.5 Seems to have to do with the 'OnDocFormPrerender' Event. The Error I get says: Fatal error: Call to a member function get() on array in /home/museum2/www/test.museums.ch/core/cache/includes/elements/modplugin/16.include.cache.php on line 54 Checking this line leads me to this line 54 in Babel Plugin: $contextKeys = $babel->getGroupContextKeys($resource->get('context_key')); If I uncheck the System Event, Backend Manager works, but then obviously the Babel Plugin to switch language in Backend is missing.

hzuellig avatar Jul 21 '18 15:07 hzuellig

I have exactly same problem after upgrading to 2.6.5. Please @hzuellig how can I do the quickfix? (uncheck the System Event) Thank you :)

janpevny avatar Jul 23 '18 15:07 janpevny

You go to Plugin -> Babel -> System Events bildschirmfoto 2018-07-24 um 12 58 19

hzuellig avatar Jul 24 '18 10:07 hzuellig

@hzuellig Thank you very much :)

janpevny avatar Jul 24 '18 13:07 janpevny

strange, i got babel on several sites and updated to the latest version without any problem. when does this error occur? did you tried to reinstall babel? has you site maybe been hacked and files manipulated that lead to this problem? actually there are alot of hacked sites, if you need help the modx comunity on slack is a good place to get it.

degoya avatar Jul 24 '18 13:07 degoya

Yes I did reinstall babel. I am on version 3.0.0 and I have four different contexts (web, fr, it, en). The error occurs when I want to edit a resource in the backend, it happens with each resource, the screen goes totally blank except the error. The site has not been hacked. But I updated from 2.4.3 straight to 2.6.5. bildschirmfoto 2018-07-24 um 16 43 09

hzuellig avatar Jul 24 '18 14:07 hzuellig

I have modx 2.6.5, and $resource is array in plugin. Why? Insert before $linkedResources = $babel->getLinkedResources($resource->get('id')); (54 line) for fix.

if(is_array($resource)) {
     $resource = $modx->getObject('modResource', array(
            'id' => $resource['id']
     ));
}

srnden avatar Nov 01 '18 10:11 srnden

This is fixed with 3.2.0.

Jako avatar Mar 27 '24 14:03 Jako