Download & Extend

date and file field values are silently deleted in steps where the field is not active

Project:Multistep
Version:7.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:postponed
Issue tags:date, FileField

Issue Summary

I have form with 3 steps, first step contain date field. When the first step is submitted the value of the field is stored properly but when the next step is submitted the value is cleared.

UPDATE:
the bug is not in this module.

as of file fields, this is a drupal core issue.
in #1205822: File(s) silently deleted when #access=false i have contributed a core patch
it needs some tests to get accepted but can be used right now.

as of date fields: this is a date module issue.
in #1144074: does not play well with multistep / does not validate correctly when #access=false i have contributed a patch which needs to be reworked (look which parts are already in HEAD and roll a new patch with the rest)
maybe someone can help out there or provide funding.

Comments

#1

This also happens with boolean fields.

#2

Status:active» postponed (maintainer needs more info)

does this still happen with current dev?

#3

I also have this problem with latest dev version. Also have the same problem with image field using filefield_paths

#4

Title:multistep clear date field value» date and file field values are silently deleted in steps where the field is not active
Issue tags:+FileField

as of date fields: this is a date module issue.
in #1144074: does not play well with multistep / does not validate correctly when #access=false i have contributed a patch which needs to be reworked.
maybe someone can help out there or provide funding.

as of file fields, this is a drupal core issue.
in #1205822: File(s) silently deleted when #access=false i have contributed a core patch which i hope gets accepted.
you might help and test this patch and set status to "reviewed..." there!

using both patches i'm running a production site with file, image and date fields.
hope this helps ya!

#5

I have this problem with image file fields.

Step 1: Title
Step 2: Image

I can upload the image & click "save" - no problem.
Now, if I edit the nod and start at Step 1, and go Next > to Step 2: now the image file is missing. It's gone.

#6

@morningtime: as image uses file.module this should be solved by the core patch mentioned in #4
did you try this?

#7

Aha, hadn't seen that. I believe it solved my problem.

#8

@morningtime: so you might want to confirm this at #1205822: File(s) silently deleted when #access=false so to seed up this going core!

#9

I needed a quick solution until this issue is solved. A quick workaround for this is to use hook_form_alter and unset the fields that aren't present on the step that you're currently on.

<?php
function MYMODULE_form_alter(&$form, $form_state, $form_id) {
    switch (
$form_id) {
        case
'content_type_node_form': //Substitute your content type form here

           
if($form['#multistep']['current'] != 'group_background') {
                unset(
$form['field_date1']);
            }

            if(
$form['#multistep']['current'] != 'group_a_review') {
                unset(
$form['field_date2']);
                unset(
$form['field_date3']);
            }

    }

}
?>

#10

Status:postponed (maintainer needs more info)» active

Axel: Can you try to repatch in the date module? Karens closed your issue due to no more information.

#11

Status:active» postponed

sorry, don't have time for this right now, but added an explicit issue update.