The tab title for the /register page is "Register as rolename". I changed the name of the role after creating the profile, but the text on the tab still shows the original role name.

Where can I update this?

Comments

ailgm’s picture

Category: support » bug

I found it in the Title field of a row in the menu_router table, and fixed it directly in the database.

It would be better if this were updated automatically, but this provided a workaround.

ailgm’s picture

When the menu was rebuilt, the title reverted to the original role name.

I'm now trying changing it in two places:

  1. the title field of the menu_router table
  2. the link_title field of the menu_links table
ailgm’s picture

I also found that if I cloned a profile, the text was set to "Register as " (with no role name).

ailgm’s picture

I think I've finally traced it back to the misc field of the profile2_regpath table. That seems to be used when menus are rebuilt, so it's not good enough to change it only in the menu_router and menu_links tables.

To fix the value there, change both the text and set the revised length of the text (in the S:nn prior to the text value).

grasmash’s picture

Category: bug » feature

There's no need to modify the db directly. You can change the value stored in p2rp's misc column via the UI. Navigate to /admin/structure/profiles/manage/[profile_type], ensure that 'tabs' is selected, and change the field labeled 'tab text.'

An improvement to this would be the use of a @profile-name token in this field. Changing to a feature request.

BrightBold’s picture

I agree with @grasmash's suggestion that there should be a better way to do this.

I had a profile type that formerly had the machine name "main" and was later changed to "parent." I didn't have "Tabs" selected because I want separate environments. However, even with that selected, I still see the tabs for "Log in," "Register as " and "Request new password" (just not "Create a new account" which appears if I switch the setting to tabs.) So I was stumped as to how to get it to stop saying "Register as main" even after I had changed the machine name, since there was no visible setting in the UI that overrode that. Like @ailgm, the only thing I could figure out was to change it in the database.

Logically to me, this should have changed when I changed the machine name. And the tab text field should be visible whether you have "tabs" or "separate environments" selected since the text seems to show either way.

BrightBold’s picture

Also note that I don't recommend changing this through the database — I have been getting the following error: Notice: unserialize(): Error at offset 88 of 330 bytes in profile2_regpath_form_profile2_type_form_alter() (line 141 of /code/sites/all/modules/contrib/profile2_regpath/profile2_regpath.module). I was suspicious that the error was my fault for messing with the database (since I can't find it reported anywhere) and I may have fixed it by switching all my profiles to "tabs," resaving, and then switching back to "separate environments," but I'm not confident that fixed it. (Or that it caused it, but I post it here as a warning to others!)

GotYourGuy’s picture

@BrightBold - grasmash wasn't saying there should be a better way, he was telling you the better way to do it :-P

Just go through the UI at /admin/structure/profiles/manage/[profile2:machine-name] and hit the bullet for Registration Page Type: Tabs (Even if you don't want to use Tabs) change the Tab Text to whatever you want. If you want to use tabs save as is, if you don't switch it back to "Separate Environments" and it will save the new tab text anyway.

BrightBold’s picture

@GotYourGuy — I think what I meant was that I agreed with grasmash's final point that the name should be tokenized so that if you changed the machine name the tab name would automatically update unless you'd overridden it.

My additional suggestion for improvement would be that the tab text field should be visible whether you have chosen Tabs or Separate Environments, since the text seems to be visible in either case. I wouldn't have resorted to modifying the database if I'd been able to see that field on the settings page. (Or if I'd seen grasmash's post before I did that, but sadly I found this issue afterwards.)

GotYourGuy’s picture

@BrightBold - I like that idea, The tokens would be a nice feature and I agree that the tab text should be visible on both pages since it affects them both.

I reiterated my steps because it took me a while to realize this exact issue (That the hidden option affects both pages) and thought a little clarification might help other noobs like me.