WordPress.org

Ready to get started?Download WordPress

Forums

Category Icons
[resolved] Error with WordPress v3.5 (14 posts)

  1. mrdumont
    Member
    Posted 1 year ago #

    method prepare() in class wpdb (i.e. wpdb->prepare($query,$args)) misuse. The method now requires $args (even if null), the second argument. This plugin does not do that in at least two places. Easy to fix, just add a null string for the second argument.

    http://wordpress.org/extend/plugins/category-icons/

  2. joynic
    Member
    Posted 1 year ago #

    this is my solution...it works perfect...

    in category_icons.php

    on line 1047

    from:

    $wpdb->query($wpdb->prepare("CREATE TABLE IF NOT EXISTS $wpdb->ig_caticons (cat_id INT NOT NULL ,priority INT NOT NULL ,icon TEXT NOT NULL ,small_icon TEXT NOT NULL , PRIMARY KEY ( cat_id ))"));

    to:

    $wpdb->query($wpdb->prepare("CREATE TABLE IF NOT EXISTS %s (cat_id INT NOT NULL ,priority INT NOT NULL ,icon TEXT NOT NULL ,small_icon TEXT NOT NULL , PRIMARY KEY ( cat_id ))", $wpdb->ig_caticons));

    on line 1338

    from:

    $datas = $wpdb->get_results($wpdb->prepare("SELECT cat_id, priority, icon, small_icon FROM $wpdb->ig_caticons"));

    to:

    $datas = $wpdb->get_results($wpdb->prepare("SELECT cat_id, priority, icon, small_icon FROM $wpdb->ig_caticons", $result));

    on line 1360

    from:

    if ($row = $wpdb->get_row($wpdb->prepare("SELECT cat_id, priority, icon, small_icon FROM $wpdb->ig_caticons WHERE cat_id IN($instr) ORDER BY priority DESC LIMIT 1")))

    to:

    if ($row = $wpdb->get_row($wpdb->prepare("SELECT cat_id, priority, icon, small_icon FROM $wpdb->ig_caticons WHERE cat_id IN($instr) ORDER BY priority DESC LIMIT 1",0)))

  3. airon
    Member
    Posted 1 year ago #

    @joynic Works perfectly. Thank you.

  4. suki_vi_britania
    Member
    Posted 1 year ago #

    Thank youuuu!!!!! ♥♥♥

    Perfect :) !

  5. jeegrobot
    Member
    Posted 1 year ago #

    Thanks but I get an error by using Google Chrome:
    WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''wp_ig_caticons' (cat_id INT NOT NULL ,priority INT NOT NULL ,icon TEXT NOT NULL' at line 1 for query CREATE TABLE IF NOT EXISTS 'wp_ig_caticons' (cat_id INT NOT NULL ,priority INT NOT NULL ,icon TEXT NOT NULL ,small_icon TEXT NOT NULL , PRIMARY KEY ( cat_id )) made by require_once('E:\web\public_html\attic\xxxxxxxxxx\wp-load.php'), require_once('E:\web\public_html\attic\xxxxxxxxxx\wp-config.php'), require_once('E:\web\public_html\attic\xxxxxxxxxxx\wp-settings.php'), do_action('init'), call_user_func_array, ig_caticons_install

    It works perfectly with Firefox and Safari. Any suggestion?

  6. freedomstudios
    Member
    Posted 1 year ago #

    @joynic you are a legend!
    Thank you it works perfectly for me too ;)

  7. SolidSnake2003
    Member
    Posted 1 year ago #

    I tried this solution, and the icons won't save.

  8. Murielle
    Member
    Posted 1 year ago #

    Thanks a lot joynic...
    It works perfectly!

  9. jeegrobot
    Member
    Posted 1 year ago #

    Nobody has my same problem with Chrome?

  10. Murielle
    Member
    Posted 1 year ago #

    Sorry jeegrobot, it works perfectly with Chrome for me.
    Chrome Version 24.0.1312.52 m

  11. joynic
    Member
    Posted 1 year ago #

    @jeegrobot sorry, maybe that should not be a problem of the code. it works perfectly with Chrome for me also.

    @everyone pls thanks to the author of plugin:)

  12. submarine
    Member
    Plugin Author

    Posted 1 year ago #

    @ joynic : Thank YOU...

  13. adrianbruk
    Member
    Posted 9 months ago #

    Joynic!! You are a Geniuuuuus!!! Thank you so much!!

  14. floordesign
    Member
    Posted 7 months ago #

    After I did that code edit, I get an error too, but I've seen it in error.log

    WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''wp_ig_caticons' (cat_id INT NOT NULL ,priority INT NOT NULL ,icon TEXT NOT NULL' at line 1 for query CREATE TABLE IF NOT EXISTS 'wp_ig_caticons' (cat_id INT NOT NULL ,priority INT NOT NULL ,icon TEXT NOT NULL ,small_icon TEXT NOT NULL , PRIMARY KEY ( cat_id )) made by require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), call_user_func_array, ig_caticons_install

    In frontend (also Chrome) it is displayed fine. I didn't try to modify something in admin panel, but that error doesn't sound good.
    Any suggestion?

    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.