Closed (won't fix)
Project:
Lost & found issues
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
20 Jan 2007 at 16:30 UTC
Updated:
3 Oct 2007 at 12:31 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
sym commentedI cannot update until nodeprofile is updated.
If you want to have register profile on drupal 5, I'm sure fago wouldn't mind a patch or some help here: http://drupal.org/node/106154
Comment #2
lias commentedNodeprofile.module has been updated to 5. : )
Lsabug
Comment #3
maureen commentedThank you so much for this module. It's exactly what I desperately need.... for 5.1.
Any update on when that that might happen?
Thanks again.
Comment #4
sym commentedI have a half working version, but there are problems with saving the nodes. I'm away for the next week, so it will be after that. I'll try to get to it ASAP :)
Comment #5
grendzy commentedThanks for looking into it...
Comment #6
kaushik_sarkar@drupal.org commentedI need to know The Time Line of Register profile update to 5.0, Because it is very urgent to me.
Comment #7
sym commentedOk, I understand - I've been in the same position with many other modules in the past. I have a lot on at the moment (including moving house) and I'm sure you'll understand that I need to focus on paid work first. Having said that, I will do my best to look at it this weekend or next week - so with some luck it will be updated by this time next week.
Comment #8
kaushik_sarkar@drupal.org commentedI will be very grateful to you if u tell me some thing about register profile, 90 % of registerprofile 4.7 is perfectly working on Drupal 5.1, but it cannot rendered the form field on registration page, I have created form field with CCK and through Access Control, I assign rprivileges for different role on this CCK field. I have worked on rolesignup module. But on registration page nothing will be displayed but in drupal 4.7 registerprofile is working very good. I need to know how will I change the appropriate section for rendering the form on registration page in drupal 5.1.
function registerprofile_user($op, &$edit, &$account, $category = NULL) {
switch ($op) {
case 'register':
$types = node_get_types();
foreach ($types as $type => $type_name) {
if (is_nodeprofile($type))
{
$node = NULL;
if (!$_SESSION['role'])
{
$role = 1;
}
else
{
$role = $_SESSION['role'];
}
$query = db_query("SELECT perm FROM {permission} WHERE rid=%s", $role);
$result = db_fetch_object($query);
if (strpos($result->perm, "view ".$type." on register form")) {
(object)$node->type = $type;
$node->type_name = $type_name;
$profile_types[] = $node;
}
}
}
foreach ($profile_types as $node) {
$form_data = node_form_array($node);
/* I have to call each hook_form_alter by 'hand' because node_form_array doesn't include any changes made by form_alter */
$form_id = $form_data['#id'];
foreach (module_implements('form_alter') as $module) {
$function = $module .'_form_alter';
$function($form_id, $form_data);
}
/*put the whole node form in to a fieldset and set tree to true for future use by node_save*/
$form[$node->type] = array
(
'#type' => 'fieldset',
'#title' => $node->type_name,
'#collapsible' => FALSE,
'#collapsed' => FALSE,
'#tree' => TRUE,
);
/* get rid of the submit and other stuff here. I could add per-field permissions here as well */
unset($form_data['submit']);
unset($form_data['preview']);
unset($form_data['title']);
unset($form_data['uid']);
/* make the form array*/
foreach ($form_data as $name => $field)
{
$form[$node->type][$name] = $field;
}
}
return $form;
case 'insert':
foreach ($edit as $field) {
if (is_nodeprofile($field['type']))
{
if (is_array($field))
{
$node = (object)$field;
$node->uid = $account->uid;
$node->title = $account->name . "'s profile";
$finalnode = node_submit($node);
node_save($finalnode);
}
}
}
}
}
Thanks in Advance
Comment #9
lunas commentedI took a stab at it, as I need this module as well. Unfortunately I haven't made it past node_form_array tripping an undefined function error. Not sure what it was replaced with. Anyways, looking anxiously forward to the update, and if anyone can shed some light on node_form_array, maybe I can hack my way through the rest of it with the pathetic php skills I do have.
Comment #10
sym commentednode_form_array is now node_form (IIRC)
I have got past that stage, but there are some problems with saving the correct form (I think it's to do with the new node->content array, not sure).
I need to spend a few hours playing with it, I will try my best to do this in the next 3 days! Please send any patches though :)
Comment #11
kaushik_sarkar@drupal.org commentedThanks for prompt help.
I changed the node_form_array to node_array but still no form rendered in registration form.
function registerprofile_user($op, &$edit, &$account, $category = NULL) {
switch ($op) {
case 'register':
$types = node_get_types();
foreach ($types as $type => $type_name) {
if (is_nodeprofile($type))
{
$node = NULL;
if (!$_SESSION['role'])
{
$role = 1;
}
else
{
$role = $_SESSION['role'];
}
$query = db_query("SELECT perm FROM {permission} WHERE rid=%s", $role);
$result = db_fetch_object($query);
if (strpos($result->perm, "view ".$type." on register form")) {
(object)$node->type = $type;
$node->type_name = $type_name;
$profile_types[] = $node;
}
}
}
foreach ($profile_types as $node) {
$form_data = node_form($node);
/* I have to call each hook_form_alter by 'hand' because node_form_array doesn't include any changes made by form_alter */
$form_id = $form_data['#id'];
foreach (module_implements('form_alter') as $module) {
$function = $module .'_form_alter';
$function($form_id, $form_data);
}
/*put the whole node form in to a fieldset and set tree to true for future use by node_save*/
$form[$node->type] = array
(
'#type' => 'fieldset',
'#title' => $node->type_name,
'#collapsible' => FALSE,
'#collapsed' => FALSE,
'#tree' => TRUE,
);
/* get rid of the submit and other stuff here. I could add per-field permissions here as well */
unset($form_data['submit']);
unset($form_data['preview']);
unset($form_data['title']);
unset($form_data['uid']);
/* make the form array*/
foreach ($form_data as $name => $field)
{
$form[$node->type][$name] = $field;
}
}
return $form;
case 'insert':
foreach ($edit as $field) {
if (is_nodeprofile($field['type']))
{
if (is_array($field))
{
$node = (object)$field;
$node->uid = $account->uid;
$node->title = $account->name . "'s profile";
$finalnode = node_submit($node);
node_save($finalnode);
}
}
}
}
}
If I have any mistake please forgive me. I am just learning Drupal.
Thanx in advance.
Comment #12
sym commentedyes, it's something to do with the type name I think. I will post my code when I am at my computer later on.
Comment #13
Operations-1 commentedthis module is awesome... that is the ONLY thing i need to put my whole project online... does anybody have an ETA? 2 days? a week? a month? anything... it is a pretty small module... if i knew something about php i could help, but in php metters im useless :)
Comment #14
Will White commentedHere's a patch. The form renders with the proper title for the fieldset. The .info file will follow below.
Please test this! Thanks.
Comment #15
Will White commentedHere is the .info file. Remember to remove the .txt extension.
Comment #16
kaushik_sarkar@drupal.org commentedThanks for update, form will be rendered according to user role. But when a user wants to edit his profile value. The Value has been entered by user during registration procees does not display in editing mode.
When we using profile.module to create user profile field, it will display in editing mode in user My Account.
Please tell me how to overcome this problem.
Comment #17
Operations-1 commentedit seems that this patch is not working... granted permission for anonymous user in a form and does not show any form... i get an "invalid argument supplied on foreach()"...
This foreach: "foreach ($profile_types as $node) {"
also, in the patch shows:
foreach ($profile_types as $node) {
- $form_data = node_form_array($node);
+ $form_data = node_form($node);
$form_id = $form_data['type']['#value'] . '_node_form';
also, in the last version of the registerprofile the line: "$form_id = $form_data['type']['#value'] . '_node_form';" does not exists... the line is: "$form_id = $form_data['#id'];"... i tried both ways altering this line and not altering this line...
is the patch broken?
thanks
Comment #18
Will White commentedThe patch is based on the CVS HEAD version. Patching will probably fail unless you're using that version.
I'm trying to reproduce these problems. If you can provide any more details about the configuration of your content items I would appreciate it. Thanks!
Comment #19
sym commentedI think the problem in #17 is just the module not being set up right. Please make sure you get nodeprofile set up with at least 1 content type set up as a profile.
diggersf, thanks a lot for the patch. You've got as far as I have - are you sure that the nodes are saved correctly? I did the same and none of the content was saved.
I will try to check this out really soon.
Comment #20
sym commentedComment #21
Will White commentedThe nodes appear to be saving the values correctly. I appreciate the testing!
Comment #22
abramo commentedthanks for proceeding with this : much appreciated : look forward to the update.
best,
abramo
Comment #23
sym commentedRight! At last I managed to look in to it!
A few points:
1) The node array that gets submitted is different from the array that node_save expects - I have no idea why this is, and I guess I am missing something (or maybe using node_form to build the form is wrong). As a result of this, I have had to manually create $node->body and $node->status. This isn't very nice, but it works for now.
2) If there are other modules that add to the $node object, I'm not sure if they will work - this needs testing!
Comment #24
sym commentedYou can use the .info file from #15 with this.
Comment #25
abramo commentedgreat : many thanks : testing tomorrow - shall revert soonest :)
Comment #26
abramo commentedreporting : when patching :
Hunk #6 failed at 33.
Hunk #11 failed at 71.
2 out of 12 hunks failed.
so patch aborted.
can you please see to this?
thanks,
abramo
Comment #27
darren ohComment #28
jockox3@drupal.org commentedThanks for the work so far on this but...
I followed the steps through to applying the patch and creating the .info file and the module appears to work. I have an existing content type which is set as the node profile type and in my access control settings was able to select that to appear on the registration page. Fine.
I got the form on the registration page and completed it and it created a user and usernode and site-member type node.
Now, if I go to the user node and use the devel load tab to have a look, it's certainly saved - I can see all the data I entered in the usernode array.
But if I go to the content type and try and edit it, the fields are not populated with the existing data. Again, if I use devel load I can see the data there stored in the user table ut it's not used, apparently to populate the fields.
So folks who know inestimably more than I...
Is this working, do you think, from my description, how you would expect it to work.
In other words I suppose I'm asking what I need to do next to make this flow nicely...if a user registers their account and then goes to the "my account" page I'd want them to be able to edit the node profile data. If anone's familiar with CiviCRM, I'd expect it to appear something like the profile fields can be made to appear on the user page using a CiviCRM registration profile.
Comment #29
jockox3@drupal.org commentedMore info...
Am I correct in assuming that the data produced by the registration form should be stored in a table called "content_type_site_member" where "site_member" is the content type of my node profile?
Cos it's not being stored there. That table is empty.
Comment #30
Styles commentedI seem to have the same problem, none of the userprofile feilds are being saved... hmmmm
other then that...all works well
Comment #31
Styles commentedFrom what i've gathered, all the data is saved in the "data" field of the "users" table istead of the apropreate feilds of the "content_type_(userprofile)" field
Comment #32
somebodysysop commentedI installed RegisterProfile and applied 5.0 patch and it appears to work in my case. However, when I installed rolesignup http://drupal.org/project/rolesignup, registerprofile stopped working -- that is, the user profile form no longer would appear on the new user signup/registration screen. Any suggestions?
Comment #33
Styles commentedThat is strange, i have role signup installed and the form fields do appear...they dont save in the proper table....but they do appear.
Have you been to access Control and added the proper roles for signup?
and did you use the HEAD version to patch?
Comment #34
somebodysysop commentedI used the head version that was available what, about a week ago.
At any rate, it sounds like I should just wait until there is a 5.x version of the module. Particularly since the patched version still doesn't save to the correct able. That will make it a little easier to troubleshoot.
Thanks!
Comment #35
Styles commentedWell, I have some good news...and some bad news.
I've setup a new drupal 5.1 site and installed all the modules related to register profile module
RegisterProfile
nodeprofile
nodefamily
usernode
cck
cck field permissions
rolesignup
And all works very well... and saves to the right table/fields
SO, with this i conclude that there are possibly two reasons for the table saving problem
1- possible conflict with another module, not related to these modules
2- order in which these modules are activated (installed)
Or i'm WAYYYY off track
Comment #36
Styles commentedThis is my last follow up on this subject
Although i didnt find the reason for the problem, i've solved by ignoring my original cck form
and creating new ones.
AND ALL WORKS GREAT
the only difference between the new forms and the original ones is that the cck feilds are not part of groups.
Comment #37
abramo commented@Styles : many thanks for the follow up : till this is resolved fully by the maintainer, your step by step experience and how you proceeded will be very useful to the rest of us.
Comment #38
drupal_devloper commentedneed for clean and clear patch, so it will be easily applicable.
provide the Update to 5.0 patch which is easily applicable
Comment #39
abramo commentedComment #40
drupal_devloper commentedagain configured all mentioned module. but still it is not working.
need for clean and clear patch, so it will be easily applicable.
provide the Update to 5.0 patch which is easily applicable
Comment #41
sym commentedOk, first off, thanks everyone for testing.
I am still not clear on a few things:
1) Can the patch be applied? I have just tested appling on the lastest HEAD revision and it applied fine.
2) Once applied, does the module work?
Please try to be as clear as you can on these two thing, and if it doesn't apply or work, please provide a full description of what the problem was. Also, I think some field types might not save. If you find data ddoesn't save, please state what type of CCK field didn't save.
Thanks
Comment #42
Styles commented1- Yes, the patch CAN be applied, and ONLY to the HEAD version
2- It works, but i cant testify to the fact that it has no bugs, It seems that CCK forms created before applying the patch dont save the fields in the right table... but that the CCK Forms created after applying the patch do work fine.
Has I mentioned in another post, i've avoided creating field "groups" on the new CCK Forms.
So that needs to be tested
S.
Comment #43
sym commentedThank Styles.
I will test it, but I can't see how the time of creation for the CCK forms can change anything.
Do you think I should commit the 5 branch now, in the hopes that more people test out the more advanced forms?
Thanks
Comment #44
Styles commentedYes, i think your ready for DEV version with a *Build CCK forms after instalation* or something similar
Comment #45
pulpzebra commentedI've installed the patch on a 5.1 Drupal installation, followed the guide lines and can confirm that registerprofile do works.
However I got this issue (using pathauto.module)
warning: urldecode() expects parameter 1 to be string, array given in /home/httpd/web_pages/drupalhosting/modules/path/path.module on line 142. It looks like node_save doesn't deal with path or pathauto correctly.
Another issue is that in the nodeprofile fieldset rendered inside the user form there are all the collapsed (and NOT ACTIVE) field sets for Comments, author, menu etc...
I added the following lines to the module
at line 57 of patched code.
If you believe this has some sense, could you please provide a first release of 5.x version?
Comment #46
pulpzebra commentedabout the warning issue (see my previous post), it has for sure something to do with module pathauto. Permission to create node alias were extended to anonymous user. However, the URL path settings of the node was empty right after its creation.
Comment #47
pulpzebra commentedGot registerprofile working with pathauto. It looks like the registerprofile node submit procedure doesn't really comply with drupal core 5, but as this patch seems like the only way to port registerprofile to version 5.x, I had to find a workaround that looks like this:
from line 57 of the patched module I added
and from line 78
OK, THIS IS NOT THE CORRECT WAY, since IMO the pathauto_node hook should already do this on any node if the node_submit proceduere were correctly implemented. Wait for code redesign to meet Drupal Core consistency.
Comment #48
pulpzebra commentedAlthough the patch works, it has to crash against certain CCK properties, since it issues me a Cannot use scalar as Array in content.module line 588.
I believe that this has something to do with the odd node submission routine. Could someone take a look at it?
Comment #49
mixey commentedHi guys,
Could anyone please post here registerprofile.module file already patched correctly and ready for using with drupal 5.x ?
I tried to patch 4.7 dev with two patches that are posted in this thread, but I'm getting error while patching :(
I really need this to make working,
Any help is really appreciated
Comment #50
pulpzebra commentednew version of nodeprofile integrates registerprofile functionality. Please discard registerprofile and registerprofile patches since they're no longer needed.
Comment #51
darren ohComment #52
mlncn commentedUh, what's with the "won't fix" ?
Isn't this thread about code that could be committed as a dev or alpha version for 5?
Comment #53
darren ohThis module is obsolete. See #50.
Comment #54
mlncn commentedRead through the whole thread and missed that. Thanks.
Comment #55
mlncn commentedhttp://drupal.org/project/nodeprofile