Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
plugins-topic
Version 6 - Featured Topics and Posts v2.0 Plugin error
Avatar
Chandler Bolt
Member
Free Members
sp_UserOfflineSmall Offline
Mar 19, 2019 - 3:33 pm

I've successfully updated to Version 6 and installed the new plugins, but keep getting an error when activating the "Featured Topics and Posts" plugin.

The error message reads,

" Fatal error: Can't use method return value in write context in /home/caroltic/public_html/beta/wp-content/sp-resources/forum-plugins/featured/library/sp-featured-components.php on line 15"

At the moment, Simple Press is the ONLY active plugin.

WP 5.1.1
Simple Press 6.0.6

Has anyone else encountered this?

Thanks,

Mark

Avatar
SP Community Support
SP Moderator
sp_UserOfflineSmall Offline
Mar 19, 2019 - 4:09 pm

Just for a sanity check I quickly installed the Featured Topics plugin on a relatively new install of WP 5.1.1 and Simple:Press.  I didn't run into that issue. So I took a look at line #15 referenced in the error message and didn't see anything obvious.  So its possible that there is something in the data returned from your database that isn't expected (not that the data is necessarily wrong, its just not expected).  But I don't have any way of knowing what that might be right now.

For another sanity check I activated it on a site with a ton of data (our own website and forum) with no issues there as well.

So my strong suspicion is there's something unexpected being returned from the DB.

Not sure if you have the skills for it, but if you're willing to dig into the code on your site a bit - maybe just before that line you can print out the value of SP()->meta->get_value('featured', 'topics')

to the wp errorlog file and check to see what it contains.

If that looks ok then you'll want to check the contents of the other variables on that line - $topic['topic_id'] and SP()->meta->get_value('featured', 'topics')

Hope this helps a bit.

Avatar
Chandler Bolt
Member
Free Members
sp_UserOfflineSmall Offline
Mar 20, 2019 - 10:52 am

Thanks for checking a couple of different scenarios on your end!

I do have the skills to dig into the code, so I'll look into how to print to wp errorlog. I'm familiar with using debuggers and console.logs in python and js, but less experienced with wp and php in general.

Thanks for the recommendation!

I'll report my findings here.

Avatar
SP Community Support
SP Moderator
sp_UserOfflineSmall Offline
Mar 20, 2019 - 11:01 am

Great. 

Printing out the data to the debug log should be as simple as something like this:

error_log( SP()->meta->get_value('featured', 'topics') );
 For arrays, you would use something like this:
error_log( print_r( your_array_variable, true ) ) ;

Hopefully you find something interesting that can help isolate the issue.

Thanks.

Avatar
Chandler Bolt
Member
Free Members
sp_UserOfflineSmall Offline
Mar 20, 2019 - 11:07 am

What I currently have in the error logs from yesterday......... I deleted consecutive duplicate messages for readability. From what I see, it looks like the function SP() isn't initially defined, but not sure why....

[19-Mar-2019 08:33:58 America/Los_Angeles] PHP Fatal error: Call to undefined function SP() in /home/caroltic/public_html/beta/wp-content/sp-resources/forum-themes/default-new/templates/spGroupView.php on line 29

[19-Mar-2019 15:49:45 UTC] WordPress database error Unknown column 'permalink_slug' in 'field list' for query SELECT forum_slug, permalink_slug FROM fwd0611_sfforums made by require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/simplepress/sp-control.php'), SP, spcSimplePress::instance, spcSimplePress->startup, spcCoreLoader->load, spcPermalinks->__construct, spcPermalinks->load, spcDB->select, spcDB->executeSelect

[19-Mar-2019 15:49:46 UTC] WordPress database error Unknown column 'permalink_slug' in 'field list' for query SELECT forum_slug, permalink_slug FROM fwd0611_sfforums made by require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/simplepress/sp-control.php'), SP, spcSimplePress::instance, spcSimplePress->startup, spcCoreLoader->load, spcPermalinks->__construct, spcPermalinks->load, spcDB->select, spcDB->executeSelect

[19-Mar-2019 15:49:56 UTC] WordPress database error Unknown column 'permalink_slug' in 'field list' for query SELECT forum_slug, permalink_slug FROM fwd0611_sfforums made by require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), include_once('/plugins/simplepress/sp-control.php'), SP, spcSimplePress::instance, spcSimplePress->startup, spcCoreLoader->load, spcPermalinks->__construct, spcPermalinks->load, spcDB->select, spcDB->executeSelect

[19-Mar-2019 11:48:42 America/Los_Angeles] PHP Fatal error: Can't use method return value in write context in /home/caroltic/public_html/beta/wp-content/sp-resources/forum-plugins/featured/library/sp-featured-components.php on line 15

Avatar
SP Community Support
SP Moderator
sp_UserOfflineSmall Offline
Mar 20, 2019 - 11:18 am

If SP() is really not defined you'd probably notice a lot of other errors - I suspect that is a misleading message.  What theme are you using?

You should probably still try to output the variables to the error log as discussed previously.  It SP really isn't defined you should get the same error there too.

Thanks.

Avatar
Chandler Bolt
Member
Free Members
sp_UserOfflineSmall Offline
Mar 20, 2019 - 11:33 am

So I did a SQL query to the database regarding this, 'SELECT forum_slug, permalink_slug FROM fwd0611_sfforums'

and there is no 'permalink_slug' column.

Do you have a 'permalink_slug' in the corresponding '_sfforums' table in your database?

Avatar
Chandler Bolt
Member
Free Members
sp_UserOfflineSmall Offline
Mar 20, 2019 - 11:34 am

I'm using the Default theme 2.0 for now until I get things working correctly. I figured it was easiest to start there.

Avatar
SP Community Support
SP Moderator
sp_UserOfflineSmall Offline
Mar 20, 2019 - 11:38 am

Yes, there should one.  It would have been added as part of the upgrade.  But maybe that failed? 

The field definition is as follows:

VARCHAR(1000)

Thanks.

Avatar
Chandler Bolt
Member
Free Members
sp_UserOfflineSmall Offline
Mar 20, 2019 - 11:50 am

Ok, my apologies, I looked at the backup database I had created before I upgraded. :-/

When viewing the correct database,  the field was created, so I'm not sure why the query would fail. I just re-saved permalinks, so I'll re-activate the plugin and see if that solves it.

Thanks for sticking with me!

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 649
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 618
Members: 17348
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10120
Posts: 79607