
Problem/Motivation
Over in #2467759: Refactor drupal_process_attached() so it doesn't depend on drupal_add_http_header() we're trying to refactor away some @deprecated code, specifically _drupal_add_http_header()
.
Views is the only system within Drupal core which currently uses the legacy system for setting headers.
The headers being set, however, are not actually headers but the response code for the HTTP request.
This means that any view which generates an HTTP response code needs to somehow set this code.
Views must also cache this result somehow.
An objection raised in #2467759: Refactor drupal_process_attached() so it doesn't depend on drupal_add_http_header() is that any solution must cache these responses for both anonymous and logged-in users.
Here in this issue, we must explore whether this is actually the behavior expected of views, and whether that behavior must extend to HTTP response codes.
The first patch offered is a test which shows that views does not actually cache responses in this way.
Proposed resolution
Determine the desired behavior.
Write tests to demonstrate the desired behavior.
Make the tests pass by implementing the desired behavior.
Remaining tasks
Run the test to see if this is still a problem in a currently supported version of Drupal
Decide if it should be deprecated and removed.
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#1 | 2529500_1.patch | 8.68 KB | mile23 |
Comments
Comment #1
mile23This patch is the same test as https://www.drupal.org/node/2467759#comment-9905389
It adds views which are cached, and then attempts to view them using a logged-in user.
It will fail because views does not support this kind of caching.
Comment #3
tim.plunkettComment #4
dawehnerInteresting, maybe we also miss out entries from #attached as part of the caching.
Comment #18
quietone CreditAttribution: quietone at PreviousNext commentedThis was discussed in Slack at the bugsmash group triage meeting yesterday.
The following points were raised.
I am leaving the status at Needs Work for someone to run the tests and see if this is still a problem.