Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi, and thx for the great module.
On enclosure fields, using image fields, the code generated in the feed doesn't render html special chars. :
<enclosure> <enclosure url="[image-url]" length="[length]" type="image/jpeg" />
</enclosure>
Everything is working well in views_rss_core_field_formatter_view, until '#markup' => format_xml_elements(array($rss_element)),
, I guess.
Any idea ?
Thx !
Comment | File | Size | Author |
---|---|---|---|
#13 | rss_tout Content GAMMA Opéra national de Paris .png | 29.97 KB | gregory_kapustin |
Comments
Comment #1
Daniel Song CreditAttribution: Daniel Song commentedSame problem I'm seeing.
Please, fix this ASAP. This causes lots of problem of podcast.
Comment #2
math-hew CreditAttribution: math-hew commentedMake sure you're setting this on your image field.
Comment #3
davidneedhamThanks @math-hew - I was having this problem and indeed had that setting incorrect.
I'm going to set the status, but reopen if this doesn't work for others.
Comment #4
gregory_kapustin CreditAttribution: gregory_kapustin commentedFor my part @math-new, this setting was already right...
Still same problem though :(
Hint : I'm using a relationship to obtain the image (thx scald... :/)
Comment #5
gregory_kapustin CreditAttribution: gregory_kapustin commentedComment #6
maciej.zgadzaj CreditAttribution: maciej.zgadzaj commented@Gregory: please make sure you use the latest dev version of the module, and that you use
RSS <enclosure> element
as field formatter - it should work fine then (just re-tested on my local sandbox). If you still experience the problem, please provide screenshots of your feed configuration (including image field config) and link to the feed.Comment #7
gregory_kapustin CreditAttribution: gregory_kapustin commentedOk I got it : it's the using of Rewrite results and / or No results text that causes the problems.
As soon as you use one of them, all html marks are unrendered - you can reproduce it by simply rewriting a body field using [body].
Comment #8
maciej.zgadzaj CreditAttribution: maciej.zgadzaj commentedHold on, the original issue was about
<enclosure>
element, so why are we talking about Body field here?Comment #9
gregory_kapustin CreditAttribution: gregory_kapustin commentedEDIT : body field rewriting works fine.
What messed my view is using of "cascading fields" - I mean [field_1] (visible) -> rewrite if empty [field_2] (hidden) -> rewrite if empty [field_3] (hidden) .
In that case, problem is : what setting do I use for fields 2 and 3 ?
Comment #10
gregory_kapustin CreditAttribution: gregory_kapustin commentedComment #11
maciej.zgadzaj CreditAttribution: maciej.zgadzaj commentedWell, this issue was about
<enclosure>
element, so let's stick to it here.Now, rewriting doesn't really change anything, as long as you don't change the type of value the field provides. Which means, if you have a field named
field_images
, you can rewrite the output using[field_images]
and everything still works fine.Of course, if you decide to replace this with, say, hardcoded URL, obviously it won't work anymore, as it expects to have image object, not its URL only. The same applies to using No results text, but that's expected behavior.
Comment #12
maciej.zgadzaj CreditAttribution: maciej.zgadzaj commentedComment #13
gregory_kapustin CreditAttribution: gregory_kapustin commentedProblem is, all my image fields are in
enclosure
format, and as soon as I use this cascading rewriting, all is broken :See picture attached.
Comment #14
maciej.zgadzaj CreditAttribution: maciej.zgadzaj commentedOk, now I see what you are trying to do. And that's right, it is not going to work, because Field_1 returns already formatted
<enclosure>
element, while Field_2 expects image object instead. It's not a bug, this is how Views module works. And there is no way around it without custom coding I'm afraid. (Also, this is an edge case, and as such I'm not planning to account for it in the module.) You might want to implement custom enclosure preprocess function for this field, and put all the logic there (passing image object from Field_1 to Field_2 to Field_3 if needed.)Comment #15
gregory_kapustin CreditAttribution: gregory_kapustin commentedThx @maciej.zgadzaj, I guess we arrived to the point.
I'll try some custom coding and post it here fyi.
Comment #16
markie CreditAttribution: markie commentedFWIW: I ran into this issue and to correct it, I had to uncheck all the style settings (default classes et al) and make sure there was no re-write results checked. Once I did that, it became pretty again.
Comment #17
MediaFormat CreditAttribution: MediaFormat commentedI ended up using
hook_views_pre_render