majato
Member
Posted 4 months ago #
After updating to WordPress 3.5 I get the following errors:-
Warning: Missing argument 2 for wpdb::prepare() called in /wp-content/plugins/simple-ads-manager/list.admin.class.php on line 118 and defined in /wp-includes/wp-db.php on line 990
Warning: Missing argument 2 for wpdb::prepare(), called in /wp-content/plugins/simple-ads-manager/list.admin.class.php on line 119 and defined in /wp-includes/wp-db.php on line 990
This occurs with both 1.7.57 and previous version.
http://wordpress.org/extend/plugins/simple-ads-manager/
pabloseidel
Member
Posted 4 months ago #
The same thing happened with me, and after changing some codes in some php files the problem seems to be fixed. I hope that a new version of the plugin will be available so we can just update it and all files will be fixed at once.
Despite the error, looks like the plugin works normally.
B_Dark
Member
Posted 4 months ago #
i got the same warning msg on mysite.com/wp-admin/admin.php?page=sam-list
tm8228
Member
Posted 4 months ago #
Hi,
read this post
http://make.wordpress.org/core/2012/12/12/php-warning-missing-argument-2-for-wpdb-prepare/
and then change in
/wordpress/wp-content/plugins/simple-ads-manager/list.admin.class.php
lines 118 and 119 to
$trash_num = $wpdb->get_var($wpdb->prepare('SELECT COUNT(*) FROM '.$pTable.' WHERE trash = %s', TRUE));
$active_num = $wpdb->get_var($wpdb->prepare('SELECT COUNT(*) FROM '.$pTable.' WHERE trash = %s', FALSE));
B_Dark
Member
Posted 4 months ago #
on line 118 & 119 is
$all_num = $trash_num + $active_num;
$total = (($mode !== 'all') ? (($mode === 'trash') ? $trash_num : $active_num) : $all_num);
right?
tm8228
Member
Posted 4 months ago #
... no, sorry, not in my case.
Search for
$trash_num = $wpdb->get_var($wpdb->prepare('SELECT COUNT(*) FROM '.$pTable.' WHERE trash = TRUE));
and
$active_num = $wpdb->get_var($wpdb->prepare('SELECT COUNT(*) FROM '.$pTable.' WHERE trash = FALSE));
Should be 3 lines or so above ...
rbiard
Member
Posted 3 months ago #
This does not completely fix the problem.
If you click on the settings tab, you still get errors about unknown variables of instance.
But thanks anyway for this tip.