Closed (fixed)
Project:
Profile2 Registration Path
Version:
7.x-2.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
17 Apr 2014 at 13:26 UTC
Updated:
1 Apr 2019 at 17:33 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
rollingnet commentedI can confirm this bug.
We are developing a multilingual site (en/it) and if we look at registration form without language prefix, everything is ok
http://dev.siuro.it/socio/register
but if we use language prefix path, the profile fields disappear
http://dev.siuro.it/en/socio/register
Comment #2
rollingnet commentedI think this is a serious issue for this module, since many sites are multi language.
I'm not so expert to correct this issue by myself, could someone fix it?
Comment #3
rollingnet commentedI don't know using Git, so I publish the patch here
in profile2_regpath.module, after line #178 of 7.2.x-dev, insert this code
Comment #4
rodrigoaguilerahere is the patch (it was line 178 against 2.x-dev)
Comment #5
rollingnet commentedComment #6
c4antonio commentedperfect, you resolve my worst nightmare of the last 48 hours, thank you :D
Comment #7
rollingnet commentedComment #8
rodrigoaguileraTo be ported to...?
If you think the patch is ok you should use Reviewed &... (RTBC)
Comment #9
nevergone#4 patch tested and works well!
Comment #10
markus_petrux commentedComment #11
markus_petrux commentedBTW, the patch is also needed for (and applies with just an offset to) 7.x-1.x-dev.
Comment #12
markus_petrux commentedComment #13
grasmash commentedYou need to first check that
$form['locale']is set, given that some sites may not have the locale module enabled.Comment #14
grasmash commentedComment #15
tim_djnow with check for form['locale']
Comment #16
Stolkmachine commentedConsider this:
$form['locale']['language']['#default_value'] = "en-US".
Now consider the prefix would be: "en". The code will fail in this scenario.
I would suggest a few things:
1) check if core module locale is enabled
2) use global language object prefix
Comment #17
tim_djComment #20
dzy commentedComment #21
shi99 commentedI think the patch above will only work for profiles that are set as a Separate environment
On the edit Profile admin page there is the option for setting the "Registration page type".
The options are : Tabs and Separate environments which generate different paths
Tabs:
www.example.com/en/user/[PROFILE_TYPE]/register
Separate environments:
www.example.com/en/[PROFILE_TYPE]/register
So Separate environments will return "[PROFILE_TYPE]" but Tabs will return "user".
Instead of starting from the start of the path, would it be better to get the second last item from the path?
end($path_parts);
$path_key = prev($path_parts);
I have created a patch that works for me.
Thanks
Comment #23
alex.bukach commented7.x-2.0-beta4 has a fix for the issue very similar to the proposed in #21:
Comment #25
alex.bukach commentedActually I was wrong, the issue persists in 7.x-2.x. However the proposed solution #21 does not work for me when using an alias. Here's an updated patch. Please change the issue status to Needs review.