Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
Should empty area plugins be executed in a feed display?
Maybe I'm missing something, but seems to me like an obvious "yes". After all, if you want a custom title or a custom HTTP status code when the view returns no results, it makes no sense for behavior like that to be restricted to HTML displays.
Here's some problems I see in the current code though:
DisplayPluginBase::render() punts "empty area" rendering to elementPreRender(), and Feed::render() overrides that to not even call elementPreRender() (which is probably correct for most of what elementPreRender() renders, just isn't correct with respect to #empty).
Feed does not override preRender(), so "empty area" handlers do get their preRender() method called, which is good for the Title handler (though the overridden title doesn't make its way into the feed's title due to a separate bug). However, HTTPStatusCode does its work in render(), not in preRender(). So, we either need to make Feed properly call empty area handlers' render() methods, or we need to decide and document that empty area handlers need to do their not-just-HTML work in different methods (such as preRender()).
RestExport sets $usesAreas to FALSE, so we're not even able to add empty area handlers to it. I think it makes sense for both Feed and RestExport to not make use of 'header' and 'footer' areas, but it doesn't make sense to set $usesAreas to FALSE if doing so also removes the ability to add empty area handlers. I kind of wonder if we should make "empty area" a separate plugin type from header and footer areas, but maybe that's out of scope for D8 at this point.
Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.
Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.
Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)
Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)
Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)
Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)
Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.
Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.
Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.
Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.
Thank you for creating this issue to improve Drupal.
We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.
Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.
Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.
Comments
Comment #1
effulgentsia commentedMaybe I'm missing something, but seems to me like an obvious "yes". After all, if you want a custom title or a custom HTTP status code when the view returns no results, it makes no sense for behavior like that to be restricted to HTML displays.
Here's some problems I see in the current code though:
Comment #15
smustgrave commentedThank you for creating this issue to improve Drupal.
We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.
Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.
Thanks!
Comment #16
smustgrave commentedWanted to bump 1 more time before closing.
Comment #18
smustgrave commentedSince there's been no follow up and not really an actionable item to do going to close out. If I'm wrong please re-open.