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.
For example, I placed on [node:body] token, then if the value of body is null, the [node:body] will be directly shown on page title. I think instead of showing the token name, it should display nothing.
Comment | File | Size | Author |
---|---|---|---|
#8 | token_not_replaced-1290080-8.patch | 1.02 KB | mariancalinro |
#2 | clear_empty_tokens-1290080-2.patch | 599 bytes | ParisLiakos |
Comments
Comment #1
ParisLiakos CreditAttribution: ParisLiakos commentedSubscribe
Comment #2
ParisLiakos CreditAttribution: ParisLiakos commentedi solved this with way in the attached patch
Comment #3
petrovnn CreditAttribution: petrovnn commentedthank you rootatwc, yours patch works fine!
Please commit it in main branch, why it did not happen?
Why not close the issue?
Comment #4
ParisLiakos CreditAttribution: ParisLiakos commentedBecause it needed someone like you to confirm that works!
thanks. now its up to maintainers to commit it
Comment #5
FAAREIA CreditAttribution: FAAREIA commentedIt works fine =).
Many thanks for the patch
Comment #6
Mile23The tests in 7.x-2.x dev are much much better than the ones in 7.x-2.7, though I don't see one for behavior with a null token object.
This patch applies cleanly, though.
Comment #7
Liliplanet CreditAttribution: Liliplanet commentedThe patch works perfectly, thank you! please commit to latest version ..
Comment #8
mariancalinro CreditAttribution: mariancalinro commentedFrom my point of view, displaying nothing is not a good option, you generally want to display something in your page title.
So my approach is to check the page title if it still has tokens that have not been replaced, and if so, fallback to the default pattern.
This makes sure you always have a page title, and that you do not get a page title with a token in it.
Comment #9
csanders CreditAttribution: csanders commentedThe patch in #8 worked like a charm for me, thanks!
Comment #11
nicholasThompsonPatch in #8 applied to master in d4073217cb53681ce915f81f134e8c99904871f1.