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.
Problem/Motivation
Just upgraded from 1.14 to 1.15. Now the token browser doesn't provide Node tokens any more.
Steps to reproduce
- Install Metatag 1.15
- Go to the Metatag content configuration (/admin/config/search/metatag/node)
- Click on "Browse available tokens"
Expected behavior: The token browser contains node tokens, just like in 1.14
Actual behavior: No node tokens available.
Using node tokens directly still seems to work.
Comment | File | Size | Author |
---|---|---|---|
#15 | metatag-missing-token-types-test-only.patch | 1.35 KB | mortim07 |
#12 | metatag-missing-token-types.patch | 1.95 KB | mortim07 |
| |||
#8 | metatag-missing-token-types.patch | 1.65 KB | mortim07 |
#4 | metatag-missing-token-types.patch | 609 bytes | mortim07 |
#2 | metatag-missing-token-types.patch | 623 bytes | mortim07 |
|
Comments
Comment #2
mortim07 CreditAttribution: mortim07 at Department of Customer Service, NSW commentedIt appears there are a few missing lines from MetatagDefaultsForm. The variable $token_types isn't being used, unlike in version 8.x-1.14. I've made a restoration patch.
Comment #3
mortim07 CreditAttribution: mortim07 at Department of Customer Service, NSW commentedWith reference to the patch. The metatag.token service should be injected in through the constructor. I'll produce another patch with this change.
Comment #4
mortim07 CreditAttribution: mortim07 at Department of Customer Service, NSW commentedAh, so it appears it was being injected but never used. I've instead changed the patch to reference this service.
Comment #5
mrshowermanNice, patch #4 brings back the node tokens. Thanks @mortim07!
Switching to Needs review so that others have a look.
Comment #6
DamienMcKennaOh dear, thanks for spotting this and working out some patches.
Any thoughts on adding test coverage for this? I think checking the HTML of the page to confirm the output has the appropriate code to open the token browser would be good.
Comment #7
mortim07 CreditAttribution: mortim07 at Department of Customer Service, NSW commentedI'll write a functional JS test for it.
Comment #8
mortim07 CreditAttribution: mortim07 at Department of Customer Service, NSW commentedAdded functional JS test.
Comment #9
mortim07 CreditAttribution: mortim07 at Department of Customer Service, NSW commentedComment #10
mortim07 CreditAttribution: mortim07 at Department of Customer Service, NSW commentedWoops, forgot docs.
Comment #12
mortim07 CreditAttribution: mortim07 at Department of Customer Service, NSW commentedComment #13
DamienMcKennaComment #14
DamienMcKennaWould you mind uploading a tests-only patch to confirm the problem? Thank you.
Comment #15
mortim07 CreditAttribution: mortim07 at Department of Customer Service, NSW commentedSure thing!
Comment #17
mortim07 CreditAttribution: mortim07 at Department of Customer Service, NSW commentedComment #18
bwaindwain CreditAttribution: bwaindwain as a volunteer commentedpatch #12 works good for me
Comment #19
FiNeX CreditAttribution: FiNeX as a volunteer commentedComment #20
DamienMcKennachefkiss.gif
Thank you mortim07! I'll try to get this, and a few other small fixes, out in a new release this week.
Comment #21
DamienMcKenna@FiNeX: Please be careful to add your comment to the comment field and avoid erasing the existing issue summary contents.
Comment #23
DamienMcKennaCommitted. Thank you.
Comment #24
FiNeX CreditAttribution: FiNeX as a volunteer commented@DamienMcKenna sorry, I've filled the wrong textarea :-)
Comment #25
gregglesTime for a new release to get this into the world?
Comment #26
CulacovPavel CreditAttribution: CulacovPavel commentedThis patch is missing in 1.15
Comment #27
DamienMcKennaThe patch wasn't committed before 1.15 was released, it'll be in the new 1.16.
Comment #29
eiriksmThanks to everyone involved in fixing the issue, and even adding tests (removed the "needs tests" tag).
Just wanted to politely nudge that more people are interested in a new release including this fix ✌️