Events Made Easy › Forums › Bug fixed or feature request implemented › Bug with WordPress 3.5
- This topic has 12 replies, 2 voices, and was last updated 11 years, 11 months ago by Franky.
-
AuthorPosts
-
Mon 17 Dec 2012 at 19:16 #43877AnonymousInactive
So, everything appears to work okay, and the plugin is not unusable as-is, but I’m getting a warning message pushed through since I updated to WP 3.5. The warning message repeats for every signup. It’s showing in the attendance list, both in the WP Dashboard and in the printable option:
Warning: Missing argument 2 for wpdb::prepare(), called in /REDACTED/wp-content/plugins/events-made-easy/eme_rsvp.php on line 1300 and defined in /REDACTED/wp-includes/wp-db.php on line 990
Mon 17 Dec 2012 at 22:24 #50039FrankyKeymasterThis is weird: according to the reported line number in eme_rsvp.php, this happens in the call to eme_update_booking_payed() inside the function eme_paypal_ipn(). The prepare statement has the booking id as argument, thus the code is correct. But according to your warning, the argument is not there …
Now the function call has 2 arguments:
eme_update_booking_payed($booking_id,1)
and in the function eme_update_booking_payed(), you can see the prepare statement:
function eme_update_booking_payed($booking_id,$value) {
global $wpdb;
$bookings_table = $wpdb->prefix.BOOKINGS_TBNAME;
$sql = $wpdb->prepare("UPDATE $bookings_table set booking_payed=$value WHERE booking_id = %s",$booking_id);
return $wpdb->query($sql);
}Now if the $booking_id is not defined, of course the prepare statement is not going to be happy …
This value *should* be returned by paypal, so if it is not there: check the html of the actual paypal form (the one from paypal, where you actually pay) and see if the html has “item_number” as a form value somewhere. If it does not, then there’s an issue with the paypall class.
Mon 17 Dec 2012 at 22:27 #50040FrankyKeymasterOr maybe the issue is because “%s” is used for the prepare statement, while the value is an integer … it should be “%d”
Try this on line 506:
$sql = $wpdb->prepare("UPDATE $bookings_table set booking_payed=$value WHERE booking_id = %d",$booking_id);
Wed 19 Dec 2012 at 11:49 #50041AnonymousInactiveI’m afraid the second option doesn’t fix it.
The event isn’t a pay event, so I don’t have the paypal box checked and I don’t have anything configured to connect to paypal. Is it possible, perhaps, that that’s the problem?
Wed 19 Dec 2012 at 13:59 #50042FrankyKeymasterWhich version of the plugin are you using then? This code is only being accessed when paypal is activated … or it should be anyway.
Thu 20 Dec 2012 at 13:03 #50043AnonymousInactiveEvents Made Easy v1.0.4
Thu 20 Dec 2012 at 18:10 #50044FrankyKeymasterAnd you haven’t changed the code, or created own hooks?
Fri 21 Dec 2012 at 18:12 #50045AnonymousInactiveOh hell, no. 🙂
My coding skills are so far below what is necessary to work in a wordpress plugin that I know better.
Should I uninstall, delete, and reinstall the plugin, maybe? And if I do that, will the new install pick up on the old database?
Sat 22 Dec 2012 at 00:08 #50046FrankyKeymasterWell, it’s worth a try, but I don’t think that it’ll change anything. I’ll try to reproduce it this weekend.
And yes, the old database will be picked up.
Sat 29 Dec 2012 at 22:41 #50047FrankyKeymasterOk, I found the issue 🙂
It was indeed a prepare statement with the wrong number of arguments, but I misread the linenumbers in the original bug report (I read 990, while I should’ve been looking for line 1300).
Anyway, fixed here:
http://plugins.trac.wordpress.org/changeset/645920
and then (to correct my stupid typo):
Mon 31 Dec 2012 at 15:49 #50048AnonymousInactiveThat seems to have done the trick, Franky. Thanks, as always, for your quick responses. 🙂
Mon 31 Dec 2012 at 16:15 #50049FrankyKeymasterI wouldn’t say quick, but during the holiday season I have an excuse 🙂
Mon 31 Dec 2012 at 16:16 #50050FrankyKeymasterBtw, you’ll be pleased to read my last post here: http://www.e-dynamics.be/bbpress/topic.php?id=524
-
AuthorPosts
- The forum ‘Bug fixed or feature request implemented’ is closed to new topics and replies.