Bug #89269
closed$GLOBALS['BE_USER']->uc sometimes wrongly written, gets a stdClass where an array would be expected
100%
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
Updated by Christian Eßl about 5 years ago
- Related to Bug #88984: Exception in BackendController 'Cannot use object of type stdClass as array' on $collapseState ( line 254 ) added
Updated by Christian Eßl about 5 years ago
- Related to Bug #89268: Cannot use object of type stdClass as array in BackendUserConfiguration.php added
Updated by Christian Eßl about 5 years 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?
Updated by Christian Eßl about 5 years ago
- Related to Bug #86398: Interface state can't be saved added
Updated by Gerrit Code Review about 5 years 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
Updated by Gerrit Code Review about 5 years 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
Updated by Gerrit Code Review about 5 years 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
Updated by Daniel Goerz about 5 years ago
- Related to Bug #89367: Revert introduction of new upgrade wizard added
Updated by Christian Eßl about 5 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset e8b5652d5a2a9c16d628804387dbff32dcb68f5f.
Updated by Gerrit Code Review about 5 years 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
Updated by Gerrit Code Review about 5 years 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
Updated by Gerrit Code Review about 5 years 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
Updated by Gerrit Code Review about 5 years 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
Updated by Gerrit Code Review about 5 years 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
Updated by Gerrit Code Review about 5 years 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
Updated by Gerrit Code Review about 5 years 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
Updated by Gerrit Code Review about 5 years 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
Updated by Christian Eßl about 5 years ago
- Status changed from Under Review to Resolved
Applied in changeset efbc7d8a61e7ffa03fc572e5a066b41dc0f23e1c.
Updated by Daniel Goerz about 5 years ago
- Related to Bug #89638: BackendUserConfigurationUpdate Upgrade Wizard fails on empty UC fields added
Updated by Benni Mack almost 5 years ago
- Status changed from Resolved to Closed
Updated by Oliver Hader over 4 years ago
- Related to Bug #91407: Pagetree not shown due to error in TYPO3\CMS\Backend\Controller\Page\TreeController added
Updated by Oliver Hader over 4 years ago
- Related to Task #91417: Add missing documentation for BackendUserConfigurationUpdate added