[TYPO3-dev] insertData feature in TS breaks Front end editing

Ben van Kruistum ben at wulf.nl
Mon Jul 21 21:35:06 CEST 2008


Hello Listreaders!

Today I was practicing with some typoscript and front end editing. At a 
given point the "hide" and "delete" features for front end editing didn't 
work anymore. When I click one of those buttons the javascript confirm fired 
but the actions didn't. Looking into the source code the onclick attribute 
in the href was set but incomplete. something like onclick="if(confirm('are 
you sure?')) return false;" so the piece of script that submits the form was 
gone.

Eventually it turned out that when setting page.stdWrap.insertData = 1 in my 
TS this problem occured. Digging into the code I found the function 
insertData in class.tslib_content.php that causes it. This function replaces 
all text between curly braces  with a match from the original value. So 
normally it expects {field:title} and the results from this is used, 
javascript functions that are parsed through this function are also affected 
resulting in the given problem above (All javascript code between curly 
braces is removed).

I don't know if it is recommended to use page.stdWrap.insertData, in my case 
it was only for some quick and dirty tests, but I could imagine that I could 
have used it for same reason somewhere else.

Ben.





 





More information about the TYPO3-dev mailing list