First off, thanks for contributing such a useful module.
I created a content type (called 'Event') which contains a 'Resource Booking' field. If an event requires certain resource(s) to be booked, the event node and resource bookings can be created at the same time. It's possible the event title or information may need to be updated after being created. When the end-user first edits the node, the resource shows a 'booked' status in the widget and the checkbox is checked. However, after the node is saved (without changing the resource booking), the resource booking is somehow deleted. Subsequent attempts to edit the node show the time is back to the default and the resource is now available. I experienced this issue using both the 7.x.1.0 release and the latest development code. I was curious if anyone else had experienced this issue since I haven't seen it reported anywhere.
Comments
Comment #1
kyriefurro commentedI'm seeing this issue as well. It occurs on any type of change to the node - including updating the reservation booking status. However looking at the database it looks like the reservation isn't actually lost. The problem is occurring on the UI. The checkbox for the resource is being changed to unchecked during the update process, but it remains locked so we can't recheck it. To add insult to injury since the box is empty - even though the item is still reserved - the update fails its validation check leaving you unable to update.
Comment #2
sukr_s commentedI've tried several combinations but the error cannot be reproduced. specify the exact steps for reproducing the issue.
Comment #3
TheOther commentedI just hit the same issue with trying to edit existing bookings - The checkboxes for already booked resources are disabled and cannot be changed and their values are lost upon saving.
I started browsing through the code and found this piece in theme_resources_booking_form()
Perhaps I'm not seeing the whole picture, but to me it seems there is some logic missing here. Won't this code always disable the checkboxes for already booked resources, even if you're trying to edit the booking that's currently holding the resource?
I'm not a PHP developer, but I did the following quick hack which at least for me seems to have fixed the editing logic so it works as expected. I.e don't disable the checkbox if it's already checked.
Comment #4
stephanieshea commentedI am having the same problem and was relieved to find this post...can it be fixed please? It's a great module! Sukr_s, since you can't replicate the problem that we are having, coud there be a setting missing from the README?
Also Sukr_s - what version of calendar module do you recommend? Currently using 7.x 3.3 because 3.4 seems to cause problems with the resource module.
Comment #5
stephanieshea commentedI had tried #3 before but I just did so again and it worked! No resource loss on edit now. I retried at the suggestion of a drupal developer: http://nibbler.silktide.com/u/basicmagic
thanks vincent!
Comment #6
hmshelley commentedI discovered the issue only happens if multiple resources can be booked. To reproduce, follow usage steps in README; when creating a content type that uses a resource (step #3), select multiple resource types under "Allow multiple". The problem occurs when updating a node with a resource field, as described in the issue description. The resource booking widget contains checkboxes rather than radio buttons next to the bookable resources.
I have the most up-to-date version of this module, as well as all dependencies (except Calendar which is 7.x-3.3).
My workaround was similar to the solution posted by TheOther in this thread. If the checkbox(es) are not disabled, the resource booking is correctly saved on update. In the theme_resources_booking_form function of resource_booking.module, I added a condition before the checkbox is disabled:
Comment #7
sukr_s commentedFixed in 7.x-2.0
Comment #8
amrendra commentedThanks