23 posts
  • Has been part of the Envato Community for over 4 years
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Located in 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
  • Has referred 50+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+5 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.

316 posts Codestar
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $250,000+ on Envato Market
  • Sells items exclusively on Envato Market
  • Had an item featured on Envato Market
+7 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

1012 posts It's in the pipeline!
  • Has sold $500,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 6 years
  • Sells items exclusively on Envato Market
+7 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
  • Has referred 50+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+5 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
  • Has referred 1+ members
  • Has sold $5,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 1+ items on Envato Market
+3 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
  • Has referred 50+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+5 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
  • Has been part of the Envato Community for over 4 years
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Located in 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
  • Has referred 50+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+5 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
  • Has been part of the Envato Community for over 4 years
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Located in 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