Subtask of #1830588: [META] remove drupal_set_title() and drupal_get_title()
Problem/Motivation
Using procedural drupal_set_title() inside controller class is not encouraged.
Proposed resolution
Replace drupal_set_title() with #title in page return array.
Remaining tasks
Issue patch
User interface changes
Refer parent issue at #1830588: [META] remove drupal_set_title() and drupal_get_title()
API changes
Refer parent issue at #1830588: [META] remove drupal_set_title() and drupal_get_title()
Related Issues
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 3-4-interdiff.txt | 647 bytes | alexpott |
| #4 | remove_drupal_set_title_in_image_module-2102459-4.patch | 2.22 KB | alexpott |
| #3 | 1-3-interdiff.txt | 828 bytes | alexpott |
| #3 | remove_drupal_set_title_in_image_module-2102459-3.patch | 1.85 KB | alexpott |
| #1 | remove_drupal_set_title_in_image_module-2102459-1.patch | 918 bytes | internetdevels |
Comments
Comment #1
internetdevels commentedComment #2
claudiu.cristeaLooks good and I test it manually. Thank you!
Comment #3
alexpottLets add a test as we don't test this title anywhere
Comment #4
alexpottActually that'd add the possibility of random fails due to the label contain < or > so let's use random name here instead.
Comment #5
claudiu.cristeaString::format()?Comment #6
dawehnerTheoretically it would be enough to use a _title_callback as you can pull somehow the upcasted entity from there.
Comment #7
alexpottOut of scope (I think) I was was just resolving the confusion between id and label that the original message had - which I believe was in scope as it caused me to write an incorrect title assertion the first time around.
Comment #8
alexpottMy comment in #7 about out-of-scope refers to #5 not @dawehner's comment.
Comment #9
claudiu.cristeaSorry, I think I'm missing something, or... Why not intentionally testing with "<" or ">" or even unsafe names? The new "set title" (in fact
$this->t()) should sanitize the value, no? Andformat_string()does the same. So we should end every time with a true assertion.Comment #10
vijaycs85+1 to RTBC.
Reg #9:
@claudiu.cristea, we are just trying to remove the drupal_set_title() and making sure the test cases around drupal_set_title is updated to pass the same way it used to.
If you think, we are missing tests to check #title with unsafe value, we may need to raise it as separate issue and work on it (make sure we don't have coverage on main drupal_set_title() removal issue - here is change notice #2067859: drupal_set_title() and drupal_get_title() were removed)
Comment #11
claudiu.cristeaI'm OK with the initial patch, that's why I'd RTBC it. #9 was a proposal for a better test.
So, yes, RTBC again :)
Comment #12
xano#4: remove_drupal_set_title_in_image_module-2102459-4.patch queued for re-testing.
Comment #13
dries commentedCommitted to 8.x.
How do I mark this 'fixed'? It looks like the 7.x upgrade degraded the contributor experience on drupal.org. :-/
Comment #14
dries commentedComment #15
eliza411 commented#2128721: No follow button is a recent regression, fwiw, but there is much contributor feedback about the experience that is being gathered with the D.o UX tag.
Edit: both the Follow and the "Update this issue" link have gone missing.