Fixed bug #13294: IRRE deleted combo records are still validated by TBE_EDITOR (Thank...
authorSusanne Moog <typo3@susannemoog.de>
Tue, 19 Oct 2010 14:00:18 +0000 (14:00 +0000)
committerSusanne Moog <typo3@susannemoog.de>
Tue, 19 Oct 2010 14:00:18 +0000 (14:00 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/branches/TYPO3_4-4@9165 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/jsfunc.inline.js
typo3/jsfunc.tbe_editor.js

index 8987301..e6251b7 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2010-10-19  Susanne Moog  <typo3@susanne-moog.de>
 
-       * Fixed bug #15095: Bug: The Web>Versioning view has style issues resulting in "wrong layers"
+       * Fixed bug #15095: The Web>Versioning view has style issues resulting in "wrong layers"
+       * Fixed bug #13294: IRRE deleted combo records are still validated by TBE_EDITOR (Thanks to Marcel Greter)
 
 2010-10-18  Stanislas Rolland  <typo3@sjbr.ca>
 
index cfdb863..6c6db63 100644 (file)
@@ -61,8 +61,8 @@ var inline = {
                                $(objectId + '_iconcontainer').addClassName('loading-indicator');
                        }
                        return this.getRecordDetails(objectId, returnURL);
-               }               
-               
+               }
+
                var currentState = '';
                var collapse = new Array();
                var expand = new Array();
@@ -118,7 +118,7 @@ var inline = {
                        ucFormObj[0].value = value;
                }
        },
-       
+
        getRecordDetails: function(objectId, returnURL) {
                inline.makeAjaxCall('getRecordDetails', [inline.getNumberOfRTE(), objectId, returnURL], true);
                return false;
@@ -717,6 +717,12 @@ var inline = {
                        TBE_EDITOR.removeElementArray(removeStack);
                }
 
+                       // Mark this container as deleted
+               var deletedRecordContainer = $(objectId + '_div');
+               if (deletedRecordContainer) {
+                       deletedRecordContainer.addClassName('inlineIsDeletedRecord');
+               }
+
                        // If the record is new and was never saved before, just remove it from DOM:
                if (this.isNewRecord(objectId) || options && options.forceDirectRemoval) {
                        this.fadeAndRemove(objectId+'_div');
@@ -933,7 +939,7 @@ var inline = {
 
        setVisibilityOfElementsWithClassName: function(action, selector, parentElement) {
                var domObjects = Selector.findChildElements($(parentElement), [selector]);
-               if (action == 'hide') { 
+               if (action == 'hide') {
                        $A(domObjects).each(function(domObject) { new Effect.Fade(domObject); });
                } else if (action == 'show') {
                        $A(domObjects).each(function(domObject) { new Effect.Appear(domObject); });
index 8dc8db7..f8b1f42 100644 (file)
@@ -73,7 +73,7 @@ var TBE_EDITOR = {
                cm: new Image(),
                sel: new Image(),
                clear: new Image()
-       },      
+       },
 
        // Handling of data structures:
        addElements: function(elements) {
@@ -195,6 +195,14 @@ var TBE_EDITOR = {
                if (type) {
                        if (type == 'required') {
                                form = document[TBE_EDITOR.formname][elementName];
+                                       // Check if we are within a deleted inline element
+                               var testNode = $(form.parentNode);
+                               while(testNode) {
+                                       if (testNode.hasClassName && testNode.hasClassName('inlineIsDeletedRecord')) {
+                                               return result;
+                                       }
+                                       testNode = $(testNode.parentNode);
+                               }
                                if (form) {
                                        var value = form.value;
                                        if (!value || elementData.additional && elementData.additional.isPositiveNumber && (isNaN(value) || Number(value) <= 0)) {
@@ -220,7 +228,7 @@ var TBE_EDITOR = {
                                                // special treatment for file uploads
                                        var tempObj = document[TBE_EDITOR.formname][elementName.replace(/^data/, 'data_files')];
                                        numberOfElements = form.length;
-                                       
+
                                        if (tempObj && tempObj.type == 'file' && tempObj.value) {
                                                numberOfElements++; // Add new uploaded file to the number of elements
                                        }
@@ -475,7 +483,7 @@ var TBE_EDITOR = {
        },
        submitForm: function() {
                if (TBE_EDITOR.doSaveFieldName) {
-                       document[TBE_EDITOR.formname][TBE_EDITOR.doSaveFieldName].value=1;                      
+                       document[TBE_EDITOR.formname][TBE_EDITOR.doSaveFieldName].value=1;
                }
                document[TBE_EDITOR.formname].submit();
        },
@@ -550,13 +558,13 @@ var TBE_EDITOR = {
        },
        toggle_display_states: function(id, state_1, state_2) {
                var node = document.getElementById(id);
-               if (node) {     
+               if (node) {
                        switch (node.style.display) {
                                case state_1:
                                        node.style.display = state_2;
                                        break;
                                case state_2:
-                                       node.style.display = state_1; 
+                                       node.style.display = state_1;
                                        break;
                        }
                }