Closed (fixed)
Project:
Date Restrictions
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Aug 2015 at 15:08 UTC
Updated:
8 Sep 2015 at 16:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
grimreaperHere is the patch.
Thanks for the review.
Comment #3
jonhattanSorry I can't see where's the new dependency added. What is the fatal error you're getting?
Comment #4
jonhattanIf you're using a restriction based on interval, you must already have interval enabled. This dependency is declared at http://cgit.drupalcode.org/date_restrictions/tree/modules/minmax/date_re... and enforced at http://cgit.drupalcode.org/date_restrictions/tree/modules/minmax/date_re...
Comment #5
jonhattanComment #6
grimreaperHello,
In our project, we use date_restrictions in a custom form, see the following code:
Before the commit it worked well. Now we have the following error: Fatal error: Call to undefined function interval_apply_interval() in /sites/all/modules/contrib/date_restrictions/modules/minmax/date_restrictions_minmax.date_restrictions.inc on line 290
Thanks for pointing the dependencies check of the module but It seems not working in custom forms.
Maybe we do not use the module correctly, in this case I will be very thankful if you can tell me the problem or pointing me to the associated documentation.
Comment #7
jonhattanDependency check is done in the field UI settings form. It forbids the configuration of interval settings if it founds the module is not enabled.
For custom forms, the best is to add the dependency to your custom module. In the very same way, you want to add a dependency on date_popup module, to grant it is available when declaring '#type' => 'date_popup', in your custom form.
On date_restrictions side, we could add an advice to README.txt, since the example depends on interval module being enabled. Patches welcome.
Comment #8
grimreaperThanks for your response.
Ok I will provide a patch for this advice.
Comment #9
grimreaperHere is a patch that adds the information in the README.txt
Thanks for the review.
Comment #11
jonhattanCommitted. Thanks!