kaffa / textpattern

Automatically exported from code.google.com/p/textpattern
0 stars 0 forks source link

<txp:article_custom /> in body or excerpt breaks feeds #27

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Reported by makss in http://forum.textpattern.com/viewtopic.php?id=29399:

Steps to reproduce:

1. Create a few articles
2. Create another article with
2.1 body:
<txp:article_custom wraptag="ul" break="li"
<txp:permlink><txp:title /></txp:permlink>
</txp:article_custom>
2.2 excerpt:
<txp:article_custom wraptag="ul" break="li"
<txp:permlink><txp:title /></txp:permlink>
</txp:article_custom>
3. ATOM and RSS feeds contain body and excerpt of the last created article
in all feed items

Reason: $thisarticle global gets overwritten while parsing the embedded
article_custom tags.

Original issue reported on code.google.com by r.wetzlmayr on 10 Aug 2009 at 11:35

Attachments:

GoogleCodeExporter commented 8 years ago
Corrected test markup:

<txp:article_custom wraptag="ul" break="li">
<txp:permlink><txp:title /></txp:permlink>
</txp:article_custom>

Original comment by r.wetzlmayr on 10 Aug 2009 at 11:37

GoogleCodeExporter commented 8 years ago
Attached patch breaks plugins' capability to modify body or excerpt in response 
to
'atom_entry' and 'rss_entry' event prior to feed rendering.

Original comment by r.wetzlmayr on 10 Aug 2009 at 12:19

GoogleCodeExporter commented 8 years ago
Hmmm. I can't see how plugin authors could modify the body or excerpt anyway. 
Maybe I
missed something but the plugin return string $cb is a separate entity that is 
a)
generated before the summary/content are populated, b) added to the feed output 
after
the summary/content have been rendered.

Since the potential called plugin isn't passed any reference to $a or even $rs, 
how
can it modify the feed's output? I can't even see a way of a plugin
overriding/replacing the $e['summary'] and $e['content'] array items. But 
perhaps I'm
not devious enough to see a way to modify the output!

As far as I can make out, the proposed patch is fine, with the possible 
addition of
removing the 'global $thisarticle' line at the top of the functions too.

Original comment by stefdawson on 16 Aug 2009 at 11:18

GoogleCodeExporter commented 8 years ago
A plugin would modify $thisarticle['excerpt'] or $thisarticle['body'] in an
'rss_entry' and 'atom_entry' event handler. 

See csb_feed_image for instance 
(http://forum.textpattern.com/viewtopic.php?id=23210). 

Original comment by r.wetzlmayr on 16 Aug 2009 at 5:37

GoogleCodeExporter commented 8 years ago
Oh right, ok. Didn't consider that. So I guess there has to be some kind of
article_push() /article_pop() mechanism instead to preserve the current article
contents during parsing? Hmmmm...

Original comment by stefdawson on 17 Aug 2009 at 6:56