The profile has the following settings:
a:9:{s:9:"path_type";s:8:"separate";s:8:"tab_text";s:19:"Register as teacher";s:13:"fieldset_wrap";i:1;s:13:"custom_titles";i:1;s:11:"login_title";s:13:"Teacher Login";s:14:"register_title";s:16:"Teacher Register";s:14:"password_title";s:16:"Teacher Password";s:20:"confirmation_display";i:0;s:20:"confirmation_message";s:0:"";}
See screen grab.

Any ideas?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

RobKoberg’s picture

Title: Profile2 fields not showing on registration form » Incorrect path parsing in profile2_regpath_form_alter

I see the problem now. Something must have changed recently where the code now relies on parsing the the path from the docroot incorrectly. For example, I have a path to my docroot in dev like: http://localhost/~rkoberg/mash-tmp/docroot/, and one of my profile type's registration page is http://localhost/~rkoberg/mash-tmp/docroot/teacher/register

In profile2_regpath_form_alter, the following code incorrectly determines the profile name:

      // Grab first part of URL.
      $path_parts = explode('/', $path);
      $path_key = reset($path_parts);

In my case, the $path_key will be ~rkoberg.

To fix it, the following code could be used to get the path from the document root:

      // Get profile2 profile types from current path.
      $url = drupal_parse_url($form['#action']);
      //$path = ltrim($url['path'], '/');
      $base_path = base_path();
      $path = $url['path'];
      $pos = strpos($path, $base_path);
      $path = substr($path, $pos + strlen($base_path));
RobKoberg’s picture

Version: 7.x-2.0-beta3 » 7.x-2.x-dev
FileSize
693 bytes

Here is a patch against dev.