When trying to set default expiration for a content type date popup doesn't allow PHP strtotime format. Only a specific date can be entered manually. If I copy and paste "+30 days" into the date expiration field I receive the following error after trying to save the changes:

- The value input for field Default expiration date is invalid:
- The value +30 days does not match the expected format.
- Warning: strtotime() expects parameter 1 to be string, array given in _node_expire_form_node_type_form_alter_validate() (line 13 of /www/trade/public_html/sites/all/modules/node_expire/node_expire.ntype.inc).

If I disable date popup I am able to use PHP strtotime input for the field and it works as expected. I've tried different versions of jquery without any success.

Comments

Nafes’s picture

danielash, I can make "Use date popup" option configurable separately for nodes and node types. So, for nodes you can still use date popup and for node types you can use text entry. Will it be helpful for you?

danielash’s picture

Nafes, I've searched for such an option but have not found it. I suppose I could use form_alter to accomplish that but if it's already configurable I don't know where.

Nafes’s picture

The feature is not in place yet. I can create it quickly. And in long term I need to re-think this configuration area. Will the separate date popup configuration for nodes and node types be helpful for you? Or maybe you have some better idea?

danielash’s picture

Thank you for the prompt response and for helping. I'm thinking it might be better to simply disable date popup on the node type form altogether. I can't think of any situations that would require a specific date for the default. Wouldn't it always be +days/weeks/months or something along those lines? I like that the configuration area is part of the publishing options, unlike the scheduler module which has it's own tab. The only thing I would add is form options for people who aren't familiar with php strtotime.

Nafes’s picture

Absolutely agree. In long term I am thinking about form options for people who aren't familiar with php strtotime. And for now I will simply disable date popup on the node type form and keep it just on the node form. Hopefully it should be ready tomorrow. Your feedback is very helpful. Thank you.

  • Nafes committed 3186991 on 7.x-1.x
    Issue #2315449 by danielash, Nafes: Removed date popup from the node...
Nafes’s picture

danielash, please try 7.x-1.x-dev release.

danielash’s picture

Works brilliantly, thanks again.

Nafes’s picture

Status: Active » Fixed

You are very welcome. These changes have been placed to the recommended release 7.x-1.5.

Status: Fixed » Closed (fixed)

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