Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The current code in profile2_regpath_form_alter() for determining the path does not work if the site is in a subdirectory. The code can be simplified from
// Get profile2 profile types from current path.
$url = drupal_parse_url($form['#action']);
$path = ltrim($url['path'], '/');
// Check to see if this is an alias. If so, use source path.
if ($source = drupal_lookup_path('source', $path)) {
$path = $source;
}
to
$path = current_path();
which will fix the problem.
Comments
Comment #2
kostask CreditAttribution: kostask at Point Blank commentedYou are right nevets. The same problem is also discussed in https://www.drupal.org/node/2541374 and there is a patch there, so I am marking this post as duplicate.