We have a client that is having issue with an RSS feed[1] in WG. One feed is working while another is generating this error in the log. This may reveal an edge-case with RSS feeds.
---------------------
Couldn't call method view on asset for url: morningmonologuerss Root cause: HTML::Template->output() : fatal error in loop output : HTML::Template::param() : attempt to set parameter 'media:content' with an array ref - parameter is not a TMPL_LOOP! at /data/wre/prereqs/perl/lib/site_perl/5.8.8/HTML/Template.pm line 3068
[1] http://morningmonologue.wordpress.com/feed/
Diona
---- Knowmad Technologies http://www.knowmad.com
Graham has suggested that this is an issue with the way that the feed is passed to the template engine. I'm writing a test for SydicatedContent.pm hoping to discover more detail about the issue. I'll update this bug report if I discover more information.
The issue here is that one entry in the feed has a single media:content entry, and another has multiple. These are being passed into the template engine as a scalar, and as an array. The template engine doesn't like these conflicting types, and dies. The solution is likely going to be forcing every entry we aren't explicitly handling to be an array.
I had hoped to discover this was a version issue and that an upgrade would fix the issue but it sounds as if this is a current bug. Do you think this will be fixed in the next version release? Or could the timeframe for this be extended?
I've attached the beginning of a test. It doesn't yet expose the issue and has the feed in question included in the test. I hope that this test can be expanded and be helpful for debugging.
Thanks,
Any response on this?
here is what i believe is a test that exposes the bug.
--
knowmad.com
Dionak: If you want a workaround, try using the Template Toolkit templating language instead. I don't think it has the same limitations as HTML::Template and H::T::Expr (mainly the insane "type" checking).
Let us know how that turns out. I'll look into the problem to see if I can find a sane solution.
So it seems <media:content> is an optional field, and optional fields get automatically added to the template parameters, and then if those optional fields do not match what H::T wants, it explodes.
The most correct solution would be to remove everything that we did not explicitly want, with the side-effect that it may limit the usefulness of this asset.
To get around this, we could add a way to include other response tags in the template, so that users would have the ultimate control over it (and any problems that arise would be out of our hands).
I've removed all but the necessary fields from the RSS feed. If you want to be able to control which fields get added, while releasing all responsibility from WebGUI for the content of those fields, please submit an RFE for it.
Closing as resolved.