Error when displaying categories in admin screen
-
Hi,
Just as a pointer for those wanting to get this working – and for the writer to add to the next version :
the reason some people cannot see the categories in the admin screen is a slight code issue within gpx-viewer-admin.php file.
Currently, the recent version 1.0.7 – uses the following to get the categories :
// Get categories
//——————
$sql = “SELECT wp_terms.slug, wp_terms.name
FROM wp_term_taxonomy, wp_terms
WHERE wp_term_taxonomy.taxonomy = ‘category’
AND wp_terms.term_id = wp_term_taxonomy.term_id
AND wp_term_taxonomy.parent = 0”;Which is fine.. as long as you are using a database table name suffix of ‘wp_’ – when your installation does not, the statement returns zero rows as wp_terms etc doesnt exist.. its [your selected prefix]terms..
After changing the code to :
$sql = “SELECT t.slug, t.name
FROM ” . $wpdb->prefix . “term_taxonomy ta, ” . $wpdb->prefix . “terms t
WHERE ta.taxonomy = ‘category’
AND t.term_id = ta.term_id
AND ta.parent = 0”;The statement runs fine on all installations, and categories can be selected when uploading GPX files.
Thanks.
Keith.
The topic ‘Error when displaying categories in admin screen’ is closed to new replies.