There is a problem with the separate registration page setting, when running a site in a folder different than the web server's root folder: The path is falsely parsed, and the profile fields do not get attached.

As an example, consider a site running at localhost/contract_a/site_1 (contract_a/site_1 subfolder of localhost's root folder)

On function profile2_regpath_form_alter of profile2_regpath.module, @ line 169 else-block:

$url['path'] gives /contract_a/site_1/profile_name/register

and then with the following lines:

$path_parts = explode('/', $path); 
$path_key = reset($path_parts);

so path_key is not equal to profile_name, as it should be, but equals first subfolder of www base folder, where the site is installed, which in my case is "contract_a". As a result, the $path_key is not valid, so the fields do not get attached on the form.

Enabling $base_url variable into settings.php does not help.

I propose a solution, please see the attached patch.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

efpapado’s picture

efpapado’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 1: false_path_parsing-2541374.patch, failed testing.

efpapado’s picture

Status: Needs work » Needs review
FileSize
1.06 KB

Another try with a better logic, and a better PHP syntax.

efpapado’s picture

Issue summary: View changes
efpapado’s picture

Issue summary: View changes
attisan’s picture

kostask’s picture

Here is a patch that tries to address the problems mentioned by efpapado and attisan