Project

General

Profile

Actions

Bug #18855

closed

Wrong JavaScript inclusion in t3lib_TCEforms

Added by Peter Niederlag almost 16 years ago. Updated over 15 years ago.

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

0%

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

Description

the handling of adding js-stuff in tceforms seems broken to me. ;(

prototype.js is added twice by default :-<

please see my comments in the supplied tceforms-comments.diff..

(issue imported from #M8518)


Files

tceforms-comments.diff (1.32 KB) tceforms-comments.diff Administrator Admin, 2008-05-26 16:04
20080528_tceforms_use_jsinclusion.patch (2.35 KB) 20080528_tceforms_use_jsinclusion.patch Administrator Admin, 2008-05-28 11:20
0008518_v2.patch (2.94 KB) 0008518_v2.patch Administrator Admin, 2008-07-12 11:51
patch-sections-8518.patch (697 Bytes) patch-sections-8518.patch Administrator Admin, 2008-10-22 15:34

Related issues 4 (0 open4 closed)

Related to TYPO3 Core - Bug #19429: Cannot enter double numbers in TCEforms anymoreClosedOliver Hader2008-10-07

Actions
Related to TYPO3 Core - Bug #19423: Edit in Rich Text Editor - Button doesn't work anymore in Web>PageClosedOliver Hader2008-10-06

Actions
Related to TYPO3 Core - Bug #19421: Setting password for a new BE user changes the field value to "undefined"ClosedOliver Hader2008-10-06

Actions
Related to TYPO3 Core - Bug #19496: Flexform sections are not working anymore since script.aculo.us is not loadedClosedOliver Hader2008-10-22

Actions
Actions #1

Updated by Oliver Hader almost 16 years ago

Tasks:
  • use $GLOBALS['TBE_TEMPLATE']->loadJavascriptLib([filename]) to include JavaScript sources (prototype, script.aculo.us and TBE_EDITOR) in the constructor of t3lib_TCEforms
  • remove inclusion of prototype.js from alt_doc.php
Later:
  • remove (again) static JavaScript from t3lib_TCEforms::JSbottom()
Actions #2

Updated by Benni Mack almost 16 years ago

Yes. Full ACK.

Never include prototype manually. Should definitively be something for 4.2.1.

Actions #3

Updated by Benni Mack almost 16 years ago

I did a quick hack using these function, but haven't tested that yet.

The real solution would be to change the "loadJavascriptLib()" to see if it is not just loaded in the local document, but also not loaded in the $GLOBALs[TBE_TEMPLATE]->Jslibs array. sounds good?

Actions #4

Updated by Oliver Hader almost 16 years ago

Thanks Benni, I changed your patch in one thing in alt_doc.php:
We have in alt_doc.php the class member $doc which gets an instance of "template" and additionally we have another instance in $GLOBALS['TBE_TEMPLATE'] - now $doc is a reference to the global template object. I currently cannot see any negative side-effects of that and also don't know why this once was separated.

Maybe this behaviour on different template instances could also be solved by a singleton pattern in general.

However, the patch now works with latest Trunk revision - if also tested it with some IRRE functionalities.

@Peter: The libs are now included in the HTML HEAD node, thus you can now add data again to t3lib_TCEforms->additionalJS_post.

Actions #5

Updated by Peter Niederlag almost 16 years ago

concerning the conditional statement within 'if ($this->inline->inlineCount) {':

We don't need sriptacoulous there!, it is already included in that branch just a couple of lines above. I don't see any sense in adding it again.

Actions #6

Updated by Oliver Hader over 15 years ago

Hi Peter, I just changed Benni's patch to work with current Trunk.
You're right, that needs not to be defined twice - however it it's only added once with the loadJavascriptLib() function. Loading the scriptaculous libs outside the "inline" block, was introduced by Kasper during 4.2 development - I don't know if it's really required for the flexform sections...
http://forge.typo3.org/repositories/diff/typo3v4-core?rev=2628

Actions #7

Updated by Oliver Hader over 15 years ago

Committed to SVN:
  • TYPO3_4-2 (rev. 4256)
  • Trunk (rev. 4257)
Actions #8

Updated by Stanislas Rolland over 15 years ago

Since revisions 4256/57, the Full Screen RTE wizard fails on js error: TBE_EDITOR is not defined.

Actions #9

Updated by Oliver Hader over 15 years ago

The fix of the introduced bug will be handled in issue #19423

Actions #10

Updated by Peter Niederlag over 15 years ago

Hi Olli,

---------------------------------------------------------------------
$this->loadJavascriptLib('contrib/scriptaculous/scriptaculous.js');
----------------------------------------------------------------------
is required for flexform sections to work. They are broken now. :-<

My suggestion would be to just move that line from the 'if ($this->inline->inlineCount) {' block to the gerneral block.

I'll attach a patch in a second

Actions #11

Updated by Oliver Hader over 15 years ago

The inclusion of scriptaculous should stay where it is.
But, additionally, when flexform sections are rendered/required, the same line of should be called there:
$this->loadJavascriptLib('contrib/scriptaculous/scriptaculous.js');

Additionally I'm going to create a new bug report for this issue.

Actions #12

Updated by Ralf Seliger over 15 years ago

This issue is NOT fixed in 4.2.2.

Actions #13

Updated by Oliver Hader over 15 years ago

Ralf, that depends on which "issue" you're talking about. The initial one WAS.
See fixes for side-effects in the relationships of this report or create a new report if you experienced others.

Actions

Also available in: Atom PDF