OpenGraph plugin breaks

Phoca plugins - support for all Phoca plugins except Phoca Gallery plugins
limesurvey
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 01 Jun 2016, 12:15

OpenGraph plugin breaks

Post by limesurvey » 20 Apr 2020, 13:29

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

User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 42718
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: OpenGraph plugin breaks

Post by Jan » 20 Apr 2020, 13:45

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
If you find Phoca extensions useful, please support the project

jmartinr
Phoca Newbie
Phoca Newbie
Posts: 1
Joined: 22 Apr 2020, 12:18

Re: OpenGraph plugin breaks

Post by jmartinr » 22 Apr 2020, 12:23

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.

limesurvey
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 01 Jun 2016, 12:15

Re: OpenGraph plugin breaks

Post by limesurvey » 22 Apr 2020, 17:11

Thank you! That solution fixed it for me, too.

dph
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 22 Aug 2019, 14:34

Re: OpenGraph plugin breaks

Post by dph » 23 Apr 2020, 09:52

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.

User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 42718
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: OpenGraph plugin breaks

Post by Jan » 23 Apr 2020, 12:41

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
If you find Phoca extensions useful, please support the project

dph
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 22 Aug 2019, 14:34

Re: OpenGraph plugin breaks

Post by dph » 23 Apr 2020, 12:51

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.

User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 42718
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: OpenGraph plugin breaks

Post by Jan » 23 Apr 2020, 12:54

Hmmm, which PHP version do you run?
If you find Phoca extensions useful, please support the project

User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 42718
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: OpenGraph plugin breaks

Post by Jan » 23 Apr 2020, 13:02

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
If you find Phoca extensions useful, please support the project

dph
Phoca Newbie
Phoca Newbie
Posts: 6
Joined: 22 Aug 2019, 14:34

Re: OpenGraph plugin breaks

Post by dph » 23 Apr 2020, 14:17

ok downloaded that file, did the upgrade and now the error message is gone. I am on php 7.2.28 btw.
Thanks!

Post Reply