Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I'm attempting to create a custom content type for a module via hook_install. When I create a date type (from Date module), I want it to require an end date (there's a checkbox when you're setting up the field via the gui). This is the settings array for the field:

'settings' => array(
    'enddate_get' => 1,
    'enddate_required' => 1,
),

This isn't working (the widget is still only asking for one date), so I'm guess that I have the wrong settings. Does anyone know how to properly set this up?

share|improve this question
    
Is that D6 or D7? –  Valery Lourie Aug 8 '12 at 15:11
    
Looks tagged as D7 to me. –  nedwardss Aug 8 '12 at 19:36
    
Sorry, I tagged it after this comment was posted. I thought I replied also.... must not have –  greggory.hz Aug 8 '12 at 23:02

1 Answer 1

I believe you would need to setup the requirement on the form you are building for the custom content type so you would add this to the date_end form entry:

$form['CUSTOM_CONTENT_TYPE']['DATE_END'] = array(
...
  '#required' => TRUE,
...
),
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.