Incompatible with Multistep

BWPanda - October 11, 2009 - 23:29
Project:Scheduler
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

I'm using Scheduler along with MultiGroup but am having some issues; specifically, when I have Scheduler on a step other then 1 and try to hit Next, I get the following errors:

* The 'publish on' value does not match the expected format of 2009-10-12 10:19:32
* The 'unpublish on' value does not match the expected format of 2009-10-12 10:19:32

I'm not sure if this is an issue with Scheduler or MultiGroup, but other modules seems to work ok with MultiGroup, so I thought I'd start here :)

#1

Eric Schaefer - October 12, 2009 - 08:42
Status:active» postponed (maintainer needs more info)

What is "MultiGroup"? There doesn't seem to be a module with that name...

#2

BWPanda - October 12, 2009 - 09:14
Title:Incompatible with MultiGroup» Incompatible with Multistep
Status:postponed (maintainer needs more info)» active

Oops, my mistake - Multistep: http://drupal.org/project/multistep
All these modules are so confusing...

#3

Eric Schaefer - October 14, 2009 - 18:00
Status:active» postponed (maintainer needs more info)

Do you have date_popup module enabled? If you do then this sounds suspiciously like #579126: Multistep module breaks multi-valued fields. It works fine if the scheduler fieldgroup is in all steps or if date_popup is not enabled. The regular input is only a single value while the date popup uses two seperate values for date and time.

#4

BWPanda - October 14, 2009 - 22:40
Status:postponed (maintainer needs more info)» active

I do have the date_popup module installed. I can confirm that it works when date_popup is disabled and/or when scheduler is set to be displayed on all steps.

However, a patch was released for the multi-valued issue which fixes that, but this problem still occurs.
So, does the problem lie with Scheduler, Date Popup or Multistep?

For now I've set Scheduler to be displayed on all steps, but this is just a temporary workaround while this is being looked into.

#5

BWPanda - October 15, 2009 - 00:12

Date_Popup could be the issue here... Found another problem on my site whereby disabling date_popup fixes it as well: #604854: Date Popup causing multiple problems

#6

Eric Schaefer - October 15, 2009 - 05:38

I don't think its a problem on date_popups side. Multistep must be doing something weird with all form elements that are not shown in the current step. I don't know what it is, but scheduler doesn't like it.

#7

BWPanda - October 15, 2009 - 05:43

From what I understand, Multistep simply sets #access to FALSE if the field(group) doesn't belong on the current step...

#8

Eric Schaefer - October 16, 2009 - 18:00

I figured it out. date_popup transforms the two fields into one field during validation so that scheduler only sees the on publish_on/unpublish_on value instead of separate date and time values. When multistep is used and the scheduler field group is not part of the first step, there has not been any validation and therefore no transformation into a single value. Instead of a string publish_on contains an associative array with two empty values names 'date' and 'time'.

The only thing I can do about that, is implementing some Multistep specific validation code. This would be pretty easy but I don't like the idea of having code specific to a module scheduler is not using, but only to circumvent some problem that actually results from the combination of the three modules (scheduler, multistep and date_popup). As said, the change would be easy but I'd rather keep the code clean.

Do you have any sugestions how to deal with this?
I will ask this question in the dev mailing list. There are people smarter then me...

#9

BWPanda - October 16, 2009 - 22:41

Two possibilities:

1 - Write some generic code (like an API function) that other modules like Multistep can implement to fix the issue (since it seems like their not handling the validation properly)...
2 - Write a patch to fix the issue for those of us experiencing the problem, but don't commit it (link to it from the project page or something), until a better solution is found.

Glad you worked it out!

#10

Eric Schaefer - October 18, 2009 - 10:55

I will just check if the value is an array instead of a string and let the validation pass if nobody on the devel mailing list comes up with a better solution. I don't like that but that seems to be the easiest way. The only alternative would be to have Date Popup not use the same field names for its virtual widget. But I posted an easy patch for another problem to Date Popup weeks ago and that hasn't even be considered for inclusion, because there are almost 400 open issues for the date module. Also would that change be much more difficult than the change to scheduler.

 
 

Drupal is a registered trademark of Dries Buytaert.