[BUGFIX] t3editor: Add properties from supertypes to autocomplete 77/42077/4
authorMorton Jonuschat <m.jonuschat@mojocode.de>
Tue, 28 Jul 2015 21:06:57 +0000 (23:06 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Tue, 28 Jul 2015 21:34:59 +0000 (23:34 +0200)
Fix the condition that checks if a TypoScript property of the supertype
needs to be added to the current node in the tree.

Resolves: #68440
Releases: master
Change-Id: Ie592c84f572e6a7d849c4e73716760356d863ae9
Reviewed-on: http://review.typo3.org/42077
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/t3editor/Resources/Public/JavaScript/Plugins/CodeCompletion/TsRef.js

index bd8e099..e61e02f 100644 (file)
@@ -88,7 +88,7 @@ define('TYPO3/CMS/T3editor/Plugins/CodeCompletion/TsRef', ['jquery'], function (
                        if (typeof arr['extends'] !== 'undefined') {
                                TsRef.typeTree[typeId]['extends'] = arr['extends'];
                        }
-                       for (propName in arr.properties) {
+                       for (var propName in arr.properties) {
                                var propType = arr.properties[propName].type;
                                TsRef.typeTree[typeId].properties[propName] = new TsRef.TsRefProperty(typeId, propName, propType);
                        }
@@ -121,9 +121,9 @@ define('TYPO3/CMS/T3editor/Plugins/CodeCompletion/TsRef', ['jquery'], function (
                                        TsRef.addPropertiesToType(TsRef.typeTree[exts[i]], TsRef.typeTree[exts[i]]['extends'], maxRecDepth-1);
                                }
                                var properties = TsRef.typeTree[exts[i]].properties;
-                               for (propName in properties) {
+                               for (var propName in properties) {
                                        // only add this property if it was not already added by a supertype (subtypes override supertypes)
-                                       if (typeof addToType.properties[propName] !== 'undefined') {
+                                       if (typeof addToType.properties[propName] === 'undefined') {
                                                addToType.properties[propName] = properties[propName];
                                        }
                                }
@@ -185,4 +185,4 @@ define('TYPO3/CMS/T3editor/Plugins/CodeCompletion/TsRef', ['jquery'], function (
        };
 
        return TsRef;
-});
\ No newline at end of file
+});