[BUGFIX] TCEForms.Suggest wizard in IRRE records
authorNicole Cordes <n.cordes@biz-design.biz>
Fri, 27 Apr 2012 14:45:24 +0000 (16:45 +0200)
committerTolleiv Nietsch <tolleiv.nietsch@typo3.org>
Mon, 4 Jun 2012 06:37:35 +0000 (08:37 +0200)
Currently suggest wizards don't work in IRRE records. This is because of
the missing javascript functions. IRRE elements are post loaded and
wirzards are not known on loading the parent form.

Change-Id: Id1c23d7e53c4e8499f13bb1776bf76c960995b04
Fixes: #27020
Releases: 6.0, 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/10831
Reviewed-by: Tolleiv Nietsch
Tested-by: Tolleiv Nietsch
t3lib/class.t3lib_tceforms.php

index ae7c83f..9e135bc 100644 (file)
@@ -5585,12 +5585,14 @@ class t3lib_TCEforms {
                                inline.setPrependFormFieldNames("' . $this->inline->prependNaming . '");
                                inline.setNoTitleString("' . addslashes(t3lib_BEfunc::getNoRecordTitle(TRUE)) . '");
                                ';
-                       }
-
-                               // If Suggest fields were processed, add the JS functions
-                       if ($this->suggest->suggestCount > 0) {
-                               $pageRenderer->loadScriptaculous();
+                                       // Always include JS functions for Suggest fields as we don't know what will come
                                $this->loadJavascriptLib('../t3lib/js/jsfunc.tceforms_suggest.js');
+                       } else {
+                                       // If Suggest fields were processed, add the JS functions
+                               if ($this->suggest->suggestCount > 0) {
+                                       $pageRenderer->loadScriptaculous();
+                                       $this->loadJavascriptLib('../t3lib/js/jsfunc.tceforms_suggest.js');
+                               }
                        }
 
                                // Toggle icons:
@@ -6715,4 +6717,4 @@ class t3lib_TCEforms {
        }
 }
 
-?>
\ No newline at end of file
+?>