Topic-icon OpenGraph Tags

Support Specialist
9 years 5 months ago #48404 by mel
Replied by mel on topic OpenGraph Tags
Can you try disabling the 'Open Graph - Content' plugin and enabling 'Open Graph - K2'? Looking through your source again on one of your articles it looks like your using that instead of Joomla articles. I'm sorry - I should have caught that sooner.
The topic has been locked.
Active Subscriptions:

None
9 years 5 months ago #48407 by fb_1127481405
Replied by fb_1127481405 on topic OpenGraph Tags
I don't use K2 and I don't have the K2 content plugin. I have enabled the Opengraph Custom Object plugin but that made no difference.

Everything is the same as it was a few weeks ago except for installing the jch-optimizer and responsivizer for mobile sites.

I have three sites all with the same problem.

The og:description tag has stopped picking up the text from the content and is now getting it from the site metatag. The URL and image og tages are working fine.
The topic has been locked.
Support Specialist
9 years 5 months ago #48408 by mel
Replied by mel on topic OpenGraph Tags
Could you PM me backend credentials to you site so I can investigate further today?
The topic has been locked.
Support Specialist
9 years 5 months ago #48410 by mel
Replied by mel on topic OpenGraph Tags
Bill,

Whew that was not a fun one, but I think I have a fix in place on your website. Have you upgraded the version of PHP on your site recently?

I have been testing on this page heartsracing.com.au/hearts-horses/three-year-olds/tiger.html and can see the description set properly now, but can you test more thoroughly?

I have re-enabled the jch-optimizer and responsivizer plugins.

Also, the reason I thought you had K2 is that there are some CSS style blocks on your page that seem specific to K2. On the page I was testing, search the source for catItem, item and k2 and you'll see what I mean.

Let me know if your problem is resolved now.

Thanks
-Melissa
The topic has been locked.
Active Subscriptions:

None
9 years 5 months ago #48413 by fb_1127481405
Replied by fb_1127481405 on topic OpenGraph Tags
Thanks for fixing!

Yes I did upgrade php recently. When I turned on error messages I noticed that there were a number of warnings coming from JFBC scripts but nothing that looked fatal.

What did you do to solve the problem? Is it specific to my site because I have two other sites with the same problem that I need to fix?

Will it stay fixed in any future update of JFBC?
The topic has been locked.
Support Specialist
9 years 5 months ago #48415 by mel
Replied by mel on topic OpenGraph Tags
I've already checked in the code change to our repository/issue tracker, so it will be in the next releases going forward. I would recommend doing it on your other sites, especially if they're running the newer PHP version too.

It's a small nuance of one of the PHP methods we're using. In /libraries/sourcecoast/openGraphPlugin.php, around lines 345-348, there is code to grab the text of an article, split by whitespace and then get the appropriate number of words to build the og:description.
if (function_exists('mb_split'))
   $parts = mb_split('\s+', $articleText);
else
   $parts = preg_split('\s+', $articleText);

was replaced with
if (function_exists('mb_split'))
   $parts = mb_split('/\s+/', $articleText);
else
   $parts = preg_split('/\s+/', $articleText);

The first code block was working prior to your upgrade, but the second block is better. I think earlier versions of PHP were more lenient, so when you upgraded the first block no longer works.

-Melissa
The topic has been locked.
Active Subscriptions:

None
9 years 5 months ago #48416 by fb_1127481405
Replied by fb_1127481405 on topic OpenGraph Tags
Hmmm. Pattern matching without a pattern. Surprised it worked for so long :-)

Thanks for that. I'll update the other sites.
The topic has been locked.
Support Specialist
9 years 5 months ago #48417 by mel
Replied by mel on topic OpenGraph Tags
Yes it was an obvious fix once I saw it but I was surprised that it worked that long too :)
The topic has been locked.