Bug #89269

$GLOBALS['BE_USER']->uc sometimes wrongly written, gets a stdClass where an array would be expected

Added by Christian Eßl over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend API
Start date:
2019-09-25
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

Description

See issues:

https://forge.typo3.org/issues/88984
https://forge.typo3.org/issues/89268

It appears that since one of the latest patches (probalby 9.5.9), the uc is sometimes wrongly written and gets an stdClass where an array would be expected. This later leads to fatal errors because php expects an array, but gets an stdClass.
Both issues seem to be related to the pagetree / States and for now just fix the symptoms.

In #88984 it is the following setting that suddenly is an stdClass:
$this->getBackendUser()->uc['BackendComponents']['States']['typo3-module-menu']

In #89268 it is the key: (from javascript)
BackendComponents.States.Pagetree.stateHash.0_-1


Related issues

Related to TYPO3 Core - Bug #88984: Exception in BackendController 'Cannot use object of type stdClass as array' on $collapseState ( line 254 )Closed2019-08-20

Actions
Related to TYPO3 Core - Bug #89268: Cannot use object of type stdClass as array in BackendUserConfiguration.phpClosedChristian Eßl2019-09-25

Actions
Related to TYPO3 Core - Bug #86398: Interface state can't be savedClosed2018-09-27

Actions
Related to TYPO3 Core - Bug #89367: Revert introduction of new upgrade wizardClosedDaniel Goerz2019-10-08

Actions
Related to TYPO3 Core - Bug #89638: BackendUserConfigurationUpdate Upgrade Wizard fails on empty UC fieldsClosedDaniel Goerz2019-11-11

Actions
Related to TYPO3 Core - Bug #91407: Pagetree not shown due to error in TYPO3\CMS\Backend\Controller\Page\TreeControllerClosed2020-05-14

Actions
Related to TYPO3 Core - Task #91417: Add missing documentation for BackendUserConfigurationUpdateClosed2020-05-16

Actions
#1

Updated by Christian Eßl over 1 year ago

  • Related to Bug #88984: Exception in BackendController 'Cannot use object of type stdClass as array' on $collapseState ( line 254 ) added
#2

Updated by Christian Eßl over 1 year ago

  • Related to Bug #89268: Cannot use object of type stdClass as array in BackendUserConfiguration.php added
#3

Updated by Christian Eßl over 1 year ago

  • Description updated (diff)
#4

Updated by Christian Eßl over 1 year ago

  • Category set to Backend API
#5

Updated by Christian Eßl over 1 year ago

After digging around the code in master a bit, I couldn't find a spot, where the uc array could possibly be filled with a stdClass structure instead of an array.

In my case, the errors described in #89268 happened after upgrading a TYPO3 instance from 7.6 to the latest 9.5.
  • Maybe the uc array previously could contain stdClass properties in older TYPO3 versions? I can't say that for sure
  • Can't rule out that the wrong configuration could previously have been filled by a third-party extensions and this has nothing to do with the core.

Found another related ticket describing the same problems:
https://forge.typo3.org/issues/86398

I had the same error. It seems to occur when upgrading an old TYPO3 installation to 9.5. It was concerning only existing users - new users didn't have this problem. I suppose the reason is in the structure of the serialized array in be_users.uc. There might have been some structural changes.

My solution was quite simple: User Settings -> Edit and Advanced functions -> Reset user settings to default state.
Then the user config data is written new and the system can use it.

Maybe there coud be provided an upgrade wizard for this...

Looks like my guess with the structural changes in the uc array between versions could be right? Then maybe the fix in #89268 would be the wrong approach and an Upgrade Wizard that updates the uc structure for all backend users would be the right approach to fix this.
What do you think?

#6

Updated by Christian Eßl over 1 year ago

  • Related to Bug #86398: Interface state can't be saved added
#7

Updated by Gerrit Code Review over 1 year ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61874

#8

Updated by Gerrit Code Review over 1 year ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61874

#9

Updated by Gerrit Code Review over 1 year ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61916

#10

Updated by Daniel Goerz over 1 year ago

  • Related to Bug #89367: Revert introduction of new upgrade wizard added
#11

Updated by Christian Eßl over 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#12

Updated by Gerrit Code Review over 1 year ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61906

#13

Updated by Gerrit Code Review over 1 year ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61906

#14

Updated by Gerrit Code Review over 1 year ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61906

#15

Updated by Gerrit Code Review over 1 year ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61906

#16

Updated by Gerrit Code Review over 1 year ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61906

#17

Updated by Gerrit Code Review over 1 year ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61906

#18

Updated by Gerrit Code Review over 1 year ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61906

#19

Updated by Gerrit Code Review over 1 year ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62135

#20

Updated by Christian Eßl over 1 year ago

  • Status changed from Under Review to Resolved
#21

Updated by Daniel Goerz over 1 year ago

  • Related to Bug #89638: BackendUserConfigurationUpdate Upgrade Wizard fails on empty UC fields added
#22

Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed
#23

Updated by Oliver Hader 11 months ago

  • Related to Bug #91407: Pagetree not shown due to error in TYPO3\CMS\Backend\Controller\Page\TreeController added
#24

Updated by Oliver Hader 11 months ago

  • Related to Task #91417: Add missing documentation for BackendUserConfigurationUpdate added

Also available in: Atom PDF