Trying to confirm a booking via the link provided in the mail results in an error:

Fatal error: Call to undefined function bookingsapi_status_change() in [..]publicbookings/publicbookings.public.inc on line 230

Looking at bookingsapi one could deduce that the method bookingsapi_record_status_change was meant - replacing bookingsapi_status_change with bookingsapi_record_status_change gives the following errors:

warning: Invalid argument supplied for foreach() in [..]publicbookings/publicbookings.module on line 412.
E-Mail konnte nicht gesendet werden. Sollte das Problem fortbestehen, sollte der Admin der Website kontaktiert werden.
(The last messages states that the mail could not be send).

The mailproblem is a strange one:
From publicbookings.public.inc (after the above change):

function publicbookings_confirm($passphrase) {
  if (variable_get('publicbookings_enabled', 0) == 0) {
    return publicbookings_public_disabled_message();
  }

  $sql = "SELECT * FROM {publicbookings_clients} WHERE passphrase='%s'";
  $q = db_query($sql, $passphrase);
  $client = db_fetch_array($q);
  if ($client == FALSE) {
    return '<p>'.t('Invalid passphrase. Verify the link in your confirmation email.').'</p>';
  } else {
    bookingsapi_record_status_change($client, BOOKINGSAPI_STATUS_PENDING);
    drupal_mail('publicbookings', 'request_pending', $form_state['values']['email'], language_default(), $form_state['values'], NULL,     TRUE);
    return '<p>'.t('Your email has been verified. Your booking request is now pending review by a booking manager.
           You will be informed of any status changes by email').'</p>';
  }
}

Well - $form_state is never set in this method, so it surely cannot be read (and yes I checked - it is not set ;) ).

I would be willing to help (temporarily or permanently) with maintaining this module if the need should arise.

Comments

Anonymous’s picture

Additional information: Backtrace containing the called mail - it's really wrong ;)

    [1] => Array
        (
            [file] => [..]/publicbookings/publicbookings.public.inc
            [line] => 231
            [function] => drupal_mail
            [args] => Array
                (
                    [0] => publicbookings
                    [1] => request_pending
                    [2] => /* Should be to */
                    [3] => stdClass Object
                        (
                            /* unimportant language object */
                        )

                    [4] => /* Should be params */
                    [5] => /* okay */
                    [6] => 1
                )

        )

The foreach-error above seems to be a result of the missing 4th argument.

Anonymous’s picture

Status: Active » Closed (duplicate)