If you install the module in a fresh Drupal with Date Popup module, on trying to add a new article you get the error:

Undefined index: #default_value in date_popup_process_time_part()

This is caused by a missing parameter in $form['options']['pubdate']. I attach a patch to solve this situation.

Comments

nmowat’s picture

Priority: Normal » Major
Status: Active » Reviewed & tested by the community

I had this same issue and the attached patch fixed it for me.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, publication_date.patch, failed testing.

Status: Needs work » Needs review

jstoller queued publication_date.patch for re-testing.

Status: Needs review » Needs work

The last submitted patch, publication_date.patch, failed testing.

jstoller’s picture

Version: 7.x-2.2 » 7.x-2.x-dev
Priority: Major » Normal

What version of the Date module are you using? I wonder if this problem just cropped up with the new 2.9 release candidate, or if it's been in there all along.

The patch needs to be based on the module's directory, not the Drupal install. Once the patch is fixed and resubmitted, if it passes the testbot I'll commit it.

dtamajon’s picture

This problem is with the current 2.8 version, and I think it was in the previous 2.7... I don't know if it's older.

I will try to do the patch based on the module's directory... but still have never done. I will do as soon as I can read Drupal docs to do it properly.

dtamajon’s picture

StatusFileSize
new431 bytes

Please, let me know if I made the patch properly.

dtamajon’s picture

StatusFileSize
new495 bytes

Sorry... I missed the first line

jstoller’s picture

Status: Needs work » Needs review

Looks right to me. Changing status to trigger testbot.

Status: Needs review » Needs work

The last submitted patch, 8: publication_date_2499731.patch, failed testing.

dtamajon’s picture

I see in the "View" link that line-endings is not unix-style... but they are. What's wrong on the patch?

  • jstoller committed 0e8828f on 7.x-2.x
    Issue #2499731 by dtamajon, jstoller: Undefined index: #default_value in...
jstoller’s picture

Status: Needs work » Fixed

@dtamajon I don't know what was wrong with your patch, but I couldn't get it to apply either. No matter. I fixed the issue, though in a slightly different spot. That said, I think this is actually a Date module issue.

Am I correct that you are both using the alternate dropdown (wvega) timepicker? Looking at the code for date_popup_process_time_part() I can see where it assumes a default date has been set, but this is not a safe assumption. I've filled an issue in the Date module queue for this, if your interested: #2532636: Undefined index: #default_value in date_popup_process_time_part().

dtamajon’s picture

@jstoller, I posted here because I was looking for the error on Date module issues and I found it wasn't related to Date module itself, but with Publication Date because there was an expected value not initialized, accordingly to Date module authors.

Anyway, I think Date Popup should have the additional validation you have proposed. Thank you!

About dropdown (wvega) timepicker, yes, I'm using it.

Status: Fixed » Closed (fixed)

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