Closed (fixed)
Project:
Pageroute
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Sep 2007 at 05:44 UTC
Updated:
26 Oct 2007 at 09:31 UTC
Not sure whose bug this is.
I author a module called CCK Taxonomy Super Select Ultra and it works fine for me with regular custom CCK content types. However, when trying to use a custom content type, with one of these CCK fields in it, along with pageroutes (setup as nodeprofile page), no values are saved upon submission.
Any ideas where I should look for a solution? Oh, by the way, this is when editing from user/7/edit/reg_form_4 where reg_form_4 is my content type and 7 is the UID.
Also, submitting takes me to user/7 instead of back to user/7/edit. Is that standard behavior? Any way I can change that?
Thanks.
Comments
Comment #1
rconstantine commentedI've learned a little more about this.
It would seem that the cck hook_widget is not firing for the submit case, which of course explains why nothing is saved.
Any ideas why hook_widget isn't firing from the pageroute version of the content type?
Comment #2
rconstantine commentedMight not having a body have anything to do with it? I wouldn't think so.
Comment #3
rconstantine commentedNevermind about the lack of a body being a possibility. Doesn't look like that is it. Not sure what made me think so. Silly.
Comment #4
rconstantine commentedPerhaps subform elements is the problem? I'm having trouble following all of the interactions.
Comment #5
rconstantine commentedOne more clue: CCK's own content_nodeapi function is not firing for the submit case. The 'prepare' and 'validate' cases fire, but that's it. Is one of your module intercepting this? At present, I don't have a debugger that will allow me to step through functions and see what is coming after the validation call and preventing the submit call.
Help!!!
Comment #6
rconstantine commentedIt seems the same problem exists for the cck phone field; it is unable to save the data though it validates and gets through the widget function's 'process form values' stage. The widget function's 'submit' stage is never firing.
I have two phone fields on the nodeprofile page, but not as 'multiple' values of one field.
Comment #7
rconstantine commentedIf I didn't mention this elsewhere, the saving problem only occurs when editing the node directly, outside of the pageroute.
An example URL would be:
user/7/edit/139 -- BROKEN
somepageroute/139/7 -- WORKS
Comment #8
fagohm, I'm a bit confused.
First off, yes the subform element module is responsible for inserting the node form in pageroute, as well as for nodeprofile. nodeapi hook submit is fired for the subform too, as it's invoked through the formapi submit handler of node forms (see http://api.drupal.org/api/function/node_form_submit/5).
So first off, please make clear whats working and what not.
Are you using pageroute OR nodeprofiles user categories integration? Which modules don't work with that integration, that work with an usual node form?
If you are using modules, that access $_POST data directly, this might lead to troubles.
Comment #9
rconstantine commentedsome related comments: http://drupal.org/node/181887
As mentioned on the other issue, this is for my module which allows multiple membership types, each with its own pageroute. Each pageroute can have both unique pages and pages shared with other routes. For this reason, I was unable to use your nodeprofile integration in the user edit area of the user account as all nodeprofiles get listed, not just those of the pageroute that belongs to the user's membership type.
So instead, I basically copied your functions into my module and modified them. But since the links to the nodes are the same, and I'm not doing anything on nodes themselves, I figured that the problem would be universal - i.e. whether one used my module or not, but tried to edit the node directly outside of a pageroute, the content wouldn't save. But perhaps that's not the case.
As mentioned above, I first thought it was only a problem with one field not saving, but that's because I was working on a node type that only had one field. I later thought that newly filled in fields weren't being saved, but changing content or deleting it from fields also would not save.
So perhaps I didn't implement my tabs the same way you did and there is something wrong in them alone. Originally, my tabs on the user edit page looked like this:
You can see that this finds out the user's membership type, the associated pageroute, the pages that go with that pageroute, and then creates a menu tab for each which links directly to the nodes. I don't recall what your module does for its tabs on the user edit page. I would imagine that I tried to copy yours and only change the lookup of the pages.
My new menu items look like this:
Essentially, since linking to the nodes directly wasn't allowing the nodes to be edited (note comment #5 above - my module fires after, so mine shouldn't be getting in the way), I got rid of the page links in favor of a single link to the pageroute and another one as a default link to user's main edit page [for some reason, simply adding the user/arg(1)/edit/pageroute menu item wouldn't get the default "account settings" tab to show up]. The other issue I cited as a link above is how users get out of the pageroute and back to their user account's edit page.
SO - although I have this all working now, it is very inelegant. I am wondering if you might be interested in working together toward tighter integration of our respective modules and in solving some of the issues I've had lately. I think multiple user membership types is a valuable feature to have and pageroutes are a good way of collecting varied information from members of each type. Perhaps if you looked at my module's code, you'd have some novel insights that both your modules and mine could benefit from.
Comment #10
fagoSo if I got it right, the problem appears with your code? So I set this issue to fixed.
In future, please only file bug reports if you are sure there is a bug in pageroute's code, not in a modified variant.. :)
I appreciate your contribution, every contribution is valuable, however I have not the time to go through code details with you. So let's focus on discussing HOW things are built.
First off, please forgive if I had asked already, why aren't you building your membership types as roles? What is the difference in contrast to roles? Perhaps you should make this a bit clearer, as this is an important point for all people using your modules.
Different user roles, can already have different profiles - just adjust node access permissions. So far so fine, but you are right there is no register integration for pageroutes. For this I'm using workflow-ng. Together with the latest nodeprofile you can check for an existing profile and redirect the user to the pageroute, until he has finished his profile. You can configure it, to check only on user login, which doesn't urge the user to fill out the profile or as alternative you can configure it also to check it for each page load - for this case, don't forget to exclude the pageroute's path or you'll get in an endless redirect loop ;)
If you want to urge your users to go step by step through the pageroute activate workflow-ng's states module and check the appearing route option "Verify that a user goes through each page of the route." This state can also be checked with workflow-ng.
If pageroute's API doesn't allow you some things you need to do, perhaps discuss the issue with me. Of course I'm open for clean improvements, that e.g. make pageroute's API more powerful.
Comment #11
fagosry, the correct link is http://drupal.org/project/workflow_ng
Comment #12
(not verified) commented