Closed (fixed)
Project:
Resource Conflict
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
19 Oct 2012 at 10:48 UTC
Updated:
17 Mar 2014 at 03:30 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
maciej lukianski commentedYou have to mark the field as required and at the bottom mark "require end date"
Comment #2
Miao1994 commentedSorry for the trifling question, I tried to use resource conflit on used data field that not require end date, with data stored in DB; so I can't change require end date option anymore. I think there is no way to fix that.
Comment #3
problue solutionsI have a date field with both start and end dates, required is also ticked.
Still receive the message:
"This content type does not contain any suitable Date fields. Please add at least one Date field with required start and end dates."
Comment #4
caspervoogt commentedI too have a date field (using Date 7.x-2.6) on my "Event" content type, with start and end dates required. I also tried Date (iso) and Date (unix timestamp) to avail. Added a date field to both the Resource and Event content types just for good measure, but it made no difference.
I had a quick look in the module code and it's looking for an array called $date_fields, and checking if it's empty. Apparently, it thinks it's empty. I think the following IF statement needs closer inspection;
Replace with:
Now I see the option "Enable resource conflict checking for this content type" when editing my Events content type.
Basically, the IF statement needed to reference $fieldinfo and not $field, except for checking whether the date field is required.
Also, I had to remove ['display']['default'] as that did not exist in the array structure I saw.
Comment #5
caspervoogt commentedI have changed my code so that the date field is no longer required. I have an Events content type, but not every event will need to reserve a resource.
I'm not sure why the date field must be required. What I ended up doing was having one date field for the event itself, and a second date field for reserving the resource.
So:
if ( isset($fieldinfo['module']) && ($fieldinfo['module'] == 'date') && ($field['required'] == 1) ) {becomes:
if ( isset($fieldinfo['module']) && ($fieldinfo['module'] == 'date') ) {My reservation date field is now set to *not* required. If I leave it 'required' and try to add an event, it will otherwise result in a white screen (500 server) error.
So maybe the above change still requires a check to make sure the field itself does not require a value. That wouldn't go in this IF statement .. not sure where.
Comment #6
caspervoogt commentedAttached is a patch per my comment #5 above.
Comment #7
bkosborneThis was addressed in a previous commit and should be fixed now. Date fields are also no longer required to be compatible with this module, but the end date is always required.