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.
Hi.
I tried to activate the date changer on my site, but any combination of month/day/year always results in the path being */calendar/0000-00
For example, if I change it to March 1, 2010, I'm expecting the path to be */calendar/2010-03, but it just takes me to */calendar/0000-00
Has anyone else experienced this?
My calendar is at http://www.cultureblast.ca/calendar, but I have disabled the date changer because it doesn't work for me and I don't want visitors to get frustrated with it.
Thanks.
Comment | File | Size | Author |
---|---|---|---|
#5 | date-picker-707202-5.patch | 1.13 KB | kostajh |
#4 | calendar.views_.inc-p1.patch | 1.03 KB | mdupont |
#3 | calendar.views_.inc-p0.patch | 1.03 KB | mdupont |
Comments
Comment #1
mdupontSame issue here, every time I apply changes to the date changer (using date_select widget), the argument is always set to 0000-00 in the URL. Date argument is with month granularity, so the format is OK, but it seems the validation doesn't succeed with date_select.
Comment #2
mdupontUpdate : I think I nailed the culprit : the function calendar_views_query_alter() in the file calendar.views.inc.
How to reproduce : Use a calendar with, as argument, a date field not using the Date Popup. Make sure that the module Date Popup is disabled in admin/build/modules. Activate the date changer. You will see the date changer appear as a date_select element (dropdown lists) following the "short" date format. Good. Now try to change the date. The argument will always be a bunch of 0s (0000-00 on a month view, 0000-00-00 on a day view, etc).
It seems that the structure of $form['calendar_goto'] is different depending on the kind of date selector used. In the code I can see operations on $_POST['calendar_goto']['date'], which exists in a date_popup element but not in a date_select element. With date_select, the values are $_POST['calendar_goto']['year'], $_POST['calendar_goto']['month'], $_POST['calendar_goto']['day'], etc, which are the value that should be processed and converted into ISO 8601 format. As $_POST['calendar_goto']['date'] doesn't exists, the result is an ISO 8601 formatted bunch of 0s.
For the moment I made a quick and dirty hack in calendar.views.inc to get the right argument (in my case, year and month):
I'll try to make a proper patch when i'll have time.
Comment #3
mdupontHere is a quick patch checking for $_POST['calendar_goto']['date'] and adapting the $date variable depending on the result. Works for me®, please review.
Comment #4
mdupontWTF, in the rush I used array_key_exists() as isset(). Here is the fixed version.
Comment #5
kostajh CreditAttribution: kostajh commentedPatch in #4 worked, I re-rolled it against the latest 6.x-2.x code.
Comment #6
Neslee Canil PintoThe D6 branch is no longer supported so we're closing this issue. If you think this issue still exists in D7 you can open a new one.