backdrop-contrib / metatag

Add structured metadata, aka "meta tags", for various pages on your site.
GNU General Public License v2.0
3 stars 15 forks source link

Metatag Views does not validate view tokens either in config form or generating the view page #98

Closed yorkshire-pudding closed 1 year ago

yorkshire-pudding commented 1 year ago

Steps to reproduce

  1. Install Metatag
  2. Enable Metatag and Metatag Views
  3. Create a page view of some content and give it a Title, Description and URL
  4. View the page and inspect the source header zone (A)
  5. Go to admin/config/metadata/metatags/config
  6. Click on Override for the Views item
  7. Attempt to save the config (B)
  8. Click on Browse Available Tokens and look for View section (C)

Expected results (A) Title Description and Canonical URL tags are present in header (B) Config saves and returns to metatag overview (C) View section is present in token browser

Actual results (A) Title and URL are generated as these are in global but description is not (B) Config gives validation errors and won't save:

image

Error messages ``` The Page title is using the following invalid tokens: [view:title]. The Description is using the following invalid tokens: [view:description]. The Canonical URL is using the following invalid tokens: [view:url]. ```

(C) View section is not present in token browser image

quicksketch commented 1 year ago

Looks like the view token group isn't getting added to the token contexts. I'm working on fixing this issue.

quicksketch commented 1 year ago

A lot of the Views integration seems to be broken. Not only do the tokens not work, but the metatags section of the view configuration doesn't seem to show up. I've fixed both issues and gotten the Metatag: Views tests passing in this PR: https://github.com/backdrop-contrib/metatag/pull/104

quicksketch commented 1 year ago

I went ahead and merged https://github.com/backdrop-contrib/metatag/pull/104 so we can get out a new release in which Metatag: Views actually works.