2
votes

I've recently updated a TYPO3 instance from 7 to 8 (now 8.7.22, PHP 7.2) (it was before the release of 9.5, obviously) and I run into an issue with the previously working self set og: and twitter: meta tags.

The customer needs these for SEO optimization and twitter improved twitter sharing behaviour.

We built this:

page.meta {
    description.data = levelfield:-1, description, slide
    keywords.data = levelfield:-1, keywords, slide
    bitly-verification = 
    og:site_name =
    og:description.data = levelfield:-1, description, slide
    og:description.attribute = property
    og:type = website
    og:type.attribute = property
    og:locale.attribute = property
    og:site_name.attribute = property
    X-UA-Compatible = IE=edge
    twitter:card.data = levelfield:-1, tx_metadata_twitter_card, slide
    twitter:card.attribute = property
    twitter:site.data = levelfield:-1, tx_metadata_twitter_site, slide
    twitter:site.attribute = property
    twitter:creator.data = levelfield:-1, tx_metadata_twitter_creator, slide
    twitter:creator.attribute = property
    twitter:account_id.data = levelfield:-1, tx_metadata_twitter_account_id, slide
    twitter:account_id.attribute = property
    fb:admins.data = levelfield:-1, tx_metadata_facebook_admin, slide
    fb:admins.attribute = property
    viewport = width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no
    author >
}

And added the fields to $TYPO3_CONF_VARS['FE']['addRootlineFields'] (which according to the configuration module still works perfectly).

The issue is, that only the og:description, og:site_name as well as og:type meta information seem to work, but the twitter: and fb: ones don't work at all.

The data is available in the database.

I was wondering if someething could screw up my typoscript but the parsed typoscript displays completely in the Typoscript Object Browser.

I suspect that something is wrong in the parsing when evaluating the twitter: and fb: keys but I could not pinpoint where this evaluation is made in the code. The documentation does not give much either.

[EDIT]: I forgot to mention that the meta data is not rendered in the order it is in the typoscript but is somehow scrambled, so I also suspected an extension to screw this up.

[UPDATE]: In a local development environment with docker (same setup as the production webserver) the tags do work normally.

[UPDATE 2]: It appears that the culprit is somewhere in EXT:frontend/Classes/Page/PageGenerator.php:PageGenerator::generateMetaTagHtml when resolving the values from Typoscript using stdWrap. I'll continue digging there.

1

1 Answers

1
votes

So, it turns out, TYPO3 is really good in caching rootline information, but not in clearing the data...

Truncating all cf_* tables solved the issue. Appearently, even when clearing the whole cache in the install tool, this cache is not properly flushed.