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.
Report by @sun on #2209595: Remove drupal_set_title(), drupal_get_title() and associated tests.
Drupal\Core\Utility\Title
just contains constants; that should not exist — let's create a follow-up issue to eliminate that utility class and move those constants to a proper home. It would actually be best if those constants would not exist in the first place; now that we have class methods, we can simply have separate getRawTitle()
, getPlainTitle()
, getXssSafeTitle()
methods.
Comment | File | Size | Author |
---|---|---|---|
#5 | 2214525-5.patch | 2 KB | Palashvijay4O |
Comments
Comment #1
dawehnerGiven that the HtmlFragment is a value object this seems doable.
Comment #2
catchThe only use of this is in Views - #2067931: Use the new title method on views pages.
Comment #3
catchComment #4
BerdirThat other issue has been closed.
There is still a usage of this left in \Drupal\views\Plugin\views\area\Title, but that second argument that it is passing along does not even exist anymore, so it is broken anyway.
Making active and tagging Novice, remove the file and usage of it in that other class (there is also a left-over use somewhere else).
We then need to verify that title area works as expected and fix it if necessary.
Comment #5
Palashvijay4O CreditAttribution: Palashvijay4O commentedA patch .
Comment #6
BerdirPatch looks good to me. As mentioned above, the title area plugin might be broken, but this doesn't make it any worse than it already is. But lets confirm this with @dawehner.
Comment #7
dawehnerHa, ViewExecutable::setTitle does not deal anymore with the variable itself.
Later in Page::execute() we use
Xss::filterAdmin()
so the title plugin does not seems to be broken.Comment #8
dawehner.
Comment #9
chx CreditAttribution: chx commented> Ha, ViewExecutable::setTitle does not deal anymore with the variable itself.
Meaning, this is correct since
ViewExecutable::setTitle
ispublic function setTitle($title) {
doesn't need the second argument any more.Comment #10
webchickCan't quite parse how this is major, but it's removing dead code so it's a legit bug fix.
Committed and pushed to 8.0.x. Thanks!