Hi there,

I wanted to have some fields from the content profile node on the main user edit form. I started with content_profile_register and made the neccessary changes.

Needs some testign but seems to be working fine. Please include this under /modules.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

killes@www.drop.org’s picture

THis is possibly a duplicate of #586464: integration with user/#/edit

fago’s picture

hm, I must say I'm no fan of doing so, because I think drupal needs a better user account <-> profile separation and this is the opposite. Also I've no interest in maintaining more such "likely to break sometimes" code, so if you want to have it a proper module, best make a separate project for it .

update: Or we could add it as extension module to content_profile and I grant you CVS access for maintaining it, if you prefer. :)

fago’s picture

roball’s picture

Any progress with this issue?

+1 for an option to integrate the user profile on the user account edit page.

AdrianB’s picture

+1 from me as well.

fago: Afaik the account_profile module does the opposite of what most of us wants: to have one single user edit page with account information and content profile fields.

aroq’s picture

good module, but there is a bug on line #108:

node = content_profile_load($type, $form['#uid'], $language->language);

its not loading content node if node language is not set.

maria_zk’s picture

thanks aroq. my 2 cents to make this work (as a really tmp solution):
change
$node = content_profile_load($type, $form['#uid'], $language->language);
to
$node = content_profile_load($type, $form['#uid'], 'en');
(for english)

A couple of things i noticed:
1.
"Use on administrative user creation form
Use this content type when an administrative user creates a new user"
Should be checked for User Registration otherwise fields are not displayed. Is this another bug??

and 2.
If the "administer users" permission is not checked for auth. users, then when trying to save the changes, this message is displayed:
"Detected malicious attempt to alter protected user fields."
Any ideas??

Thanks!!

aroq’s picture

2. for the error message:

line #132:

// Add more values @see node_form
foreach (array('nid', 'vid', 'uid', 'created', 'type', 'language') as $key) {
$form_add[$key] = $node_form[$key];
}

there should be no "uid" here, as user_profile_form validator (user.pages.inc) checks the existence of "uid " in $form array and returns error if it is there. Unset it - and it will be working.

YK85’s picture

Hello,

It would be awesome to be able to select which content profile fields to show on the user/edit page. For example, ALL fields or just the firstname lastname fields etc.

Thank you for your hard work and I look forward to helping with testing if needed.

kristinellu’s picture

Category: feature » task
FileSize
2.35 KB

Hi,

This module just saved my day.
I'm attaching a patch that fixes the issues regarding node language and "Detected malicious attempt to alter protected user fields." warning. I hope it helps.

kristinellu’s picture

It was a problem with the upload, I'll re-post the patch.

maria_zk’s picture

kristinellu your patch solved all the errors i was receiving. Sweet :)
Thank you so much, i confirm it works!
Kudos!

YK85’s picture

Hello,
Should this be marked as duplicate and moved over to #586464: integration with user/#/edit as that post started in Sept09? Are there major differences in the module here and the one at http://drupal.org/node/586464#comment-2819320 ?
Thanks!

rabihs’s picture

Why can't I access the fields if I'm not logged in as admin?
Shouldn't each user see the fields on the user edit page?

YK85’s picture

I was wondering if there has been any further development here?
I think this is what I need for my site.

chintan4u’s picture

Hi,
Thanks for this module. Saved a lot of work. However, I'am facing 1 issue.
I have 1 content type as content profile and have distributed the fields into multiple tabs (using cck_fieldgroup_tabs).
On Edit, the tabs and fields are appearing correctly, however Save button is visible only on the first tab. As a result, I'am unable to edit the fields on the remaining tabs.
Also, on Content Profile creation, the Save button is visible on all tabs.

Pls provide some help.

jordan8037310’s picture

I had very significant issues with using this module because the language wouldn't save while I had multiple languages enabled on the site.

In order to fix it I used the validation edit that ZoeN made here for the content_profile_edit module as he has similar issues: http://drupal.org/node/586464#comment-2818272

You put the below code into the content_profile_useredit_user_edit_validate function right before it ends.

<?php
// Make sure the language setting saves.
  if ($form_state['clicked_button']['#post']['language']) {
    $form_state['values']['language'] = $form_state['clicked_button']['#post']['language'];
  }
?>

Just wanted to copy it over here in case anyone else experiences the same thing.

If you put it above the following, it doesn't work:

<?php
// Remove our added values
  foreach ($form['#content_profile_weights'] as $key => $weight) {
    _content_profile_useredit_remove_values($key, $form[$key], $form_state);
  }
?>

This may point to the source of our issue as to why the Language isn't being saved, but I don't really have the time to look into this further.

Chers, JR