Code: Select all
[06-Jun-2019 17:47:47 UTC] PHP Warning: json_decode() expects parameter 1 to be string, object given in /home/nydi/public_html/plugins/content/phocaopengraph/phocaopengraph.php on line 97
As I understand the interface, plugins are supposed to check if the passed item is an article and only if so treat it as string.
For the moment I have hacked in the following patch:
Code: Select all
--- plugins/content/phocaopengraph/phocaopengraph.php.orig 2019-06-06 13:54:44.873000000 -0400
+++ plugins/content/phocaopengraph/phocaopengraph.php 2019-06-08 11:49:13.195000000 -0400
@@ -94,7 +94,8 @@
plgContentPhocaOpenGraphHelper::renderTag('og:type', $this->params->get('type'.$suffix, 'article'), $type);
// Image
- $pictures = json_decode($row->images);
+ // JMD: Need to check if this is a string before decoding json!
+ $pictures = (is_string($row->images) ? json_decode($row->images) : $row->images);
if ($this->params->get('image'.$suffix, '') != '') {
plgContentPhocaOpenGraphHelper::renderTag('og:image', JURI::base(false).$this->params->get('image'.$suffix, ''), $type);
Josh