By Richard Sparks on Wednesday, 26 April 2017
Posted in Technical Issues
Replies 9
Likes 0
Views 1.3K
Votes 0
After updating EasyBlog from 5.0.44 to 5.1.5, the blog page on frontend returns an Error: 0 - Call to a member function set() on string. I'm using menu type EasyBlog » (Posts) Frontpage » (Posts) Frontpage, but changing it to other options doesn't make any difference.

I disabled some plugins and found when I disable Content - SEBLOD plugin the blog page works as expected. I can't keep that plugin disabled because I need SEBLOD for a custom app we're developing for this website. I tried moving the plugin to load at the end, but that made no difference.

Do you have a suggestion how I can get this working and keep SEBLOD enabled? This is on a staging site to test the update, so it's not live until I get this worked out.

Thanks,
Richard
Based on what i check, it seems like that plugin code just didn't add a proper checking whether that param really got the value or not.

First when I dump these following variable, it return me true but inside the variable is empty value.

// return true
var_dump(isset($article->params));exit;

// return empty value
var_dump($article->params);exit;


I already applied some fix into this file stagingsite/plugins/content/cck/cck.php


public function onContentBeforeDisplay( $context, &$article, &$params, $limitstart = 0 )
{
if ( JCck::getConfig_Param( 'hide_edit_icon', 0 ) ) {

if (isset($article->params)) {
$article->params->set( 'access-edit', false );
}
}

return '';
}


Replace with :


public function onContentBeforeDisplay( $context, &$article, &$params, $limitstart = 0 )
{
if ( JCck::getConfig_Param( 'hide_edit_icon', 0 ) ) {

if (isset($article->params) && $article->params) {
$article->params->set( 'access-edit', false );
}
}

return '';
}


Can you give it a check is it work fine now?

By the way, it would be best if you can pass this message to this 3rd party plugin developer regarding this.
·
Wednesday, 26 April 2017 13:46
·
0 Likes
·
0 Votes
·
0 Comments
·
The blog page is working now. I'm checking with my SEBLOD consultant to confirm this change won't have any negative consequences with SEBLOD functionality. I'll let you know what I learn from him.

Thank you,
Richard
·
Wednesday, 26 April 2017 22:14
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks Richard, ideally the plugin should also check if the params is empty because if it doesn't, then it is pretty prone in hitting errors.
·
Wednesday, 26 April 2017 22:16
·
0 Likes
·
0 Votes
·
0 Comments
·
I posted a notice on SEBLOD's support forum and their github tracker https://github.com/Octopoos/SEBLOD/issues/382
·
Thursday, 27 April 2017 05:37
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks Richard.
·
Thursday, 27 April 2017 13:15
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post