Topic RSS
4:35 pm
20 July, 2011
OfflineI just installed Sermon Browser. I am using version 0.45.4 of the plugin and Wordpress 3.2.1.
When I go to the "Preachers" section, there is just the default preacher listed. I click "add new" preacher, fill out the form and click save. It then says that the preacher has been added, but he is not listed on this page. I tried logging out and back in again, deactivating and activating the plugin, but still only the default preacher is listed on the "Preachers" page. However, I then I clicked "Add Sermon" and all the preachers are listed that I added before (many are duplicates). Is there any way to delete the ones I am not using, since they aren't listed on the "Preachers" page?
It seems like the only preachers that are listed on the "Preachers" page are the default one and any that have sermons assigned to them. Of course you can't delete preachers who have sermons assigned to them.
Thanks
3:32 pm
1 August, 2011
Offline4:50 pm
2 October, 2011
OfflineI am in the process of converting our church website to WordPress and found this plugin (much appreciated, thanks!)
I found the cause of this bug, in the 'admin.php' page, the MySQL queries for preachers, series, and services all have the same bug.
Each does something like this:
$preachers = $wpdb->get_results("SELECT {$wpdb->prefix}sb_preachers.*, COUNT({$wpdb->prefix}sb_sermons.id) AS sermon_count FROM {$wpdb->prefix}sb_preachers LEFT JOIN {$wpdb->prefix}sb_sermons ON {$wpdb->prefix}sb_preachers.id=preacher_id GROUP BY preacher_id ORDER BY name ASC");
Which in this case returns zero records if there are no sermons. To show preachers regardless of whether there are sermons (which I think is the intent), the "GROUP BY preacher_id" clause needs to be changed to "GROUP BY id". The reason is even though the initial query finds preachers without sermons, the group by clause removes them since there are no sermons. By changing it to "id" (the column on the sb_preachers table), it works as I expected.
The corrected query is:
$preachers = $wpdb->get_results("SELECT {$wpdb->prefix}sb_preachers.*, COUNT({$wpdb->prefix}sb_sermons.id) AS sermon_count FROM {$wpdb->prefix}sb_preachers LEFT JOIN {$wpdb->prefix}sb_sermons ON {$wpdb->prefix}sb_preachers.id=preacher_id GROUP BY id ORDER BY name ASC");
There is a similar problem with the GROUP BY for the series and services queries in admin.php
Doug
Most Users Ever Online: 40
Currently Online:
15 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)
Log In
Register
Home



