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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mrshowerman created an issue. See original summary.

mortim07’s picture

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

mortim07’s picture

With reference to the patch. The metatag.token service should be injected in through the constructor. I'll produce another patch with this change.

mortim07’s picture

Ah, so it appears it was being injected but never used. I've instead changed the patch to reference this service.

mrshowerman’s picture

Status: Active » Needs review

Nice, patch #4 brings back the node tokens. Thanks @mortim07!
Switching to Needs review so that others have a look.

DamienMcKenna’s picture

Version: 8.x-1.15 » 8.x-1.x-dev
Status: Needs review » Needs work
Issue tags: +Needs tests

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

mortim07’s picture

I'll write a functional JS test for it.

mortim07’s picture

mortim07’s picture

Status: Needs work » Needs review
mortim07’s picture

Status: Needs review » Needs work

The last submitted patch, 10: metatag-missing-token-types.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

mortim07’s picture

DamienMcKenna’s picture

Status: Needs work » Needs review
DamienMcKenna’s picture

Would you mind uploading a tests-only patch to confirm the problem? Thank you.

mortim07’s picture

Status: Needs review » Needs work

The last submitted patch, 15: metatag-missing-token-types-test-only.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

mortim07’s picture

Status: Needs work » Needs review
bwaindwain’s picture

patch #12 works good for me

FiNeX’s picture

Issue summary: View changes
DamienMcKenna’s picture

chefkiss.gif

Thank you mortim07! I'll try to get this, and a few other small fixes, out in a new release this week.

DamienMcKenna’s picture

Issue summary: View changes

@FiNeX: Please be careful to add your comment to the comment field and avoid erasing the existing issue summary contents.

DamienMcKenna’s picture

Status: Needs review » Fixed

Committed. Thank you.

FiNeX’s picture

@DamienMcKenna sorry, I've filled the wrong textarea :-)

greggles’s picture

Time for a new release to get this into the world?

CulacovPavel’s picture

This patch is missing in 1.15

DamienMcKenna’s picture

The patch wasn't committed before 1.15 was released, it'll be in the new 1.16.

Status: Fixed » Closed (fixed)

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

eiriksm’s picture

Issue tags: -Needs tests

Thanks 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 ✌️