[BUGFIX] Suggest wizard for select element does not work when maxitems = 1 72/43672/2
authorStanislas Rolland <typo3@sjbr.ca>
Wed, 30 Sep 2015 21:47:07 +0000 (17:47 -0400)
committerWouter Wolters <typo3@wouterwolters.nl>
Thu, 8 Oct 2015 20:08:23 +0000 (22:08 +0200)
Problem: When selecting an item in the suggest wizard, a js error is
raised and the select element is not updated.
Solution: The value provided by FormEngineSuggest may be an integer.
Make it a string before applying a match function.

Resolves: #70238
Releases: master
Change-Id: I9e1944d1def442a36e17980df8696c7f6078747e
Reviewed-on: http://review.typo3.org/43672
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/backend/Resources/Public/JavaScript/FormEngine.js

index 965921f..a29d850 100644 (file)
@@ -160,9 +160,10 @@ define('TYPO3/CMS/Backend/FormEngine', ['jquery'], function ($) {
                } else {
 
                        // The incoming value consists of the table name, an underscore and the uid
+                       // or just the uid
                        // For a single selection field we need only the uid, so we extract it
                        var pattern = /_(\\d+)$/
-                                       ,result = value.match(pattern);
+                                       ,result = value.toString().match(pattern);
 
                        if (result != null) {
                                value = result[1];