Fixed bug #8336: JavaScript error in TBE_EDITOR causes login expired dialog
authorOliver Hader <oliver.hader@typo3.org>
Sat, 31 May 2008 13:07:27 +0000 (13:07 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Sat, 31 May 2008 13:07:27 +0000 (13:07 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@3744 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/jsfunc.tbe_editor.js

index 6aef896..5fc0f8f 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2008-05-31  Oliver Hader  <oliver@typo3.org>
+
+       * Fixed bug #8336: JavaScript error in TBE_EDITOR causes login expired dialog
 
 2008-05-30  Martin Kutschker  <masi@typo3.org>
 
index aab24ac..03d3234 100755 (executable)
@@ -190,28 +190,31 @@ var TBE_EDITOR = {
                return result;
        },
        checkElementByType: function(type, elementName, elementData, autoNotify) {
-               var result = 1;
+               var form, result = 1;
 
                if (type) {
                        if (type == 'required') {
-                               var value = document[TBE_EDITOR.formname][elementName].value;
-                               if (!value || elementData.additional && elementData.additional.isPositiveNumber && (isNaN(value) || Number(value) <= 0)) {
-                                       result = 0;
-                                       if (autoNotify) {
-                                               TBE_EDITOR.setImage('req_'+elementData.requiredImg, TBE_EDITOR.images.req);
-                                               TBE_EDITOR.notifyNested(elementName, false);
+                               form = document[TBE_EDITOR.formname][elementName];
+                               if (form) {
+                                       var value = form.value;
+                                       if (!value || elementData.additional && elementData.additional.isPositiveNumber && (isNaN(value) || Number(value) <= 0)) {
+                                               result = 0;
+                                               if (autoNotify) {
+                                                       TBE_EDITOR.setImage('req_'+elementData.requiredImg, TBE_EDITOR.images.req);
+                                                       TBE_EDITOR.notifyNested(elementName, false);
+                                               }
                                        }
                                }
                        } else if (type == 'range' && elementData.range) {
-                               var formObj = document[TBE_EDITOR.formname][elementName+'_list'];
-                               if (!formObj) {
+                               form = document[TBE_EDITOR.formname][elementName+'_list'];
+                               if (!form) {
                                                // special treatment for IRRE fields:
                                        var tempObj = document[TBE_EDITOR.formname][elementName];
                                        if (tempObj && Element.hasClassName(tempObj, 'inlineRecord')) {
-                                               formObj = tempObj.value ? tempObj.value.split(',') : [];
+                                               form = tempObj.value ? tempObj.value.split(',') : [];
                                        }
                                }
-                               if (!TBE_EDITOR.checkRange(formObj, elementData.range[0], elementData.range[1])) {
+                               if (!TBE_EDITOR.checkRange(form, elementData.range[0], elementData.range[1])) {
                                        result = 0;
                                        if (autoNotify) {
                                                TBE_EDITOR.setImage('req_'+elementData.rangeImg, TBE_EDITOR.images.req);