Project

General

Profile

Actions

Bug #32284

closed

Fatal Error in EM: use stdClass as array

Added by Boris Senker over 12 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Should have
Category:
Extension Manager
Target version:
-
Start date:
2011-12-04
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

When trying to update configurations of some extensions (most of them), in this case the core htmlArea RTE or the EM settings itself, the extensions settings just won't save, and the error generated is

Fatal error: Cannot use object of type stdClass as array in /home/geamag/typo3_src-4.6.1/typo3/sysext/em/classes/connection/class.tx_em_connection_extdirectserver.php on line 297

and no settings are saved.

The same is loggen in webserver's error log. I was able to reproduce this in any browser I have tried - FF 8, IE 8, Chrome...

At this point the TYPO3 is unusable for content editors as I can't turn on the images integration into RTE. The 4.6 branch seems to be packed with bugs, especially the ones related to EM which is, with all due respect, barely usable.

Typo3 4.6.0 clean install, upgraded to 4.6.1.

PHP 5.3.8 on a setup that worked with all old versions flawlessly.


Files

4.6.0-cleaninstall.gif (22.6 KB) 4.6.0-cleaninstall.gif Boris Senker, 2011-12-06 19:39
4.6.1-cleaninstall.gif (22 KB) 4.6.1-cleaninstall.gif Boris Senker, 2011-12-06 19:56
phpinfo.pdf (902 KB) phpinfo.pdf Basti Baumann, 2012-01-05 11:27

Related issues 3 (0 open3 closed)

Has duplicate TYPO3 Core - Bug #25900: EM won't save Configuration: Cannot use object of type stdClass as arrayClosedSteffen Gebert2011-04-12

Actions
Has duplicate TYPO3 Core - Bug #29074: Extension Manager - Fatal error on extension uploadClosedSteffen Gebert2011-08-18

Actions
Has duplicate TYPO3 Core - Bug #25170: Overriding local extension fails: Cannot use object of type stdClass as arrayClosed2011-02-24

Actions
Actions #1

Updated by Boris Senker over 12 years ago

Firebug output:

JSON        
action
    "ExtDirect" 
data
    [Object {}, "20b4b5c84ed2652bfc4b540a90f4ba2b1f32e2cf"]
0
    Object {}    
1
    "20b4b5c84ed2652bfc4b540a90f4ba2b1f32e2cf" 
method
    "saveExtensionConfiguration" 
tid
    4
type
    "rpc" 
Source
{"action":"ExtDirect","method":"saveExtensionConfiguration","data":[{},"20b4b5c84ed2652bfc4b540a90f4ba2b1f32e2cf"],"type":"rpc","tid":4}
Actions #2

Updated by Michael Stucki over 12 years ago

  • Status changed from New to Needs Feedback

Can you reproduce this with a fresh dummy site?
If not then please clean any passwords from your localconf.php and post it here...

Actions #3

Updated by Boris Senker over 12 years ago

Hi Michael,

since I have installed the 4.6.0 source + dummy on the site I have reported this for, I did the same, clean 4.6.0 install, and have reproduced it.

The attached screenshot is the one of the extension settings save, and it's hanging in circles without ever finishing or saving data.

Localconf.php:

<?php
if (!defined ('TYPO3_MODE')) {
        die ('Access denied.');
}

$TYPO3_CONF_VARS['SYS']['sitename'] = 'New TYPO3 site';

        // Default password is "joh316" :
$TYPO3_CONF_VARS['BE']['installToolPassword'] = 'HIDDEN';

$TYPO3_CONF_VARS['EXT']['extList'] = 'info,perm,func,filelist,about,version,tsconfig_help,context_help,extra_page_cm_options,impexp,sys_note,tstemplate,tstemplate_ceditor,tstemplate_info,tstemplate_objbrowser,tstemplate_analyzer,func_wizards,wizard_crpages,wizard_sortpages,lowlevel,install,belog,beuser,aboutmodules,setup,taskcenter,info_pagetsconfig,viewpage,rtehtmlarea,css_styled_content,t3skin,t3editor,reports,felogin,form';

$typo_db_extTableDef_script = 'extTables.php';

## INSTALL SCRIPT EDIT POINT TOKEN - all lines after this points may be changed by the install script!

$TYPO3_CONF_VARS['EXT']['extList'] = 'extbase,css_styled_content,info,perm,func,filelist,about,version,tsconfig_help,context_help,extra_page_cm_options,impexp,sys_note,tstemplate,tstemplate_ceditor,tstemplate_info,tstemplate_objbrowser,tstemplate_analyzer,func_wizards,wizard_crpages,wizard_sortpages,lowlevel,install,belog,beuser,aboutmodules,setup,taskcenter,info_pagetsconfig,viewpage,rtehtmlarea,t3skin,t3editor,reports,felogin,form,adodb,dbal,cshmanual,feedit,opendocs,recycler,scheduler,fluid,workspaces';     // Modified or inserted by TYPO3 Extension Manager.  Modified or inserted by TYPO3 Core Update Manager.
// Updated by TYPO3 Core Update Manager 06-12-11 19:03:52
$TYPO3_CONF_VARS['BE']['installToolPassword'] = '19790801c00abe1156b59ea3ab434e10';     //  Modified or inserted by TYPO3 Install Tool.
$typo_db_username = 'HIDDEN';     //  Modified or inserted by TYPO3 Install Tool.
$typo_db_password = 'HIDDEN';   //  Modified or inserted by TYPO3 Install Tool.
$typo_db = 'HIDDEN';
$typo_db_host = 'localhost';    //  Modified or inserted by TYPO3 Install Tool.
$TYPO3_CONF_VARS['SYS']['sitename'] = 'HIDDEN'; //  Modified or inserted by TYPO3 Install Tool.
$TYPO3_CONF_VARS['SYS']['encryptionKey'] = '28180b71efe40d58061ce813acd40333cc54fbde7a8a47dc93bf04caa5bb9033dc07108a978f3ab507fde6083c7303bd';       //  Modified or inserted by TYPO3 Install Tool.
$TYPO3_CONF_VARS['BE']['disable_exec_function'] = '0';  //  Modified or inserted by TYPO3 Install Tool.
$TYPO3_CONF_VARS['GFX']['gdlib_png'] = '0';     // Modified or inserted by TYPO3 Install Tool. 
$TYPO3_CONF_VARS['GFX']['im_combine_filename'] = 'composite';   //  Modified or inserted by TYPO3 Install Tool.
$TYPO3_CONF_VARS['GFX']['jpg_quality'] = '75';  //  Modified or inserted by TYPO3 Install Tool.
$TYPO3_CONF_VARS['SYS']['cookieDomain'] = 'HIDDEN';        //  Modified or inserted by TYPO3 Install Tool.
$TYPO3_CONF_VARS['SYS']['doNotCheckReferer'] = '1';     //  Modified or inserted by TYPO3 Install Tool.
$TYPO3_CONF_VARS['SYS']['curlUse'] = '1';       //  Modified or inserted by TYPO3 Install Tool.
$TYPO3_CONF_VARS['SYS']['t3lib_cs_convMethod'] = 'iconv';       //  Modified or inserted by TYPO3 Install Tool.
$TYPO3_CONF_VARS['SYS']['t3lib_cs_utils'] = 'iconv';    //  Modified or inserted by TYPO3 Install Tool.
$TYPO3_CONF_VARS['SYS']['UTF8filesystem'] = '1';        //  Modified or inserted by TYPO3 Install Tool.
$TYPO3_CONF_VARS['BE']['unzip_path'] = 'unzip'; //  Modified or inserted by TYPO3 Install Tool.
$TYPO3_CONF_VARS['BE']['cookieDomain'] = 'HIDDEN'; //  Modified or inserted by TYPO3 Install Tool.
$TYPO3_CONF_VARS['BE']['versionNumberInFilename'] = '0';        //  Modified or inserted by TYPO3 Install Tool.
$TYPO3_CONF_VARS['FE']['noPHPscriptInclude'] = '1';     //  Modified or inserted by TYPO3 Install Tool.
$TYPO3_CONF_VARS['FE']['pageNotFound_handling'] = '1';  //  Modified or inserted by TYPO3 Install Tool.
$TYPO3_CONF_VARS['FE']['cookieDomain'] = 'HIDDEN'; //  Modified or inserted by TYPO3 Install Tool.
$TYPO3_CONF_VARS['MAIL']['transport'] = 'smtp'; //  Modified or inserted by TYPO3 Install Tool.
$TYPO3_CONF_VARS['MAIL']['transport_smtp_server'] = 'localhost:587';    //  Modified or inserted by TYPO3 Install Tool.
$TYPO3_CONF_VARS['MAIL']['transport_smtp_username'] = 'HIDDEN';     //  Modified or inserted by TYPO3 Install Tool.
$TYPO3_CONF_VARS['MAIL']['transport_smtp_password'] = 'HIDDEN';        //  Modified or inserted by TYPO3 Install Tool.
$TYPO3_CONF_VARS['MAIL']['defaultMailFromAddress'] = 'HIDDEN';      //  Modified or inserted by TYPO3 Install Tool.
$TYPO3_CONF_VARS['MAIL']['defaultMailFromName'] = 'HIDDEN';      //  Modified or inserted by TYPO3 Install Tool.
$TYPO3_CONF_VARS['SYS']['setDBinit'] = '';      //  Modified or inserted by TYPO3 Install Tool.
$TYPO3_CONF_VARS['BE']['forceCharset'] = '';    //  Modified or inserted by TYPO3 Install Tool.
$TYPO3_CONF_VARS['SYS']['compat_version'] = '4.6';      //  Modified or inserted by TYPO3 Install Tool.
// Updated by TYPO3 Install Tool 06-12-11 19:17:30
$TYPO3_CONF_VARS['EXT']['extList_FE'] = 'extbase,css_styled_content,version,install,rtehtmlarea,t3skin,felogin,form,adodb,dbal,feedit,fluid,workspaces';     // Modified or inserted by TYPO3 Extension Manager. 
// Updated by TYPO3 Extension Manager 06-12-11 19:17:41
$TYPO3_CONF_VARS['INSTALL']['wizardDone']['tx_coreupdates_installsysexts'] = '1';       //  Modified or inserted by TYPO3 Upgrade Wizard.
// Updated by TYPO3 Upgrade Wizard 06-12-11 19:17:41
// Updated by TYPO3 Extension Manager 06-12-11 19:17:45
$TYPO3_CONF_VARS['INSTALL']['wizardDone']['tx_coreupdates_installnewsysexts'] = '1';    //  Modified or inserted by TYPO3 Upgrade Wizard.
// Updated by TYPO3 Upgrade Wizard 06-12-11 19:17:45
// Updated by TYPO3 Extension Manager 06-12-11 19:17:49@

The fresh test installation from 4.6.1 will follow shortly, and I will update here as soon it's done.

Actions #4

Updated by Boris Senker over 12 years ago

4.6.1 same thing, identical. I was really hoping it wouldn't be.

Actions #5

Updated by Steffen Gebert over 12 years ago

  • Priority changed from Must have to Should have

Is this the same problem as #25900?

Actions #6

Updated by Steffen Gebert over 12 years ago

  • Subject changed from class.tx_em_connection_extdirectserver.php on line 297 to Fatal Error in EM: use stdClass as array
Actions #7

Updated by Boris Senker over 12 years ago

Hi Steffen,

yes it seems to be:

[Tue Dec 06 19:54:23 2011] [warn] [client HIDDEN] mod_fcgid: stderr: PHP Fatal error:  Cannot use object of type stdClass as array in /home/HIDDEN/typo3_src-4.6.1/typo3/sysext/em/classes/connection/class.tx_em_connection_extdirectserver.php on line 297, referer: http://www.HIDDEN/typo3/mod.php?M=tools_em

Trying to update any extension's settings leads to this.

Thanks much,

B.

Actions #8

Updated by Boris Senker over 12 years ago

Upgraded to 4.6.2, still the same.

Actions #9

Updated by Boris Senker over 12 years ago

Upgraded to 4.6.3, still the same.

Actions #10

Updated by Steffen Gebert over 12 years ago

Okay.. I found some duplicates of this issue, but all related to the Extension Manager - and I think to Ext.Direct.

Who can give me access to a test installation?

Actions #11

Updated by Boris Senker over 12 years ago

Steffen,

I can if you need.

Actions #12

Updated by Steffen Gebert over 12 years ago

Fine. SSH would be nice, in doubt FTP access. Please mail me to steffen.gebert@t3o. Thanks! Would be nice, if you could send me also your skype user name.

Actions #13

Updated by Boris Senker over 12 years ago

Hi Steffen,

mail sent.

Thanks :)

Actions #14

Updated by Steffen Gebert over 12 years ago

Okay, so who if you is using eAccelerator?

Please all check your Reports module, whether it complains about the "PHP Doc Comments" for Extbase and that you should recompile it with --with-eaccelerator-doc-comment-inclusion. The Ext.Direct API generator also uses PHP Doc "reflection" to generate the API. So this is a very good idea, which Tim Riemenschneider brought up today in the dev-List.

Boris, for you this is the case!

Actions #15

Updated by Steffen Gebert over 12 years ago

BTW who added Kasper as watcher? :D

Actions #16

Updated by Jan Simbera over 12 years ago

I can confirm, that disabling the eaccelerator solves the problem for me. On typo 4.5.10.

Actions #17

Updated by Boris Senker over 12 years ago

Confirmed here as well, disabling eAccelerator fixes it.

Jan, which eAccelerator version were you using? I have been using eAccelerator with T3 for quite some time, and I have never seen such issue until 4.6.0 OR the version 0.9.6 OR 0.9.6.1, that's why I wasn't suspecting it as it wasn't creating such issues for me before. Just for the testing sake, I will try putting 0.9.5 branch just to see if it reproduces, and will try a couple of alternate opcode cachers like xCache or APC and see what happens with them.

Please all check your Reports module, whether it complains about the "PHP Doc Comments" for Extbase and that you should recompile it with --with-eaccelerator-doc-comment-inclusion. The Ext.Direct API generator also uses PHP Doc "reflection" to generate the API. So this is a very good idea, which Tim Riemenschneider brought up today in the dev-List.

I always had EA compiled without --with-eaccelerator-doc-comment-inclusion as I have noticed PHP segfaulting it when eAccelerator was compiled --with-eaccelerator-doc-comment-inclusion on more than one occassion, so I was always compiling it without it anyway.

Steffen, thanks a LOT :)

Actions #18

Updated by Steffen Gebert over 12 years ago

I'm also relieved that the root cause is finally found!

I would say that this problem would also affect you in 4.5, if you use either Extbase or the new Extension Manager.

Actions #19

Updated by Basti Baumann over 12 years ago

Deactivating eaccelerator doesn´t work for me... :-( Can´t upload a extension to TER. I see only the "Please wait..." notice and this error: Fatal error: Cannot use object of type stdClass as array in /usr/www/users/vde/_sources/typo3_src-4.6.3/typo3/sysext/em/classes/connection/class.tx_em_connection_extdirectserver.php on line 657

Actions #20

Updated by Steffen Gebert over 12 years ago

The Ext.Direct API gets cached.. I don't know, if a new cache entry is automatically created or whether you have to clear the cache.

Could you check in Network tab of your browser's developer tool, what sent AJAX request is.

Actions #21

Updated by Basti Baumann over 12 years ago

Yes I can do this, but how? I´m using FF with web developer extension.

Actions #22

Updated by Steffen Gebert over 12 years ago

Please install Firebug then. There's a Net tab. Have you really cleared the cache?

Maybe you could even try to delete typo3temp/(/).js to make sure that the faulty API definition is gone.

Actions #23

Updated by Basti Baumann over 12 years ago

Yes I cleared the cache several times.
If I want to upload a new extension this request appears:
http://v2.domain.de/typo3/ajax.php?ajaxID=ExtDirect::route&namespace=TYPO3.EM

Date    Thu, 05 Jan 2012 08:33:24 GMT
Server    Apache
X-Powered-By    PHP/5.3.8
Expires    0
Cache-Control    no-cache, must-revalidate
Pragma    no-cache
Last-Modified    Thu, 05 Jan 2012 08:33:25 GMT
Keep-Alive    timeout=15, max=100
Connection    Keep-Alive
Transfer-Encoding    chunked
Content-Type    text/html

Host    v2.domain.de
User-Agent    Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20100101 Firefox/8.0
Accept    text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language    de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding    gzip, deflate
Accept-Charset    ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection    keep-alive
Content-Type    application/json; charset=UTF-8
X-Requested-With    XMLHttpRequest
Referer    http://v2.domain.de/typo3/mod.php?M=tools_em
Content-Length    125
Cookie    _pk_id.1.5055=d34ee0e63f270e6f.1318232454.85.1325750555.1325691405.; _pk_id.5.5055=85f468d0cd7d1c4b.1318337402.1.1318337402.1318337402.; typo3-login-cookiecheck=true; tx_phpmyadmin=f53c43c3854dea4794dad32118c9ae5c; be_typo_user=78fddb184af31fff4a87b536d7162658
Pragma    no-cache
Cache-Control    no-cache

Actions #24

Updated by Steffen Gebert over 12 years ago

Could you please add POST data (or content of the request - don't remember exactly)?

Actions #25

Updated by Basti Baumann over 12 years ago

I hope it´s ok ;)

http://v2.domain.de/typo3/ajax.php?ajaxID=ExtDirect::route&namespace=TYPO3.EM

POST /typo3/ajax.php?ajaxID=ExtDirect::route&namespace=TYPO3.EM HTTP/1.1
Host: v2.domain.de
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20100101 Firefox/8.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
Content-Type: application/json; charset=UTF-8
X-Requested-With: XMLHttpRequest
Referer: http://v2.domain.de/typo3/mod.php?M=tools_em
Content-Length: 124
Cookie: _pk_id.1.5055=d34ee0e63f270e6f.1318232454.85.1325750555.1325691405.; _pk_id.5.5055=85f468d0cd7d1c4b.1318337402.1.1318337402.1318337402.; typo3-login-cookiecheck=true; tx_phpmyadmin=f53c43c3854dea4794dad32118c9ae5c; be_typo_user=78fddb184af31fff4a87b536d7162658
Pragma: no-cache
Cache-Control: no-cache
{"action":"ExtDirect","method":"uploadExtToTer","data":[{},"88458d799d90537094d05197b4bc3eb077336f8f"],"type":"rpc","tid":4}

HTTP/1.1 200 OK
Date: Thu, 05 Jan 2012 08:52:27 GMT
Server: Apache
X-Powered-By: PHP/5.3.8
Expires: 0
Cache-Control: no-cache, must-revalidate
Pragma: no-cache
Last-Modified: Thu, 05 Jan 2012 08:52:28 GMT
Keep-Alive: timeout=15, max=99
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html
Actions #26

Updated by Steffen Gebert over 12 years ago

Okay.. again "data":[{}, .. :(

Still, it looks like eAccelerator is a good starting point. Could you post/attach a PHP info, please?

Basti, can you reproduce this in different installations on the same server / a copy of the installation on a different server?

Actions #27

Updated by Basti Baumann over 12 years ago

phpinfo is attached.
I´ll test it on a different / same server.

Actions #28

Updated by Sebastian Böttger over 12 years ago

Might be this sticks together with the problem I had (Debian Server), which occurs if you're using fast-CGI.

http://www.codeviolation.de/apache/http-request-length-exceeds-maxrequestlen/

This leads to the ext.direct error in the frontend, and an Internal Server Error 500 in the apache error log.
The following change in your apache configuration will do the trick:

We added this (mod_fcgid version 2.35):

<IfModule mod_fcgid.c>
MaxRequestLen 1000000000
</IfModule>

For mod_fcgid version 2.36, add this:

<IfModule mod_fcgid.c>
FcgidMaxRequestLen 1000000000
</IfModule> 
Actions #29

Updated by Steffen Gebert over 12 years ago

But why does the request length matter? Sebastian, could you check, whether without the increased limits, the data array is really empty or whether it's another bug? Problem is that in the previously mentioned cases no data is sent at all..

basti, could you please have a look at the reports module, whether the Extbase-Check for the stripped phpdoc comments fails?

Actions #30

Updated by Basti Baumann over 12 years ago

Good morning,

surprise, surprise, surprise,... today the upload worked.
Maybe the reason could be the new server we´ve got last week,,,,
But the configuration ist just the same... very strange!

Actions #31

Updated by Steffen Gebert about 12 years ago

  • Status changed from Needs Feedback to Closed
  • Assignee set to Steffen Gebert
  • TYPO3 Version changed from 4.6 to 4.5

Closed. If this problem exists for you and you don't have eAccelerator, please ask in the mailing lists to further debug the problem.

Actions #32

Updated by Michael Monnerie over 11 years ago

We just upgraded a site from 4.2.9 to 4.5.19, and ran into a problem where we needed an extension installed. We had exactly this problem:

PHP Fatal error: Cannot use object of type stdClass as array in /www/_shared/typo3_src-4.5.19/typo3/sysext/em/classes/connection/class.tx_em_connection_extdirectserver.php on line 1354

Deactivating eaccelerator helped fixing it. As we need that to run: is there a fix to this problem other than deactivation eaccelerator?

Actions #33

Updated by Steffen Gebert over 11 years ago

Yes, you just have to compile eAccelerator with option --with-eaccelerator-doc-comment-inclusion

Actions

Also available in: Atom PDF