Hi,

I get the following warning in my Recent Log Messages, when viewing Content:

Theme key "metatag_twitter_cards" not found.

Regards,

Tobi

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DamienMcKenna’s picture

Status: Active » Postponed (maintainer needs more info)

Did you enable the Twitter Cards submodule? Did you then disable it again? Either way, this can only happen if the theme registry cache is out of date with the modules that are currently enabled so it should work.

edulterado’s picture

Twitter Cards didn´t work for me and I realized that the module is registering a theme hook with the name 'metatag_twittercard' in the line 20 of metatag_twitter_cards.module file. And It happens that the theme implementation provided in the same file doesn´t match the theme hook declared before: in fact it´s theme_metatag_twitter_cards, while it should be theme_metatag_twittercard.

Renaming the theme function accordingly made Twitter Cards work in my case and the theme warning in the Recent Log messages disappears.

edulterado’s picture

I made a patch for resolving the mismatch between the theme hook and the name of its theme function. I changed the name of the theme hook to 'metatag_twitter_cards' instead of 'metatag_twittercard' (I guess the former could be more appropriate given the name of the module).

Twitter Cards are working for me after applying the patch, but the theme warning message that appears now in the log is "Theme key "metatag_twittercard" not found." Disabling/uninstalling (and then enabling the module) doesn´t prevent the message from appearing.

edulterado’s picture

Status: Fixed » Postponed (maintainer needs more info)
FileSize
1.71 KB

The previous patch was incomplete, sorry.
More mismatched theme calls were done in metatag_twitter_cards.metatag.inc file.

With this patch, the theme warning messages from Log are completely removed.

DamienMcKenna’s picture

Status: Postponed (maintainer needs more info) » Needs review

Oh for #adsfkahdfkjshdfkhsd. Thank you, edulterado.

DamienMcKenna’s picture

Status: Needs review » Fixed

Committed.

Status: Postponed (maintainer needs more info) » Closed (fixed)

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

greggles’s picture

I'm not sure why this is minor. Twitter Cards seems to be completely non functional in 7.x-1.0-beta4 though it is fixed in 7.x-1.x-dev (I assume because of this fix).

More importantly: perhaps it's time for a new stable release so this can get out to folks?

DamienMcKenna’s picture

@greggles: I'm trying to fix #1845326 and #1844638 before the next release, I'm hoping to tie them up tonight.

moxojo’s picture

Note to anyone else looking for a solution to why twitter card tags aren't showing up. The patch in #4 works to get the meta tags to display but if you are patching against 7.x-1.0-beta4 twitter cards will still fail because several of the properties are output as links rather than meta tags. The problem is in the metatag_twitter_cards_metatag_info() function in the .inc file, several of the classes are wrong. The dev branch does use the correct class in the .inc file

For clarity, patching against 7.x-1.0-beta4 gives you this:

<link property="twitter:url" content="....">
<link property="twitter:image" content="....">
<link property="twitter:player" content="....">

Whereas the correct syntax is:

<meta property="twitter:url" content="....">
<meta property="twitter:image" content="....">
<meta property="twitter:player" content="....">

Again the dev release fixes this but if you are still on 7.x-1.0-beta4 you will have to use the patch from #4 and edit the .inc to use the correct class (I had to edit it in four spots to use DrupalTextMetaTag instead of DrupalLinkMetaTag).

DamienMcKenna’s picture

@moxojo: Please try the latest -dev release, that contains the fix; beta5 is due as soon as I fix one remaining bug.

moxojo’s picture

@DamienMcKenna: Thanks, yes the dev version works to fix this issue. We just weren't ready to update to the dev version which is why I applied the patch and made the changes. Thanks for your work on this!

DamienMcKenna’s picture

@moxojo: Ok, thanks.

defan.drupal’s picture

----