[BUGFIX] TCA: Suggest wizard doesn't work in wizard_edit popup
authorLaurent Cherpit <laurent.cherpit@gmail.com>
Thu, 11 Aug 2011 15:48:02 +0000 (17:48 +0200)
committerXavier Perseguers <xavier@typo3.org>
Mon, 24 Oct 2011 17:18:12 +0000 (19:18 +0200)
When suggest wizard is used in a form open from the wizard_edit
popup wizard, javascript cannot access to "top.TS.PATH_typo3" value.

Change-Id: I300d297713c92e6b3fba58bf92ae0198d5abafe2
Resolves: #28930
Related: #23789
Releases: 4.6, 4.5, 4.4
Reviewed-on: http://review.typo3.org/4277
Reviewed-by: Björn Pedersen
Reviewed-by: Tolleiv Nietsch
Tested-by: Tolleiv Nietsch
Reviewed-by: Stefan Neufeind
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
t3lib/js/jsfunc.tceforms_suggest.js

index 74511ee..1aa216d 100644 (file)
@@ -52,11 +52,12 @@ TCEForms.Suggest = Class.create({
         * @param  integer minimumCharacters the minimum characaters that is need to trigger the initial search
         */
        initialize: function(objectId, table, field, uid, pid, minimumCharacters) {
+               var PATH_typo3 = top.TS.PATH_typo3 || window.opener.top.TS.PATH_typo3;
                this.objectId = objectId;
                this.suggestField = objectId + 'Suggest';
                this.suggestResultList = objectId + 'SuggestChoices';
 
-               new Ajax.Autocompleter(this.suggestField, this.suggestResultList, top.TS.PATH_typo3 + 'ajax.php', {
+               new Ajax.Autocompleter(this.suggestField, this.suggestResultList, PATH_typo3 + 'ajax.php', {
                                paramName: 'value',
                                minChars: (minimumCharacters ? minimumCharacters : this.minimumCharacters),
                                updateElement: this.addElementToList.bind(this),