This forum is now read-only. Support is provided at https://wordpress.org/support/plugin/sermon-browser/
4:35 pm
20 July, 2011
I 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
4:50 pm
2 October, 2011
I 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
9:41 pm
1 December, 2011
4:49 am
21 March, 2013
I also fixed the same bug with the series using this code
$series = $wpdb->get_results("SELECT {$wpdb->prefix}sb_series.*, COUNT({$wpdb->prefix}sb_sermons.id) AS sermon_count FROM {$wpdb->prefix}sb_series LEFT JOIN {$wpdb->prefix}sb_sermons ON series_id = {$wpdb->prefix}sb_series.id GROUP BY id ORDER BY name ASC");
instead of this code
$series = $wpdb->get_results("SELECT {$wpdb->prefix}sb_series.*, COUNT({$wpdb->prefix}sb_sermons.id) AS sermon_count FROM {$wpdb->prefix}sb_series LEFT JOIN {$wpdb->prefix}sb_sermons ON series_id = {$wpdb->prefix}sb_series.id GROUP BY series_id ORDER BY name ASC");
in admin.php.
3:25 pm
Moderators
18 June, 2009
Thanks for the bug fixes, and thanks for finding this old post. I've added it to the new FAQ:
Ben Miller, Pathways Church, Appleton, Wisconsin, USA
Read the new FAQ, last updated 11/21/2013
Announcing version 0.45.12
1 Guest(s)