23 posts
  • 5 Years of Membership
  • Collector Level 2
  • Exclusive Author
  • United States
brandless
says

Hi everyone, I have a problem with my theme after updating to WP 3.5 and I’ve seen in the WP forums that many other are having this same problem,

Warning: Missing argument 2 for wpdb::prepare(), called in /home/XXXXX/public_html/wp-content/themes/XXXXXX/functions/at-sidebars.php on line 127 and defined in /home/XXXXX/public_html/wp-includes/wp-db.php on line 990

Here’s how the sidebar file of my theme looks like in line 127:

$widgetized_pages = $wpdb->get_col($wpdb->prepare(“SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE meta_key = ‘at_sidebar’”));

anyone knows how to fix this?

590 posts
  • Weekly Top Seller
  • Elite Author
  • Author Level 8
  • Featured Author
+6 more
CodeSwift
says

Haha, yeah it’s a little mistake i made back when i developed the “unlimited sidebars” feature for our themes which surfaced now with 3.5 change on the prepare function.

But that is not our theme, the file is in the same folder but we called it sidebars.php not at-sidebars.php. So i guess someone’s using our code, and i’d like to know how much of it, so please let me know which theme it is (send over an email via the contact form on our profile page, don’t post it here). Will also let you know how to fix it.

P.S. If someone who uses our themes comes by this forum post, the updates for all our themes will be released tomorrow, we already made the updates with 3.5 RC-3 last week, we just need to test the updates with the stable version as well. In case you already updated WP and get this error send over an email via the contact form on our profile page and we’ll send you over the new version.

447 posts Codestar
  • Elite Author
  • Author Level 9
  • Trendsetter
  • Top Monthly Author
+10 more
Codestar
says

Hi everyone, I have a problem with my theme after updating to WP 3.5 and I’ve seen in the WP forums that many other are having this same problem,

Warning: Missing argument 2 for wpdb::prepare(), called in /home/XXXXX/public_html/wp-content/themes/XXXXXX/functions/at-sidebars.php on line 127 and defined in /home/XXXXX/public_html/wp-includes/wp-db.php on line 990

Here’s how the sidebar file of my theme looks like in line 127:

$widgetized_pages = $wpdb->get_col($wpdb->prepare(“SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE meta_key = ‘at_sidebar’”));

anyone knows how to fix this?

Hi,

Change here:

$widgetized_pages = $wpdb->get_col($wpdb->prepare(“SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE meta_key = %s”, “at_sidebar”));

Wordpress added a new argument for prepare function in WP3.5… it is required for wordpress security…

Quick Tips : if you have a lot of errors, open functions.php and write error_reporting(0); but it is not good. not recommended.

Regards, Codestar

1142 posts It's in the pipeline!
  • Top Monthly Author
  • Trendsetter
  • Weekly Top Seller
  • Author Level 11
+9 more
purethemes
says

But that is not our theme, the file is in the same folder but we called it sidebars.php not at-sidebars.php. So i guess someone’s using our code, and i’d like to know how much of it, so please let me know which theme

That’s hilarious :D Good lessons for those who think you can get away with stealing backend code :D

590 posts
  • Weekly Top Seller
  • Elite Author
  • Author Level 8
  • Featured Author
+6 more
CodeSwift
says


But that is not our theme, the file is in the same folder but we called it sidebars.php not at-sidebars.php. So i guess someone’s using our code, and i’d like to know how much of it, so please let me know which theme
That’s hilarious :D Good lessons for those who think you can get away with stealing backend code :D

I’m not saying for sure that the code is stolen, it was a long time ago when i wrote it, maybe it’s from some tutorial, but i don’t think it is. And it has pretty much the same filename and it’s in the same folder, so it’s quite odd. That’s why i’d like to take a look at the theme :)

I just hope i won’t see a differently styled Content Composer in there :)

332 posts
  • Affiliate Level 1
  • Author Level 4
  • Beta Tester
  • Collector Level 1
+2 more
dekciw
says

hmz, maybe this is my theme he’s talking about.. you should definately buy it and investigate.

//ok, joking :D

590 posts
  • Weekly Top Seller
  • Elite Author
  • Author Level 8
  • Featured Author
+6 more
CodeSwift
says

hmz, maybe this is my theme he’s talking about.. you should definately buy it and investigate. //ok, joking :D

Haha :)

23 posts
  • 5 Years of Membership
  • Collector Level 2
  • Exclusive Author
  • United States
brandless
says

Thanks guys! :) just to be clear, Im NOT a Wp theme developer, and the theme we’re talking about is not from TF either nor its mine, Its custom made…

Anyway, Ill only share the details with WPScientist. Anyway, the idea is how to Fix this, as I mentioned this is not a problem exclusive to this code, many plugin devs and theme makers are facing this issue, so I appreciate it.

590 posts
  • Weekly Top Seller
  • Elite Author
  • Author Level 8
  • Featured Author
+6 more
CodeSwift
says

Ohhhh, i actually just noticed the name of the variable in which the response is stored :)$widgetized_pages. Yup, definitely my code.


Anyway, Ill only share the details with WPScientist. Anyway, the idea is how to Fix this, as I mentioned this is not a problem exclusive to this code, many plugin devs and theme makers are facing this issue, so I appreciate it.

Thank you. :)

23 posts
  • 5 Years of Membership
  • Collector Level 2
  • Exclusive Author
  • United States
brandless
says

:) well I don’t know what I DO know is that the theme is custom made for our site. Anyway… I think I found the solution, will let everyone know when I test it.

by
by
by
by
by
by