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.
We are very close to removing all uses of drupal_set_title() and drupal_get_title() from core.
One remaining use is drupal_page_set_cache(), but if drupal_get_title() always returns an empty string then there is no point storing that in the cache. This is a small patch, but I wanted the change to be explictly approved by the people who know this code well.
Comment | File | Size | Author |
---|---|---|---|
#3 | drupal-2209583-set_title-page-cache-3.patch | 1.29 KB | ianthomas_uk |
Comments
Comment #1
ianthomas_ukComment #2
znerol CreditAttribution: znerol commentedIf you are touching that area, please also remove
path
. Quoting #2177461-11: Refactor page caching into a service:Comment #3
ianthomas_ukThat sounds sensible. Are you confident nothing else is using path now that it's there?
Comment #4
znerol CreditAttribution: znerol commentedI do not see anything in core relying on the presence neither of
title
nor ofpath
.Comment #5
Damien Tournoud CreditAttribution: Damien Tournoud commentedThose most likely used to be useful, but it is clear that they are already broken in Drupal 8 (because they rely on static storage of those that we already broke), so +1 on removing them completely.
Comment #6
ianthomas_ukComment #7
dawehnerWait: don't we want to used #title and store it? Just because it is broken does not mean we should not try to do it right.
Comment #8
Damien Tournoud CreditAttribution: Damien Tournoud commented@dawehner: doing it right means refactoring the page cache completely, which is out of the scope of this issue. This is just removing code that cannot work anyway.
Comment #9
znerol CreditAttribution: znerol commentedIn my opinion any page level cache architecture relying on metadata which is not present on the HTTP layer is simply broken.
Comment #10
Wim LeersManually tested, RTBC++
Comment #11
webchickCommitted and pushed to 8.x. Thanks!
Comment #12
dawehnerSure, so should we either add a todo or a follow up to ensure that the bit don't get lost completly?