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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ianthomas_uk’s picture

znerol’s picture

If you are touching that area, please also remove path. Quoting #2177461-11: Refactor page caching into a service:

The path and title keys on the cache object were introduced in order to allow the statistics module to operate for cached pages (#692044: A site with statistics module enabled is much slower in serving cached pages in D7 than in D6). Meanwhile the statistics module switched to Ajax and boot/exit-hooks were removed. Therefore it is save to also get rid of this metadata.

ianthomas_uk’s picture

Title: Remove use of drupal_set_title/drupal_get_title from page cache » Remove use of drupal_set_title/drupal_get_title/_system_path from page cache
Status: Active » Needs review
FileSize
1.29 KB

That sounds sensible. Are you confident nothing else is using path now that it's there?

znerol’s picture

Issue tags: +Quick fix

Are you confident nothing else is using path now that it's there?

I do not see anything in core relying on the presence neither of title nor of path.

Damien Tournoud’s picture

Status: Needs review » Reviewed & tested by the community

Those 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.

ianthomas_uk’s picture

dawehner’s picture

Wait: 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.

Damien Tournoud’s picture

@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.

znerol’s picture

In my opinion any page level cache architecture relying on metadata which is not present on the HTTP layer is simply broken.

Wim Leers’s picture

Title: Remove use of drupal_set_title/drupal_get_title/_system_path from page cache » Remove use of drupal_set_title()/drupal_get_title()/_system_path from page cache

Manually tested, RTBC++

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x. Thanks!

dawehner’s picture

@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.

Sure, so should we either add a todo or a follow up to ensure that the bit don't get lost completly?

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.