Bug #18427

Required fields within flexform section elements cause Javascript errors

Added by Jeff Segars almost 12 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
-
Target version:
-
Start date:
2008-03-11
Due date:
% Done:

0%

TYPO3 Version:
4.2
PHP Version:
5.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

If a flexform uses section elements with required fields, a Javascript error is generated as soon as the form is loaded and that flexform cannot be saved.

I believe this is related to changeset 2628, which made significant enhancements to section handling. To see the error in action, check out the Scoring Tab within the pb_survey plugin.

The error message is "document[TBE_EDITOR.formname][elementName] has no properties". Once the required eval is removed, the Javascript errors go away because the code causing the error is no longer executed.

(issue imported from #M7829)

7829_required_check.diff View (1.28 KB) Administrator Admin, 2008-03-11 23:36

0007829.patch View (1.55 KB) Administrator Admin, 2008-03-17 17:58


Related issues

Related to TYPO3 Core - Bug #18429: required fields in Flexform are not correct marked with Exclamation Sign Closed 2008-03-12
Duplicates TYPO3 Core - Bug #18751: JavaScript error in TBE_EDITOR causes login expired dialog Closed 2008-05-06

History

#1 Updated by Steffen Kamper almost 12 years ago

i fixed the JS Error with the patch.

This is only one half. With IRRE the naming of the field differs from record to record so JS has to search in childs for matching field.

For first i returned true in this case and marked it with TODO

#2 Updated by Oliver Hader almost 12 years ago

Hm, how can I test/reproduce this?
I fetched pbsurvey v. 1.2.0 from TER but could not find the string "inline" in the whole extension. Thus, I don't understand, where the IRRE factor comes into this game... Please enlighten me! :)

#3 Updated by Steffen Kamper almost 12 years ago

Hi Olly,

fine that you stumble also :-)
This technique is new for me, in flexform the element (eg result) is declared as array with section=1, i think this is the part doing the magic.

To reproduce it following steps:
1) got to a page and create a CE with pbsurvey
2) go to scoring tab, add a element and enter a value for scoring
3) save it

#4 Updated by Oliver Hader almost 12 years ago

Thanks Steffen. I can reproduce this behaviour resulting in my back-end session getting cleared.
This new technique for flexforms feels like IRRE, but isn't. That's why I stumbled and was astonished how this could be related to IRRE if it isn't defined anywhere in the pbsurvey extension.

#5 Updated by Steffen Kamper almost 12 years ago

I would propose to use the patch as first step so it will work (only required will not be checked in this special case)

Secondly the required check in eval script should be enhanced, i have no quick solution herefore, i also miss any documentation about this feature.

#6 Updated by Oliver Hader over 11 years ago

I've attached a new patch which is very similar to Steffen's.
Currently there's no other solution to fix it since it goes much deeper to handle the flexform thingy which ignores nearly any other TYPO3 parts...

Thus, the bugfix is to avoid the JavaScript errors - a real bugfix would be to rewrite Kasper's dynamic flexform fields...

#7 Updated by Oliver Hader over 11 years ago

Duplicate... ;-)

#8 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF