I can't seem to get the weight of the content profile to be handled on the registration form. Always floats above the included information from the PROFILE itself no matter what I specify.

In other words, I create a profile, specify it's content be on the registration fom. Create content for Content Profile use, specify it be used on registration.

The Content Profile part is always above the content from the Profile.

Is there a fix for this (other than theming).

-Daniel

Comments

nadavoid’s picture

I am seeing the same thing. My custom profile fields are showing up above the regular username & email fields, in the user registration form. Please post something here if you find a solution.

nadavoid’s picture

I have found a workaround for this. If you have a fieldgroup, you will have to go into the database and manually set its weight. This worked for me.

More specifically, in my case, I have a Student Profile content type, and in it I have a group that contains all fields of the content type. I search in my database, the table content_group, column group_name, for the value 'group_personal'. The weight in my case was originally -3. Changing it to 1 moved it below the username and email fields for me, but you may have to try different values to see what positions it properly for you.

I'm wondering if an interface needs to be exposed for managing these weights. It seems to me that the user registration module would be the one to handle that. I'm not sure if it should be changing the weight field of the content_group table. It might have unexpected consequences in how CCK orders its fields and groups, like if a user goes back to managing fields in cck and rearranges fields. So, should we add another weight field somewhere?

I guess the basic request here is that we need a way to manage the order in which the different profile groups appear on the user registration page. This would include content types defined by CCK, profiles defined by the core profile module, and the default username & email fields.

Any thoughts on how this should be handled?

kenorb’s picture

Status: Active » Closed (duplicate)
andreiashu’s picture

Category: support » bug
Status: Closed (duplicate) » Postponed (maintainer needs more info)

@kenorb this is not a duplicate for #315354. read again both reports and you will see that this one is different than #315354
In my opinion this is a bug. So i marked it accordingly.

andreiashu’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new1.07 KB

In the edit fields page ('admin/content/node-type/content_type/fields') if you disable javascript you can see that the title field gets a weight of -5 by default, 'Menu settings' -4, body -3, and the 'File attachments' field is -2. When you add your custom field to your content type, it will get by default the weight -1. Here is the problem: when you go to the registration form, all the default fields don't have 'weight' specified (so they get 0 weight by default) but our custom field has: -1.
I attached an ugly workaround that works (at least it does for me).

andreiashu’s picture

I forgot about groups.
I know that this patch is not at all oki, but i hope that someone will step in and help about this issue. At least (I think) we isolated the bug.

fago’s picture

yep, currently just the weights of the form elements inside a node form are taken. Perhaps we could improve this buy multiplying the content profile content type weight * 10 and adding it to each weight of a form element... Or better we could add a theme function for the user registration form and just render the node forms in the right order manually.

fago’s picture

Status: Needs review » Needs work
andreiashu’s picture

redijedi’s picture

subscribing

doublejosh’s picture

Listening.

AmitV-2’s picture

subcribing

geraldito’s picture

for testing purposes you can manually edit the weight of every cck content profile field by running this function in Firebug Console (
thanks to kenorb for this hint):

$('#edit-weight')[0].type = 'input'

Leonth’s picture

Subscribing.

EDIT: a possible ugly hack to just set

$form['name']['#weight'] = -100;
$form['mail']['#weight'] = -99;

for user_register form.

Aldus’s picture

subscribing, it's very important for advanced profile creation

yurg’s picture

Inspired by #14 (though all thread was helpful!), I've found quick workaround:

1. Add template for user/register form

This goes to template.php, i've used marinelli theme, so marinelli_theme need to be replaced by your theme name

function marinelli_theme($existing, $type, $theme, $path) {
  return array(
    // tell Drupal what template to use for the user register form
    'user_register' => array(
      'arguments' => array('form' => NULL),
      'template' => 'user-register', // this is the name of the template
    ),
  );
}

2. Creating user-register.tpl.php file and put followed code inside:

<?php
$form['name']['#weight'] = 98;
$form['mail']['#weight'] = 99;
$form['submit']['#weight'] = 100;
print drupal_render($form); 
?>

3. Clear theme registry\cache

Here is working "demo":
http://artsfestivals.co.uk/user/register

Thank you all for inspiration!

kenorb’s picture

Issue summary: View changes
Status: Needs work » Closed (outdated)

Drupal 6 is no longer officially supported. If you think this issue is still relevant for 8.x, feel free to re-open.