Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #43877
    Anonymous
    Inactive

    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

    #50039
    Franky
    Keymaster

    This 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.

    #50040
    Franky
    Keymaster

    Or 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);

    #50041
    Anonymous
    Inactive

    I’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?

    #50042
    Franky
    Keymaster

    Which version of the plugin are you using then? This code is only being accessed when paypal is activated … or it should be anyway.

    #50043
    Anonymous
    Inactive

    Events Made Easy v1.0.4

    #50044
    Franky
    Keymaster

    And you haven’t changed the code, or created own hooks?

    #50045
    Anonymous
    Inactive

    Oh 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?

    #50046
    Franky
    Keymaster

    Well, 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.

    #50047
    Franky
    Keymaster

    Ok, 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):

    http://plugins.trac.wordpress.org/changeset/645925

    #50048
    Anonymous
    Inactive

    That seems to have done the trick, Franky. Thanks, as always, for your quick responses. 🙂

    #50049
    Franky
    Keymaster

    I wouldn’t say quick, but during the holiday season I have an excuse 🙂

    #50050
    Franky
    Keymaster

    Btw, you’ll be pleased to read my last post here: http://www.e-dynamics.be/bbpress/topic.php?id=524

Viewing 13 posts - 1 through 13 (of 13 total)
  • The forum ‘Bug fixed or feature request implemented’ is closed to new topics and replies.
Scroll to Top