I was on Drupal 8.5.x and Twitter cards and Open Graph on Facebook were displaying correctly.

After updating to Drupal 8.6.1, the images don't display anymore. The others data (title, description, url...) are OK, it's juste an images problem.

So I've checked the tokens used by the Metatag module and they are the same I used in Drupal 8.5.x without any problem.

The token I use for images is : [node:field_image_article:entity:field_image] Indeed, in my content type, I use a field named "Image article" that contain several fields (title, author, licence...) including an "Image" field where I upload the image.

When I look at the source code of my webpages, I have this :

<meta name="twitter:image" content="https://example.com" />
<meta property="og:image" content="https://example.com" />

instead of the complete URLs of the images...

Does anyone know how to solve this ? Thx.

  • You should post this over in Metatag's issue queue: drupal.org/project/issues/metatag – leymannx Sep 21 '18 at 9:10
  • Thing is, debugging needs to be done by you. And then come back if you know what happened and all your efforts you tried to fix it were fruitless. Then please tell us what you've tried so far. Asking if anyone else coincidentally might have fixed the issue already and would then care to share their findings isn't the kind of question that fits this Q&A format here. – leymannx Sep 21 '18 at 10:23
  • 1
    Thanks to you I find a similar issue on Metatag's issue queue. It's just that my research engine does not lead me on this page... Thx for your help – Xoclaf Sep 21 '18 at 10:42
  • I'm voting to close this question as off-topic because it’s a bug report for a contributed module and needs to be handled in the issue queue on Drupal.org – Clive Sep 21 '18 at 10:57

This issue is documented here : https://www.drupal.org/project/metatag/issues/2994433

For the moment (21/09/18), there are two solutions :

  • add :entity:url at the end of the token
  • downgrade to Metatag 1.5 instead 1.6

Using first solution, change [node:field_image_article:entity:field_image] for [node:field_image_article:entity:field_image:entity:url] did the job for me.

Not the answer you're looking for? Browse other questions tagged or ask your own question.