Bug #16406
closedProcessing of userdefined tag does not work with USER or USER_INT PHP Scripts
0%
Description
When i try to make a userdefined tag, in kickstarter, then the output of the of the PHP main function is not displayed by selecting a USER Object. If i select a USER_INT Object then a HTML Comment is rendered that displays at the frontend. The HTML Code than is the following:
<p class="bodytext"><!--INT_SCRIPT.127ba841b619a0fa53a1bed08002e0df--></p>
There are no special needs t reproduce the error.
I started a second plugin as a normal FE-Plugin, this works quit good. Now i tried to use this as the Source for the Tag, the Tag shows the same Problems as described above.
If i can spend any information to speed up the solution of this topic, you can send me an email to poth@gmfoto.de.
THX for your help
Thomas
(issue imported from #M3933)
Updated by Peter Niederlag over 18 years ago
procession of userdefined tags is not one of the most easy tasks so you should have some knowledge about TYPO3 and its content processing by TypoScript.
You need to describe more precisly where you consider to be a bug if you expect it to be fixed. the plugin (userdefined tags) hooks into the 'lib.parseFunc.' series of TypoScript and only gets run when you have some
'<mytag>bal bla bla</myTag>'
within a regular content-element. Is that what you have done?
Updated by Thomas Poth over 18 years ago
Hi Peter,
ok, I try a little bit more precise.
i'm working with typo3 since Version 3.3, and since 2 years i'm developing extensions.
Until today, there was no need to code userdefined tags as extensions.
My project is to give our users the opportunity to display some Information from a WebService. As you described in your note they should add a tag <mytag>Some Text</mytag> in the Content Element Body.
Now i tried to add a new userdefined tag with kickstarter.
I've choosed the USER_INT Method for non cached output.
I edited the main Function of the plugin, so that the Tag should be replaced with a simple 'TEST'.
Now i put a tag in a content element.
I cleared all possible caches, including the browser one.
When i viewed the page, there's nothing rendered.
Now i changed the USER_INT to USER.
As i reportet, then a HTML Comment is rendered.
The next step i tried is to disconnect the extension from the tag.
I changed the following:
tt_content.text.20.parseFunc.tags.test = < plugin.user_test_pi2
to
tt_content.text.20.parseFunc.tags.mytag >
tt_content.text.20.parseFunc.tags.mytag = TEXT
tt_content.text.20.parseFunc.tags.mytag.value = TEST
A further try to in the Frondend shows up the rightly replaced Tag with the word TEST. It works ...
Now i was searching for the sources, where the output of USER an USER_INT Objects is rendered.
I found the class tslib_content.php which is, for my opp., responsible for rendering the two cObj's.
I found this code and wondered, how this should work:
function USER {
$content='';
switch($ext) {
case 'INT':
$substKey = $ext.'_SCRIPT.'.$GLOBALS['TSFE']->uniqueHash();
$content.='';
$GLOBALS['TSFE']->config[$ext.'incScript'][$substKey] = array(
'file' => $incFile,
'conf' => $conf,
'cObj' => serialize($this),
'type' => 'FUNC'
);
break;
default:
$content.=$this->callUserFunction($conf['userFunc'],$conf,'');
break;
}
return $content;
}
My Problem is now, i'm not so deep in the content rendering Process that a can understand if there's an error.
i hope you can now better understand the problem an hopefully work on a solution for it.
Best regards,
Thomas Poth
Updated by Peter Niederlag over 18 years ago
thx. now I know where you're at. ;)
plz try to completly get rid of that 'tt_content.text.20.parseFunc' stuff and have a look at 'lib.parseFunc_RTE' and/or 'lib.parseFunc'. Does it do any better if you register your tag there?
are U using css_styled_content or content(default) static template? That does make a differnce in the way the parsefunc is build and used within the TS-Setup. the Code by the Kickstarter AFAIR still provides stuff like for the (old) content(default) template.
It might(!) be that this is not quite working, it also might(!) be that you have some Cleaner-extension runnning that messes up all of your USER_INT object.
My best bet for the moment would be to search for some additional help/feedback from the kickstarters list.
Due to timesonstraints I can't fully check the issue right now.
Greets,
Peter
Updated by Thomas Poth over 18 years ago
Hi Peter,
thx for your help.
to your quests:
i'm working an typo3 4.0 with css_styled_content
I changed the parser from:
tt_content.text.20.parseFunc = < lib.parseFunc_RTE
to
tt_content.text.20.parseFunc = < lib.parseFunc
But with same results as before.
Can i do anything, to better troubleshoot this problem?
I really need this feature, and if i can, i will solve this problem.
It would be very nice if i can assist you.
First i need the knowledge of the css_styled_rendering process, where can i get further informations? which source files must be read?
Until know i will search and read the dev-list for related material.
OFF-TOPIC-START:
By the way, is there an new documentation for the 4.0 Version of T3. on www.typo3.org i found many documents related to Versions prior 3.6. Who is responsible for the documentation of the project, I would give my help?
OFF-TOPC-END:
Many thanks for the quick responses and a nice weekend.
Reg.
Thomas
Updated by Administrator Admin over 18 years ago
Hi,
I'm very new in typo3 (some days only) and got the same problem.
My first analyse :
responsible for the behaviour is in file class.tslib_content.php
from line 4339
// Parsing nonTypoTag content (all even keys):
reset($contentAccum);
...
...
if (is_array($conf['nonTypoTagStdWrap.'])) {$contentAccum[$a] = $this->stdWrap($contentAccum[$a],$conf['nonTypoTagStdWrap.']);}
At this line stdWrap is called for your tags replacement, thus converting
<> to ≶ >
If you change the parameter of your template for nonTypoTagStdWrap, your call should work
in SETUP add
tt_content.text .... .nonTypoTagStdWrap.HTMLparser.htmlSpecialChars = 0
to overwrite the stadard value from lib.parseFunc_RTE
Bye
anka
Updated by Thomas Poth over 18 years ago
HI all,
@anka: Thx for your input, i played arround with it and it works.
I added the folowing in TS Setup:
to:
tt_content.text.20.parseFunc.nonTypoTagStdWrap.HTMLparser.htmlSpecialChars = 0
Now it works fine.
I think this should be forwarded to the kickstarter group, to avoid further complications.
Thx to all involved people.
Regards
Thomas