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.
In d7, if you attach a feed to a block display, it shows a feed icon below the results. This doesn't work in d8.
Comment | File | Size | Author |
---|---|---|---|
#27 | 2359161-27.patch | 8.23 KB | olli |
#27 | 2359161-27-test_only.patch | 715 bytes | olli |
#24 | interdiff-2359161-24.txt | 1.01 KB | damiankloip |
#24 | 2359161-24.patch | 7.53 KB | damiankloip |
#6 | 2359161-6.patch | 3.61 KB | olli |
Comments
Comment #1
Wim LeersFix confirmed.
Comment #2
Wim LeersActually, this probably needs test coverage.
Comment #3
olli CreditAttribution: olli commentedHere's a test.
Comment #6
olli CreditAttribution: olli commentedComment #8
Wim LeersWonderful, thank you!
Comment #9
alexpottThe template implies that we only expect one feed icon to be here - not mulitple see views-view-html.html.twig. And this should be a single render array.
Comment #10
damiankloip CreditAttribution: damiankloip commentedThis works on pages atm because feeds are added to #attached. If you had multiple and they were using the property (as with blocks), it could just keep overwriting the same feed_icon property too. Not the best. So, I think we should rename this to
feedIcons
and assume everywhere this is an array of feed icon render arrays. We might also want to update the template too, as Alex suggested in #9; this looks like it should just be singular to actually nothing is stopping multiple icons getting rendered in there currently.Comment #11
Wim LeersGreat catch. I wonder if an alternative solution is to just change it from an array of feed icon render arrays to just a single feed icon render array? That'd make it very easy to fix this patch.
I guess the worry is then that if there are multiple Feed displays, that only one will be shown. But that's already the case in HEAD, plus it seems very much an edge case. Supporting multiple feed icons feels like a new feature.
Comment #12
olli CreditAttribution: olli commentedIt's a broken feature, it used to work in d7 the same way as attachment_before/after for example. There can be multiple attachments and modules can add more. I'd rather get #6 in to fix the regression and rename things in a separate issue.
Comment #13
olli CreditAttribution: olli commentedRenamed feed_icon to feed_icons/feedIcons.
Comment #15
olli CreditAttribution: olli commentedComment #16
Wim LeersWhy did you do the renaming you said you wouldn't do in #12?
Comment #17
olli CreditAttribution: olli commentedRe #16: Oh, sorry. I didn't mean I was against renaming.
Does #15 address #10?
Comment #18
dawehnerShould we expand the issue to also fix the icons in pages itself?
Comment #19
damiankloip CreditAttribution: damiankloip commentedHere is a reroll. I want to see if this does fix what we talked about in the other issue.
EDIT: Yep, certainly works ok. I must have been going crazy Wim!
Comment #20
dawehnerShould we instead try to add a new setter/getter in a follow up?
Comment #21
Wim Leers#19: hehe :) np!
Comment #22
alexpottI think we should change the views twig templates to use a
feed_icons
class instead offeed_icon
in views-view.html.twig and views-view--frontpage.html.twig.The only css that currently applies to it is in bartik's style.css - and this is not for this div at all - it's for each each themed by feed-icon.html.twig
Comment #23
catchI think this is the right title now.
Comment #24
damiankloip CreditAttribution: damiankloip commentedVery fair point. Changed.
Comment #25
olli CreditAttribution: olli commented#24 fixed #22.
Comment #26
catchDoes this need tests for the page display as well?
Comment #27
olli CreditAttribution: olli commentedHere's a test.
Comment #29
dawehnerI think it is good in the current way. Theoretically introducing setters/getters could be done, but the pure benefit from that
is not much. We already use the public property on the object, so not a big deal to document it and rename it.
Comment #30
alexpottThis issue addresses a critical bug and is allowed per https://www.drupal.org/core/beta-changes. Committed 15ddad3 and pushed to 8.0.x. Thanks!