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.
| Comment | File | Size | Author |
|---|---|---|---|
| #23 | multistep-entity_support-1078992-23.patch | 29.65 KB | bgilhome |
Comments
Comment #1
vkareh commentedI 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.
Comment #2
thebuckst0p commentedI'll be there and would like to help if I can. Ping me on twitter (thebuckst0p) or email in Chicago.
Comment #3
sol roth commentedI would love to use this on the regular account fields or on profile2. Subscribing.
Comment #4
mortona2k commentedI 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.
Comment #5
kingjohnnet commentedsubscribe
Comment #6
tbenice commentedsub
Comment #7
dmadruga commentedSub
Comment #8
dmadruga commented@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?
Comment #9
tbenice commentedStrapped for cash at the moment, but would like to help with patching if I can. Sorry!
Comment #10
thebuckst0p commented@dmadruga I don't have any spare cycles now, sorry.
Comment #11
geek-merlinalthough no showstopper, this seems very sensible and important for quite some use cases.
will see if i can spare some time.
Comment #12
paulgemini commentedsubscribing
Comment #13
gianfrasoft commentedsubscribing
Comment #14
dreamingX commentedsubscribing
Comment #15
liliplanet commentedsubscribe thx!
Comment #16
Taxoman commentedThis 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)
Comment #17
ydnar79 commentedThis was started back in March.... So has there been any progress on updating the module to use entities instead of nodes only?
Comment #18
wiherek commentedMultistep is based on Field group, but that module now supports a new group type - multipages. Which work with Profile2.
Comment #19
klucid commentedSince 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.
Comment #20
clemens.tolboomThe 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?
Comment #21
8bitplateau commentedThis 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.
Comment #22
tobiberlinAre 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.
Comment #23
bgilhome commentedI'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.
Comment #24
bgilhome commentedComment #25
generalconsensus commentedI created this quick patch to get the user profile form to work, the above patch didn't enable this
Comment #26
generalconsensus commentedFix to namespace
Comment #27
generalconsensus commentedComment #28
rees commentedThanks for the patch @generalconsensus but I am getting some errors while patching.
Comment #29
generalconsensus commentedI 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
Comment #30
generalconsensus commentedBe 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