Hi Simon,

Any plans to update to 5.0?

Thanks,

Jim

Comments

sym’s picture

Assigned: Unassigned » sym
Status: Active » Postponed

I 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

lias’s picture

Nodeprofile.module has been updated to 5. : )
Lsabug

maureen’s picture

Thank 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.

sym’s picture

I 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 :)

grendzy’s picture

Thanks for looking into it...

kaushik_sarkar@drupal.org’s picture

Title: Register profile update to 5.0? » The Time Line of Register profile update to 5.0?
Component: Code » Miscellaneous
Assigned: sym » kaushik_sarkar@drupal.org
Priority: Normal » Critical
Status: Postponed » Postponed (maintainer needs more info)

I need to know The Time Line of Register profile update to 5.0, Because it is very urgent to me.

sym’s picture

Title: The Time Line of Register profile update to 5.0? » Update to 5.0
Component: Miscellaneous » Code
Assigned: kaushik_sarkar@drupal.org » sym
Priority: Critical » Normal
Status: Postponed (maintainer needs more info) » Active

Ok, 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.

kaushik_sarkar@drupal.org’s picture

I 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

lunas’s picture

I 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.

sym’s picture

node_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 :)

kaushik_sarkar@drupal.org’s picture

Thanks 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.

sym’s picture

yes, it's something to do with the type name I think. I will post my code when I am at my computer later on.

Operations-1’s picture

this 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 :)

Will White’s picture

StatusFileSize
new1.59 KB

Here's a patch. The form renders with the proper title for the fieldset. The .info file will follow below.

Please test this! Thanks.

Will White’s picture

StatusFileSize
new157 bytes

Here is the .info file. Remember to remove the .txt extension.

kaushik_sarkar@drupal.org’s picture

Title: Update to 5.0 » Does not show profile value in editing mode when user wants to edit his profile
Priority: Normal » Critical

Thanks 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.

Operations-1’s picture

it 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

Will White’s picture

The 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!

sym’s picture

Priority: Critical » Normal
Status: Active » Needs work

I 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.

sym’s picture

Title: Does not show profile value in editing mode when user wants to edit his profile » Update to 5.0
Will White’s picture

The nodes appear to be saving the values correctly. I appreciate the testing!

abramo’s picture

thanks for proceeding with this : much appreciated : look forward to the update.

best,
abramo

sym’s picture

Assigned: kaushik_sarkar@drupal.org » sym
Status: Needs work » Needs review
StatusFileSize
new2.73 KB

Right! 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!

sym’s picture

You can use the .info file from #15 with this.

abramo’s picture

great : many thanks : testing tomorrow - shall revert soonest :)

abramo’s picture

reporting : 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

darren oh’s picture

Assigned: sym » darren oh
Status: Needs review » Needs work
jockox3@drupal.org’s picture

Thanks 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.

jockox3@drupal.org’s picture

More 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.

Styles’s picture

I seem to have the same problem, none of the userprofile feilds are being saved... hmmmm
other then that...all works well

Styles’s picture

From 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

somebodysysop’s picture

I 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?

Styles’s picture

That 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?

somebodysysop’s picture

I 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!

Styles’s picture

Well, 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

Styles’s picture

This 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.

abramo’s picture

@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.

drupal_devloper’s picture

Title: Update to 5.0 » Update to 5.0 - both patch are 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

abramo’s picture

Title: Update to 5.0 - both patch are not working » Update to 5.0
drupal_devloper’s picture

again 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

sym’s picture

Ok, 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

Styles’s picture

1- 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.

sym’s picture

Thank 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

Styles’s picture

Yes, i think your ready for DEV version with a *Build CCK forms after instalation* or something similar

pulpzebra’s picture

I'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

unset['log'];
unset['author'];
unset['options'];

at line 57 of patched code.

If you believe this has some sense, could you please provide a first release of 5.x version?

pulpzebra’s picture

about 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.

pulpzebra’s picture

Got 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

 unset($form_data['log']);
        unset($form_data['author']);
        unset($form_data['options']);
        unset($form_data['path']);
        unset($form_data['menu']);
        unset($form_data['submit']);
        unset($form_data['preview']);
        unset($form_data['title']);
        unset($form_data['uid']);

and from line 78

if(is_nodeprofile($field['type'])) {
            //build the node object and save it.
            //Is there a better way to set the status and body?
            $node = (object)$field;
            $node->uid = $account->uid;
            $node->title = $account->name;
            if (module_exists('pathauto'))
            {             
                $placeholders = node_get_placeholders($node);
                $src = "node/$node->nid";
                $alias = pathauto_create_alias('node', $op, $placeholders, $src, $node->type);
                $node->alias = $alias;
            }
            
            $node->status = $node->options['status'];
            $node->body = $node->body_filter['body'];
            $finalnode = node_submit($node);
            node_save($finalnode);
          }

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.

pulpzebra’s picture

Although 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?

mixey’s picture

Hi 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

pulpzebra’s picture

new version of nodeprofile integrates registerprofile functionality. Please discard registerprofile and registerprofile patches since they're no longer needed.

darren oh’s picture

Status: Needs work » Closed (won't fix)
mlncn’s picture

Status: Closed (won't fix) » Needs review

Uh, 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?

darren oh’s picture

Status: Needs review » Closed (won't fix)

This module is obsolete. See #50.

mlncn’s picture

Read through the whole thread and missed that. Thanks.

mlncn’s picture

Project: » Lost & found issues

This issue’s project has disappeared. Most likely, it was a sandbox project, which can be deleted by its maintainer. See the Lost & found issues project page for more details. (The missing project ID was 100975)