[PATCH] [BUGFIX] error TCA type="select" renderMode="tree" maxitems=1: no tree node selectable

mhuber84 marco.huber at marit.ag
Wed Mar 16 16:32:16 CET 2011


---
 t3lib/js/extjs/tree/tree.js                  |    4 ++--
 t3lib/tceforms/class.t3lib_tceforms_tree.php |    6 +++++-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/t3lib/js/extjs/tree/tree.js b/t3lib/js/extjs/tree/tree.js
index 0180a36..6190c7e 100644
--- a/t3lib/js/extjs/tree/tree.js
+++ b/t3lib/js/extjs/tree/tree.js
@@ -214,9 +214,9 @@ TYPO3.Components.Tree.TcaCheckChangeHandler = function(checkedNode, checked) {
 	if (this.countSelectedNodes >= this.tcaMaxItems) {
 		checkedNode.attributes.checked = false;
 		checkedNode.getUI().toggleCheck(false);
-		this.resumeEvents();
-		return false;
+		checked = false;
 	}
+	
 	if (checked) {
 		checkedNode.getUI().addClass('complete');
 	} else {
diff --git a/t3lib/tceforms/class.t3lib_tceforms_tree.php b/t3lib/tceforms/class.t3lib_tceforms_tree.php
index 303e787..0f8f9da 100644
--- a/t3lib/tceforms/class.t3lib_tceforms_tree.php
+++ b/t3lib/tceforms/class.t3lib_tceforms_tree.php
@@ -65,8 +65,12 @@ class t3lib_TCEforms_Tree {
 	 * @return string The HTML code for the TCEform field
 	 */
 	public function renderField($table, $field, $row, &$PA, $config, $possibleSelectboxItems, $noMatchLabel) {
-		$valueArray = explode(',', $PA['itemFormElValue']);
+		$valueArray = array();
 		$selectedNodes = array();
+		
+		if($PA['itemFormElValue'] != 0) {
+			$valueArray = explode(',', $PA['itemFormElValue']);
+		}
 		if (count($valueArray)) {
 			foreach ($valueArray as $selectedValue) {
 				$temp = explode('|', $selectedValue);
-- 
1.7.4.msysgit.0


--------------040700090203070504090406--


More information about the TYPO3-team-core mailing list