Bug #31978

tcaTree: PHP Warning: Missing argument 2 for extDirect_DataProvider_BackendUserSettings::addToList()

Added by Georg Ringer over 3 years ago. Updated almost 3 years ago.

Status:Resolved Start date:2011-11-22
Priority:Should have Due date:
Assigned To:- % Done:

100%

Category:FormEngine aka TCEforms Spent time: -
Target version:4.5.12
TYPO3 Version:4.7 Is Regression:
PHP Version:5.3 Sprint Focus:
Complexity:easy

Description

the tcatree throws an error every time it is called. I am not into ExtJS and neither into the tcaTree itself but IMO those information should be enough to fix it.

How to test
-------------
Install EXT:news, create at least one category and call either the category record or the plugin - both got a tca tree implemented

Information from debugging
---------------------------
The error comes from class t3lib_TCEforms_Tree which got an inline JS

expandnode: function(node) {
        top.TYPO3.BackendUserSettings.ExtDirect.addToList("tcaTrees." + this.ucId, node.attributes.uid);
}

Problem is that node.attributes.uid is undefined. This happens with the root node

Using this code to debug

if (node.attributes.uid) {
    top.TYPO3.BackendUserSettings.ExtDirect.addToList("tcaTrees." + this.ucId, node.attributes.uid);
} else {
    alert(node);
}

shows 2 alert boxes with:
[Node xnode-27]
[Node root]

Possible solutions ======================
As already stated, I no nothing about ExtJS but there are IMO 2 possible solutions:
1) Use an if clause "if (node.attributes.uid) {"

2) Maybe it is even more simple as IMO it should be node.attributes.id as t3lib_tree_pagetree_DataProvider also uses e.g. "$node->setId('root');" The maybe wrong value is also used in TYPO3.Components.Tree.TcaCheckChangeHandler inside tree.js


Related issues

duplicated by Core - Bug #26741: Error at renderMode tree Rejected 2011-05-11

Associated revisions

Revision 5861645d
Added by Christoph Gerold almost 3 years ago

[BUGFIX] Do not save expand state for root node in TCA tree

To avoid a PHP warning: Missing argument for
BackendUserSettings::addToList() the expanded state must
not be saved for the tree root node which does not
have a uid property.

Change-Id: Id6d16525cd68e4ec13f36c8d95d2ecc0cc1bc794
Resolves: #31978
Releases: 4.5, 4.6, 4.7, 6.0
Reviewed-on: http://review.typo3.org/14285
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter

Revision c9558789
Added by Christoph Gerold almost 3 years ago

[BUGFIX] Do not save expand state for root node in TCA tree

To avoid a PHP warning: Missing argument for
BackendUserSettings::addToList() the expanded state must
not be saved for the tree root node which does not
have a uid property.

Change-Id: Id6d16525cd68e4ec13f36c8d95d2ecc0cc1bc794
Resolves: #31978
Releases: 4.5, 4.6, 4.7, 6.0
Reviewed-on: http://review.typo3.org/15168
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel

Revision 006dc6af
Added by Christoph Gerold almost 3 years ago

[BUGFIX] Do not save expand state for root node in TCA tree

To avoid a PHP warning: Missing argument for
BackendUserSettings::addToList() the expanded state must
not be saved for the tree root node which does not
have a uid property.

Change-Id: Id6d16525cd68e4ec13f36c8d95d2ecc0cc1bc794
Resolves: #31978
Releases: 4.5, 4.6, 4.7, 6.0
Reviewed-on: http://review.typo3.org/15170
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel

Revision 6139eaf8
Added by Christoph Gerold almost 3 years ago

[BUGFIX] Do not save expand state for root node in TCA tree

To avoid a PHP warning: Missing argument for
BackendUserSettings::addToList() the expanded state must
not be saved for the tree root node which does not
have a uid property.

Change-Id: Id6d16525cd68e4ec13f36c8d95d2ecc0cc1bc794
Resolves: #31978
Releases: 4.5, 4.6, 4.7, 6.0
Reviewed-on: http://review.typo3.org/15171
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel

History

#1 Updated by Ernesto Baschny over 3 years ago

  • Target version changed from 4.5.8 to 4.5.12

#2 Updated by Gerrit Code Review almost 3 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch TYPO3_4-7 has been pushed to the review server.
It is available at http://review.typo3.org/14285

#3 Updated by Gerrit Code Review almost 3 years ago

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/15168

#4 Updated by Gerrit Code Review almost 3 years ago

Patch set 2 for branch TYPO3_4-7 has been pushed to the review server.
It is available at http://review.typo3.org/14285

#5 Updated by Gerrit Code Review almost 3 years ago

Patch set 1 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/15170

#6 Updated by Gerrit Code Review almost 3 years ago

Patch set 1 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/15171

#7 Updated by Gerrit Code Review almost 3 years ago

Patch set 2 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/15171

#8 Updated by Gerrit Code Review almost 3 years ago

Patch set 2 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/15170

#9 Updated by Gerrit Code Review almost 3 years ago

Patch set 3 for branch TYPO3_4-7 has been pushed to the review server.
It is available at http://review.typo3.org/14285

#10 Updated by Gerrit Code Review almost 3 years ago

Patch set 3 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/15170

#11 Updated by Gerrit Code Review almost 3 years ago

Patch set 3 for branch TYPO3_4-5 has been pushed to the review server.
It is available at http://review.typo3.org/15171

#12 Updated by Gerrit Code Review almost 3 years ago

Patch set 4 for branch TYPO3_4-7 has been pushed to the review server.
It is available at http://review.typo3.org/14285

#13 Updated by Gerrit Code Review almost 3 years ago

Patch set 4 for branch TYPO3_4-6 has been pushed to the review server.
It is available at http://review.typo3.org/15170

#14 Updated by Christoph Gerold almost 3 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 20 to 100

Also available in: Atom PDF