When I'm using publicbookings and submitting the form (admin/content/publicbookings/booking/add)
I've got following errors:

A resource must be chosen.
warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in date\date_api_ical.inc on line 587.
CommentFileSizeAuthor
#3 date_api_ical.inc_.patch3.21 KBkenorb
#2 date_repeat.txt49.63 KBkenorb

Comments

kenorb’s picture

kenorb’s picture

StatusFileSize
new49.63 KB

Problem is with following line:
$rrule = date_api_ical_build_rrule($item);
in function date_repeat_rrule_validate().
I don't know in which place it should be validated if $item is empty.

Check backtrace in attachment.

kenorb’s picture

Status: Active » Needs review
StatusFileSize
new3.21 KB

Here is my patch, or if somebody have better idea.

karens’s picture

Status: Needs review » Fixed

Public Bookings should not be sending something that is not an array of values to that function, so that's the real problem and you should file a report there. But I agree I might as well do some validity testing. We can do this much simpler than your patch by just checking once at the beginning of the function whether $form_values is an array. If it isn't nothing else will work so we just return an empty value.

kenorb’s picture

Project: Date » Public Bookings
Version: 6.x-2.0-rc6 » 6.x-1.x-dev
Component: Date Repeat API » Code
Status: Fixed » Needs work
Anonymous’s picture

Status: Needs work » Postponed (maintainer needs more info)

Has anybody re-encountered this problem?

--edit: I apologize - hit the wrong key.

Can anybody provide additional information (e.g. a stacktrace)? I am unable to reproduce this problem in my installation.

Anonymous’s picture

Status: Postponed (maintainer needs more info) » Fixed

Set to fixed - feel free to reopen, if this problem occurs again.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.