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.
I'm not entirely sure of the interactions here. I have a view that, on its own, works fine. Adding an RSS feed to it also works fine, and the feed has the correct URL.
However, if the view is then placed into a Panel, the URL of the feed is not my/view/url/feed but my/view/url/. That breaks the RSS feed. I have not yet tried it with viewfield, but I suspect it may happen there as well (with the view "embedded" in another page).
I've confirmed that the panel has no override URL set for the view.
Comment | File | Size | Author |
---|---|---|---|
#3 | empty_arg.patch | 655 bytes | Crell |
Comments
Comment #1
Crell CreditAttribution: Crell commentedI have confirmed that the same problem exists when a view is presented through a viewfield. The RSS link points to the URL of the view rather than the URL of the view plus /feed.
Comment #2
merlinofchaos CreditAttribution: merlinofchaos commentedI tried this with panels and the frontpage feed, and that one works fine. This indicates there is something more about your view that may be involved here, but I'm not sure where to start.
Comment #3
Crell CreditAttribution: Crell commentedWell I tracked down the source of the problem, I believe.
In view_node.inc, there's this function:
Note the isset() check. The problem is that if you are using a view through a viewfield or panel, the argument field will (sometimes?) be set to empty string if you're not specifying anything. Empty string is not null, therefore the isset() returns true, and the code dutifully returns "" as the argument to append.
By changing the isset check to
if (!empty($view->args[$id])) {
, it gracefully handles both NULL and empty string, thus giving the correct default.Patch attached against 5.x-dev.
Comment #4
merlinofchaos CreditAttribution: merlinofchaos commentedThere is also a corresponding isset() in views_post_view_make_url() that needed fixing as well; so I went ahead and did both. Thanks for finding this!
Applied to both 5.x and 4.7.x
Comment #5
(not verified) CreditAttribution: commented