I have a site that has many 'extra' fields (the fields that appear greyed-out and that you can't edit). Unfortunately, you can't add these extra fields to groups, and therefore can't specify which steps they appear in.

This module already accounted for this with the Taxonomy fields by providing an option in the content type settings, however, this doesn't account for other fields such as Title, Body, Comments, etc.

This patch accounts for these (and indeed, all) extra fields, letting you specify which step each field should appear in in the content type settings (screenshot attached).

The only problem I encounted was that some third-part modules (such as the Print module) don't have any values in the $form array at the time this module is run, which means that you can't specify $form[THIRD_PARTY MODULE]['#access'] = FALSE;... I think all that this needs to work however is for this module to run later than other modules (something to do with the weight value in the database I believe).

The only other thing this module doesn't account for is the 'Authoring information' and 'Publishing options' fields, but I believe this is currently being looked into: #530848: Revisions and Published state

So, take it for a spin and let me know what you think. I'd love to see this, or something similar, committed!

CommentFileSizeAuthor
#8 multistep-548114.patch5.89 KBvkareh
#5 multistep-548114.patch4.97 KBvkareh
#4 multistep-548114-weight.patch1.44 KBvkareh
#3 multistep-548114-3.patch3.01 KBAnonymous (not verified)
#2 multistep.patch2.83 KBAnonymous (not verified)
extra_fields_settings.png35.27 KBAnonymous (not verified)
multistep-extra-fields.patch2.81 KBAnonymous (not verified)

Comments

Anonymous’s picture

I can confirm that changing the weight of the Multistep module in the System table of the database to something like '10' allows other modules to edit the $form array before Multistep accesses it and therefore works for modules like 'Print'.
Just need someone to submit a patch to change the weight in the database (I'm not sure how to do this)...

Anonymous’s picture

StatusFileSize
new2.83 KB

Updated patch to fix conflict with multistep_menu variable name...

Anonymous’s picture

StatusFileSize
new3.01 KB

Fixed an issue when creating a new content type.
Patch now checks to make sure $type exists.

vkareh’s picture

StatusFileSize
new1.44 KB

BWPanda: Thanks for all the work you've done lately. I've been away on vacation and only now I'm trying to catch up to these issues.

The patch works perfectly. I, too, can confirm that setting the module weight to 10 works (see attached patch).

I have one concern, however: the title field should always be on the first step, at the creation of the node. If not, the node could be created without a title. A possible workaround would be to verify whether the user has the auto_nodetitle module enabled for that content type and only then allow the title to be in a different step.

At the bare minimum, the user should be warned about setting the title field to a step other than one. I don't know if there's any actual danger with leaving the title empty. Let me know your thoughts.

vkareh’s picture

StatusFileSize
new4.97 KB

My bad, there is an error in the patch for the module weight. I attached a new revision of the patch.

This patch combines multistep.install and multistep.module with several fixes to both. I removed $form['title']['#type'] = 'hidden'; and $form['body_field']['#access'] = FALSE; now that BWPanda's patch takes care of that problem.

Please test it and let me know.

Anonymous’s picture

I've been using auto_nodetitle's for the content types where Multistep is enabled, and while I do get an error/warning after the first step (which I'm only assuming is related to not having all required title fields entered), it seems to work fine after that...

I do agree that at the very least a warning should be displayed to users regarding this.

vkareh’s picture

What kind of error/warning are you getting after the first step? Is it related to multistep or to auto_nodetitle?

I just tested with auto_nodetitle and it works very well. I also tested placing the title field in different steps with or without different configurations of auto_nodetitle and the result so far is that it works and doesn't yield any error. Still, I find it proper to add the warning, even if it's just as a #description in the drop-down for selecting the step of the title.

vkareh’s picture

StatusFileSize
new5.89 KB

Okay, I figured that a title-less node can screw up a few things, such as making nodes unclickable and potentially screwing up Pathauto and node references. I'm going back with my first feeling that the title shouldn't be changed unless you have auto_nodetitle configured for that content type.

I'll provide the users with the option to select whether they want to have the title in all steps or in the first only, with a message saying that if they need it to be in a different step, to enable auto_nodetitle.

Anonymous’s picture

What kind of error/warning are you getting after the first step? Is it related to multistep or to auto_nodetitle?

Neither it seems... The errors are:
* user warning: Duplicate entry '517-0-domain_id' for key 1 query: INSERT INTO domain_access (nid, gid, realm) VALUES (517, 0, 'domain_id') in /home/brat/public_html/sites/all/modules/domain/domain.module on line 1314.
* user warning: Duplicate entry '517-0-domain_id' for key 1 query: INSERT INTO node_access (nid, realm, gid, grant_view, grant_update, grant_delete) VALUES (517, 'domain_id', 0, 1, 1, 1) in /home/brat/public_html/modules/node/node.module on line 2249.

Anonymous’s picture

Are there still problems with having the title on later steps if the node remains un-published until the last step (#530848: Revisions and Published state)?

vkareh’s picture

I would say yes, since Pathauto creates the path as soon as the node is created, regardless of its published status.

Even if few people have the need to browse through unpublished nodes, they won't actually be clickable, making them hard to find, edit, reference and even publish afterwards.

I'll leave the code so that you can only change the step of the title field if you are using auto_nodetitle on that content type. You can, however, still decide whether you want to show the title field in all steps or just the first one.

vkareh’s picture

Status: Needs review » Fixed

I merged the patch into the new development snapshot. Please test it and let me know how it works for you.

Status: Fixed » Closed (fixed)

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