Following investigation into #1068428: Notice: Undefined property: stdClass::$type in multistep_get_steps() (line 509, and trying to get Multistep to work with Profile2, it appears Multistep can't handle any entity other than nodes. (A holdover from the D6 version?) I've started to patch this up... basically multistep_get_steps, is_multistep, etc all need to take an $entity_type argument that is then passed to field_group_info_groups. The logic in multistep_get_steps for if (!isset($multistep)) has to change to be non-node specific; I wonder why that can't just be removed and the if (!isset($multistep[$type])) logic wouldn't be sufficient.
Unfortunately I can't spend more time on this today, but hopefully that can get someone started on fixing.

Comments

vkareh’s picture

I have been thinking about that for a while now... making Multistep entity-based, rather than node-based. I haven't had time lately to tackle these issues, but next week, at DrupalCon, I usually get a lot of inspiration during code sprints. I would love to get other people involved in this as well.

thebuckst0p’s picture

I'll be there and would like to help if I can. Ping me on twitter (thebuckst0p) or email in Chicago.

sol roth’s picture

I would love to use this on the regular account fields or on profile2. Subscribing.

mortona2k’s picture

I have a module that modifies profile 2, I'll try to hack code from this module into that to make it multi step. Not sure what it takes to go from that to patching Multistep.

kingjohnnet’s picture

subscribe

tbenice’s picture

sub

dmadruga’s picture

Sub

dmadruga’s picture

@thebuckst0p
@vkareh

I'm willing to pay for this fix. Would you guys be interested in this?

@all
Someone else interested in sponsoring this fix?

tbenice’s picture

Strapped for cash at the moment, but would like to help with patching if I can. Sorry!

thebuckst0p’s picture

@dmadruga I don't have any spare cycles now, sorry.

geek-merlin’s picture

Priority: Critical » Major
Issue tags: +multistep-d7review

although no showstopper, this seems very sensible and important for quite some use cases.
will see if i can spare some time.

paulgemini’s picture

subscribing

gianfrasoft’s picture

subscribing

dreamingX’s picture

subscribing

liliplanet’s picture

subscribe thx!

Taxoman’s picture

Title: Needs to handle entities other than nodes » Multistep should handle entities other than nodes
Category: bug » feature

This must be a feature request.
The last "subscribers": have you noticed the green "Follow" button at the top-right corner? :-)
(which is now "gray", saying "Following", since you have actually posted in this thread, but initially it is green, and that is the new way of "subscribing" to issues)

ydnar79’s picture

This was started back in March.... So has there been any progress on updating the module to use entities instead of nodes only?

wiherek’s picture

Multistep is based on Field group, but that module now supports a new group type - multipages. Which work with Profile2.

klucid’s picture

Since the original issue was to work with Profile2, I just wanted to chime in and say using multipages as stated above worked great for me.

clemens.tolboom’s picture

The combination of Profile2 plus field_group only works on a single profile type right?

@wiherek and @klucid : are you suggesting using multistep + profile2 makes the user register page capable to step through all profile types (listed on admin/structure/profiles)? Or are you suggesting multistep is _not_ needed?

8bitplateau’s picture

This module offers many advantages over FieldGroup's new native multi-page functionality.

I am creating a user profiling site and am using FieldGroup's multi-page but would jump to this if it worked.
A status update would be great ?

I can see that it adds the multistep as feildgroup formatter option in the UI but when chosen, it does not create a step nav block or render any multistep pages in the user edit form.

just to reiterate, we are talking about user accounts - not nodes.
The move to entities does mean that this is in reach though.

tobiberlin’s picture

Issue summary: View changes

Are there any updates aput that? In my eyes the advantage of this module prior to multipages is that with every step the node is saved. Multipages is just a little JavaScript deviding the whole form in separate steps but click on "next" does not any saving.

bgilhome’s picture

StatusFileSize
new29.65 KB

I've had a go at this and it seems to be working OK. Changed all instances of nid/node to id/entity and added entity type as an additional argument to relevant functions.

One more major change is I'm using hook_form_alter instead of hook_field_attach_form to add the multistep form elements/actions. This is because I wanted to get access to the entity form #submit key to get the entity form's submit callback (I didn't know any other way to get it from entity type / bundle - any ideas?) and couldn't access the parent entity form from the hook_field_attach_form $form (field subform). So I've added a hook_form_alter which checks if keys #entity_type, #bundle and #entity are set - is this enough to test that it's an entity form? The form alter then calls what used to be the hook_field_attach_form function.

bgilhome’s picture

Status: Active » Needs review
generalconsensus’s picture

StatusFileSize
new4.88 KB

I created this quick patch to get the user profile form to work, the above patch didn't enable this

generalconsensus’s picture

StatusFileSize
new4.71 KB

Fix to namespace

generalconsensus’s picture

rees’s picture

Thanks for the patch @generalconsensus but I am getting some errors while patching.

module.patch:8: trailing whitespace.

module.patch:9: trailing whitespace.
/**
module.patch:10: trailing whitespace.
* Implements hook_form_FORM_ID_alter().
module.patch:11: trailing whitespace.
*/
module.patch:12: trailing whitespace.
function multistep_form_user_prof

generalconsensus’s picture

I couldn't remove that patch from the post, i have another patch I'm working on that fixes a ton of the issues I originally missed. Sorry for the poor explanation

generalconsensus’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev

Be advised that I've created a 7.x-2.x-dev branch which solves this problem and adds additional features. Please review and let me know if this fixes it for you

  • generalconsensus committed f08b65d on 7.x-2.x
    Fresh implementation taking into considering user profiles, navigation...