Page 1 of 2

OpenGraph plugin breaks

Posted: 20 Apr 2020, 13:29
by limesurvey
Hello,

We received the message today in the admin interface, there is a new OpneGraph version available.
We updated and after that certain pages were broken, primarily a page that only contained a Jumi plugin, no further content.

Error message was:

Call to a member function get()

Activating Joomly debug and error modes yielded no further details, probably because the plugin disables it.

Any idea what might be wrong?

Best regards
Carsten

Re: OpenGraph plugin breaks

Posted: 20 Apr 2020, 13:45
by Jan
Hi, plugin does not have any tool to somehow disable debug information.

Do you really have any more information about the problem? What is the screenshot. In Joomla! any error message should display debug information including the tree of called functions :idea:

What plugin do you use? Content or System? Which version?

Jan

Re: OpenGraph plugin breaks

Posted: 22 Apr 2020, 12:23
by jmartinr
I had the same problem using content plugin after the last update.

call to a member function get() on null

Changed line 447 of phocaopengraph.php to:

} else if ($active->params && $active->params->get('menu-meta_description') != '') { // menu link meta description

And now it's working again.

Re: OpenGraph plugin breaks

Posted: 22 Apr 2020, 17:11
by limesurvey
Thank you! That solution fixed it for me, too.

Re: OpenGraph plugin breaks

Posted: 23 Apr 2020, 09:52
by dph
jmartinr > Excellent! I had the same issue and spend a few hours on finding the cause. Thanks. I changed the code in line 447 and problem solved.

I have two sites which use this plugin and only one had the "call to a member function get() on null" error. Other site worked fine.

Jan > I can set up a testsite with this error if you want to do more investigation.

Re: OpenGraph plugin breaks

Posted: 23 Apr 2020, 12:41
by Jan
Hi, no, thank you, I don't need to test it, the solution is right.

I only changed it from:

Code: Select all

} else if ($active->params && $active->params->get('menu-meta_description') != '') { // menu link meta description
to

Code: Select all

} else if (!empty($active->params->get('menu-meta_description')) && $active->params->get('menu-meta_description') != '') { // menu link meta description
so it does not throw a warning in PHP7.4

Please, test to upgrade to version 3.1.12
https://github.com/PhocaCz/PhocaOpenGra ... 3.1.12.zip

and if it will be all OK, than I will officially release it.

Anyway thank you very much to all for testing and reporting.

Jan

Re: OpenGraph plugin breaks

Posted: 23 Apr 2020, 12:51
by dph
Just did the upgrade to 3.1.12. Works fine.

But in admin backend when you set the error reporting in global configuration to option "Maximum" I see this error on my pages:

Notice: Trying to get property 'params' of non-object in /www/plugins/content/phocaopengraph/phocaopengraph.php on line 447.

If you keep error reporting on option "System Default" everything looks ok on all pages.

Re: OpenGraph plugin breaks

Posted: 23 Apr 2020, 12:54
by Jan
Hmmm, which PHP version do you run?

Re: OpenGraph plugin breaks

Posted: 23 Apr 2020, 13:02
by Jan
Try to test it now, the version is the same:
https://github.com/PhocaCz/PhocaOpenGra ... 3.1.12.zip
(but I have added some isset there). Just upgrade on your site with the same version and let me know (be sure the zip file is the one download now).

Jan

Re: OpenGraph plugin breaks

Posted: 23 Apr 2020, 14:17
by dph
ok downloaded that file, did the upgrade and now the error message is gone. I am on php 7.2.28 btw.
Thanks!