23 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • 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
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Has been a member for 4-5 years
  • Europe
  • Exclusive Author
  • Referred between 50 and 99 users
  • Bought between 100 and 499 items
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.

303 posts Codestar
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Exclusive Author
  • Has been a member for 5-6 years
  • Envato Studio (Microlancer) Beta Tester
  • Bought between 100 and 499 items
  • Referred between 50 and 99 users
+2 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

990 posts It's in the pipeline!
  • Elite Author
  • Exclusive Author
  • Europe
  • Has been a member for 5-6 years
  • Bought between 100 and 499 items
  • Referred between 200 and 499 users
  • Envato Studio (Microlancer) Beta Tester
+2 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
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Has been a member for 4-5 years
  • Europe
  • Exclusive Author
  • Referred between 50 and 99 users
  • Bought between 100 and 499 items
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
  • Exclusive Author
  • Sold between 5 000 and 10 000 dollars
  • Has been a member for 4-5 years
  • Europe
  • Envato Studio (Microlancer) Beta Tester
  • Bought between 1 and 9 items
  • Referred between 1 and 9 users
dekciw says

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

//ok, joking :D

590 posts
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Has been a member for 4-5 years
  • Europe
  • Exclusive Author
  • Referred between 50 and 99 users
  • Bought between 100 and 499 items
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
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • 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
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Has been a member for 4-5 years
  • Europe
  • Exclusive Author
  • Referred between 50 and 99 users
  • Bought between 100 and 499 items
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
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • 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