Forum

Please consider registering
guest

Log In Register

Register | Lost password?
Advanced Search:

— Forum Scope —



— Match —



— Forum Options —




Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 3 characters - maximum search word length is 84 characters

Topic RSS
Error checking bug in 0.41.1 (and SOLUTION!!!)
9 April, 2009
12:51 pm
cybersheep100
Enthusiast
Forum Posts: 13
Member Since:
6 April, 2009
Offline

Hi Mark,

Because I have a fairly custom website I found that the new version introduced a new bug causing the plugin to show an unsightly SQL error on some of my custom pages! (because on my custom pages $post->ID is null)

The solution was to edit frontend.php – adding some simple error checking in the function sb_add_headers()

i.e. change line (around) 443 from:

$pageid = $wpdb->get_var("SELECT ID FROM {$wpdb->posts} WHERE post_content LIKE '%[sermons%' AND (post_status = 'publish' OR post_status = 'private') AND ID={$post->ID} AND post_date < NOW();");

TO:

$pageid = NULL;
if ($post->ID != '') $pageid = $wpdb->get_var("SELECT ID FROM {$wpdb->posts} WHERE post_content LIKE '%[sermons%' AND (post_status = 'publish' OR post_status = 'private') AND ID={$post->ID} AND post_date < NOW();");

This change doesn't seem to affect any of the other operation and is similar to how you error-checked sb_display_url around line 40.

9 April, 2009
5:23 pm
Mark Barnes
Admin
Forum Posts: 425
Member Since:
14 December, 2005
Offline

Pages without an ID? Whatever next!? But it's good to have better error trapping so I'll add this to the next version. Thanks.

Forum Timezone: Europe/London

Most Users Ever Online: 40

Currently Online:
14 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

malpan: 2453

jogen: 2440

VanWatterson: 652

GeraldSebring: 364

LucasWoltman: 362

RandellFeenstra: 362

Member Stats:

Guest Posters: 7

Members: 2062

Moderators: 1

Admins: 1

Forum Stats:

Groups: 1

Forums: 2

Topics: 1071

Posts: 4042

Newest Members: richdorm, Aaron Velasquez, aaronv, dave5884, tomduckering, ccwebb

Moderators: Ben Miller (386)

Administrators: Mark Barnes (425)

Comments are closed.