A A A
Forum Scope


Match



Forum Options



Min search length: 3 characters / Max search length: 84 characters
Forum Login
Lost password?
plugins-topic
Version 6 - Featured Topics and Posts v2.0 Plugin error
RSS
Avatar
Chandler Bolt

29 Posts
(Offline)
1
Mar 19, 2019 - 3:33 pm
Print

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

280 Posts
(Offline)
2
Mar 19, 2019 - 4:09 pm
Print

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.

Building out your membership site can be a lot of work. Easy Membership Sites has pre-configured all the Simple:Press plugins and tools you need to build a complete membership site in a fraction of the usual time. Check them out: Easy Membership Sites

Avatar
Chandler Bolt

29 Posts
(Offline)
3
Mar 20, 2019 - 10:52 am
Print

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

280 Posts
(Offline)
4
Mar 20, 2019 - 11:01 am
Print

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.

The following users say thank you to SP Community Support for this useful post:

Chandler Bolt

Building out your membership site can be a lot of work. Easy Membership Sites has pre-configured all the Simple:Press plugins and tools you need to build a complete membership site in a fraction of the usual time. Check them out: Easy Membership Sites

Avatar
Chandler Bolt

29 Posts
(Offline)
5
Mar 20, 2019 - 11:07 am
Print

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

280 Posts
(Offline)
6
Mar 20, 2019 - 11:18 am
Print

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.

Building out your membership site can be a lot of work. Easy Membership Sites has pre-configured all the Simple:Press plugins and tools you need to build a complete membership site in a fraction of the usual time. Check them out: Easy Membership Sites

Avatar
Chandler Bolt

29 Posts
(Offline)
7
Mar 20, 2019 - 11:33 am
Print

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

29 Posts
(Offline)
8
Mar 20, 2019 - 11:34 am
Print

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

280 Posts
(Offline)
9
Mar 20, 2019 - 11:38 am
Print

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.

Building out your membership site can be a lot of work. Easy Membership Sites has pre-configured all the Simple:Press plugins and tools you need to build a complete membership site in a fraction of the usual time. Check them out: Easy Membership Sites

Avatar
Chandler Bolt

29 Posts
(Offline)
10
Mar 20, 2019 - 11:50 am
Print

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: America/New_York
All RSS Show Stats
Administrators: Blues Dancer, Simple Press, SP Community Support
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 629
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Newest Members:
Andy Cenoz
Kundan Dheevar
Wally Harvey
n1 n2
James Schwinn
Jaroslaw Balczewski
Lu Hunter
Jocelyne McGeever
Matthew Wolze
Forum Stats:
Groups: 7
Forums: 17
Topics: 10053
Posts: 79333

 

Member Stats:
Guest Posters: 606
Members: 16890
Moderators: 0
Admins: 3

Most Users Ever Online
499
Currently Online
Guest(s)
9
Currently Browsing this Page

1 Guest(s)