Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When you try to set the date manually from the "Scheduling options" tab/fieldset in the node edit form, the date value does not save and remains empty if you go to edit the date again.
Comment | File | Size | Author |
---|---|---|---|
#1 | scheduler-dates-not-saving-from-scheduler-options-form-2223489-1.patch | 834 bytes | mamanerd |
Comments
Comment #1
mamanerd CreditAttribution: mamanerd commentedOkay, I think I fixed it.
Comment #2
jonathan1055 CreditAttribution: jonathan1055 commentedHi mamanerd,
Thanks for you post. But this seems such a fundamental problem that I can't quite understand it. Could you explain the fault in more detail please, and list the reproduction steps.
Jonathan
Comment #3
mamanerd CreditAttribution: mamanerd commentedSteps to reproduce:
1) Enable the Scheduler module
2) Configure Scheduler (admin/config/content/scheduler). For Field Type, select "Standard text field". For Date Only, select "Allow users to enter only a date and provide a default time" and keep the default time at 00:00:00
3) Edit content type settings (admin/structure/types/manage/CONTENTTYPE)
4) Go to "Scheduler" tab. Under "Unpublishing", select "Enable scheduled unpublishing for this content type." Leave display as "Vertical tab".
5) Add new node of above content type (node/add/CONTENTTYPE)
6) Go to "Scheduling Options" tab. Enter a date manually (ex: 2014-03-22)
7) Save node
The date was not saving for me when I did it this way. But if I added the date to the node programmatically, it worked fine, so I figured there was something weird happening with the form.
FYI I'm currently using Drupal 7.26 and Date 7.x-2.7 if it matters.
Comment #4
jonathan1055 CreditAttribution: jonathan1055 commentedThanks for the repro steps. I've followed them and nothing goes wrong for me - the date is saved when you go back to edit the node. That's what I expected, because something as major as this could not have gone unnoticed up to now. So there must be something in your environment which is causing the problem, some interaction with another module, or some different or alternative method of processing the form. Or some default we are relying on in Scheduler which is not the same in your set-up.
I noticed that you only enabled unpublishing. That's fine, but I just wanted to check. Also, you have the default time as 00:00:00 but your example time would have created a datestamp in the past and should have prompted a validation error. Did you see the error? or maybe your example was simply an example and you actually entered a future day. Just thought that would be worth checking too, as you mention doing things programatically.
Do you know exactly where in the Core form code that $form['some_fieldset']['myvar'] data gets transferred into the $node->myvar property? It would seem that this is not happening correctly for you.
Jonathan
Comment #5
jonathan1055 CreditAttribution: jonathan1055 commentedChanging the status, as the patch provided is not going to be implemented until we can reproduce the error and understand what (if anything) is wrong with the Scheduler code. Awaiting answers to #4.
Comment #6
jonathan1055 CreditAttribution: jonathan1055 commentedClosing this as no response for six weeks. Assuming it was caused by another module, not scheduler. Please re-open if you can reproduce this on a clean drupal install with no other modules enabled.
Jonathan