Fixed bug #5564: IRRE - foreign_selector/foreign_unique on click issue
authorOliver Hader <oliver.hader@typo3.org>
Wed, 23 May 2007 10:15:14 +0000 (10:15 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Wed, 23 May 2007 10:15:14 +0000 (10:15 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@2348 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/jsfunc.inline.js

index 70c7283..3b5569b 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2007-05-23  Oliver Hader  <oh@inpublica.de>
+
+       * Fixed bug #5564: IRRE - foreign_selector/foreign_unique on click issue
+
 2007-05-04  Dmitry Dulepov  <dmitry@typo3.org>
 
        * Fixed bug 5550: 'lower' TCA specification may fail with non-ascii characters
index ef9bad4..623a934 100755 (executable)
@@ -9,7 +9,7 @@
 *
 *  Copyright notice
 *
-*  (c) 2006 Oliver Hader <oh@inpublica.de>
+*  (c) 2006-2007 Oliver Hader <oh@inpublica.de>
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
@@ -207,13 +207,15 @@ var inline = {
                                        var values = $H(unique.used).values();
 
                                        if (fieldObj.length) {
-                                                       // remove all before used items from the new select-item
+                                                       // remove all items from the new select-item which are already used in other children
                                                for (var i=0; i<values.length; i++) this.removeSelectOption(fieldObj[0], values[i]);
-                                                       // set the selected item automatically to the first of the remaining items
-                                               selectedValue = fieldObj[0].options[0].value;
-                                               fieldObj[0].options[0].selected = true;
-                                               this.updateUnique(fieldObj[0], objectId, formName, recordUid);
-                                               this.handleChangedField(fieldObj[0], objectId+'['+recordUid+']');
+                                                       // set the selected item automatically to the first of the remaining items if no selector is used
+                                               if (!unique.selector) {
+                                                       selectedValue = fieldObj[0].options[0].value;
+                                                       fieldObj[0].options[0].selected = true;
+                                                       this.updateUnique(fieldObj[0], objectId, formName, recordUid);
+                                                       this.handleChangedField(fieldObj[0], objectId+'['+recordUid+']');
+                                               }
                                                if (typeof this.data.unique[objectId].used.length != 'undefined') {
                                                        this.data.unique[objectId].used = {};
                                                }