*  Notice: Undefined index: user_readonly in user_readonly_form_alter() (line 254 of /www/www-staging/drupal.sandbox.sanger.ac.uk/htdocs/sites/all/modules/contrib/user_readonly/user_readonly.module).
    * Notice: Undefined index: user_readonly in user_readonly_form_alter() (line 254 of /www/www-staging/drupal.sandbox.sanger.ac.uk/htdocs/sites/all/modules/contrib/user_readonly/user_readonly.module).
    * Notice: Undefined index: user_readonly in user_readonly_form_alter() (line 254 of /www/www-staging/drupal.sandbox.sanger.ac.uk/htdocs/sites/all/modules/contrib/user_readonly/user_readonly.module).
    * Notice: Undefined index: user_readonly in user_readonly_form_alter() (line 254 of /www/www-staging/drupal.sandbox.sanger.ac.uk/htdocs/sites/all/modules/contrib/user_readonly/user_readonly.module).
    * Notice: Undefined index: user_readonly in user_readonly_form_alter() (line 254 of /www/www-staging/drupal.sandbox.sanger.ac.uk/htdocs/sites/all/modules/contrib/user_readonly/user_readonly.module).
    * Notice: Undefined index: user_readonly in user_readonly_form_alter() (line 254 of /www/www-staging/drupal.sandbox.sanger.ac.uk/htdocs/sites/all/modules/contrib/user_readonly/user_readonly.module).
    * Notice: Undefined index: user_readonly in user_readonly_form_alter() (line 254 of /www/www-staging/drupal.sandbox.sanger.ac.uk/htdocs/sites/all/modules/contrib/user_readonly/user_readonly.module).
    * Notice: Undefined index: user_readonly in user_readonly_form_alter() (line 254 of /www/www-staging/drupal.sandbox.sanger.ac.uk/htdocs/sites/all/modules/contrib/user_readonly/user_readonly.module).
    * Notice: Undefined index: user_readonly in user_readonly_form_alter() (line 254 of /www/www-staging/drupal.sandbox.sanger.ac.uk/htdocs/sites/all/modules/contrib/user_readonly/user_readonly.module).
    * Notice: Undefined index: user_readonly in user_readonly_form_alter() (line 254 of /www/www-staging/drupal.sandbox.sanger.ac.uk/htdocs/sites/all/modules/contrib/user_readonly/user_readonly.module).
    * Notice: Undefined index: user_readonly in user_readonly_form_alter() (line 254 of /www/www-staging/drupal.sandbox.sanger.ac.uk/htdocs/sites/all/modules/contrib/user_readonly/user_readonly.module).
    * Notice: Undefined index: user_readonly in user_readonly_form_alter() (line 254 of /www/www-staging/drupal.sandbox.sanger.ac.uk/htdocs/sites/all/modules/contrib/user_readonly/user_readonly.module).
    * Notice: Undefined index: user_readonly in user_readonly_form_alter() (line 254 of /www/www-staging/drupal.sandbox.sanger.ac.uk/htdocs/sites/all/modules/contrib/user_readonly/user_readonly.module).
    * Notice: Undefined index: user_readonly in user_readonly_form_alter() (line 254 of /www/www-staging/drupal.sandbox.sanger.ac.uk/htdocs/sites/all/modules/contrib/user_readonly/user_readonly.module).

Comments

stephenrobinson’s picture

saving the settings again from within Drupal 7 seems to get rid of these errors....

stephenrobinson’s picture

Now upon saving in D7, non of the profile fields are readonly any more....

stephenrobinson’s picture

actually the user upload and user email fields are readonly, all the profile fields are no longer readonly after saving in D7

stephenrobinson’s picture

actually all my profile fields are not on the config form, which is why their settings dissappeared, although they were hidden or readonly before I resaved in D7?

stephenrobinson’s picture

Oh so you have given up

  // The profile module is depr. in Drupal 7. See http://drupal.org/node/874026
  //if (module_exists('profile')) {
  //  $result = db_query('SELECT name, title FROM {profile_fields} ORDER BY category, weight, title');
  //  foreach ($result as $obj) {
  //    $fields[$obj->name] = $obj->title;
  //  }
  //}

Guess it is time to trash this module???

deekayen’s picture

You can do whatever you want with the module. The most productive thing of all the possibilities would probably be to contribute a patch to fix the issues you're experiencing or pay a programmer to care right now. Otherwise, you can be patient and wait for someone to donate their free time to fix it.

creynders’s picture

@deekayen fully understandable, but could you maybe mark the module as being incompatible with D7? At least until this is fixed?

stephenrobinson’s picture

actually I have now migrated my profile fields into the user object, so it works fine for me know. I added new fields to the user and saved in a feature and ran a script like this:

/**
 * Migrate profile fields to user field api fields.
 */
function startupseven_update_7023() {
  $query = db_select('users', 'u');
  $query->leftJoin('profile_value', 'pv', 'u.uid = pv.uid');
  $query->leftJoin('profile_field', 'pf', 'pf.fid = pv.fid');
  $query->addField('u', 'uid');
  $query->addField('u', 'status');
  $query->addField('pf', 'name');
  $query->addField('pv', 'value');
  $query->condition('pf.name', 'profile_expertise','!='); 
  $query->condition('u.status', 1,'=');  
  $query->isNotNull('pv.value');
  $results = $query->execute();
  foreach ($results as $result) {
    $tablename='';
    switch($result->name){
      case 'profile_employer':
        $tablename='field_profile_employer';
      break;
      case 'profile_role':
        $tablename='field_profile_role';
      break;
      case 'profile_about':
        $tablename='field_profile_about';
      break;
      case 'profile_faculty':
        $tablename='field_profile_faculty';
      break;
      case 'profile_room':
        $tablename='field_profile_room';
      break;
      case 'profile_phone':
        $tablename='field_profile_phone';
      break;
      case 'profile_last_name':
        $tablename='field_profile_last_name';
      break;
      case 'profile_first_name':
        $tablename='field_profile_first_name';
      break;
      case 'profile_terms_and_conditions':
        $tablename='field_profile_terms_and_cond';
      break;
      case 'profile_department_number':
        $tablename='field_profile_department_number';
      break;
      case 'profile_employee_number':
        $tablename='field_profile_employee_number';
      break;
      case 'profile_manager':
        $tablename='field_profile_manager';
      break;
      case 'profile_email_alias':
        $tablename='field_profile_email_alias';
      break;
      case 'profile_known_as':
        $tablename='field_profile_known_as';
      break;
    }
    if($tablename!=''){
        if( ($tablename=='field_profile_faculty') || ($tablename=='field_profile_manager') || ($tablename=='field_profile_terms_and_cond') ){
          if($result->value!=1){
            $result = db_insert('field_data_'.$tablename) 
            ->fields(
              array(
                'entity_type' => (string)'user',
                'bundle' => (string)'user',
                'deleted' => (int)0,
                'entity_id' => (int)$result->uid,
                'revision_id' => NULL,
                'language' => (string)'und',
                'delta' => (int)0,
                $tablename.'_value' => (int)0, 
              )
            )
            ->execute(); 
          }
          else{
            $result = db_insert('field_data_'.$tablename) 
            ->fields(
              array(
                'entity_type' => (string)'user',
                'bundle' => (string)'user',
                'deleted' => (int)0,
                'entity_id' => (int)$result->uid,
                'revision_id' => NULL,
                'language' => (string)'und',
                'delta' => (int)0,
                $tablename.'_value' => (int)1, 
              )
            )
            ->execute(); 
          }
        }
        else{
          $result = db_insert('field_data_'.$tablename) 
          ->fields(
            array(
              'entity_type' => (string)'user',
              'bundle' => (string)'user',
              'deleted' => (int)0,
              'entity_id' => (int)$result->uid,
              'revision_id' => NULL,
              'language' => (string)'und',
              'delta' => (int)0,
              $tablename.'_value' => (string)$result->value,
            )
          )
          ->execute();
        }
    }
  }
  module_disable(array('profile'), TRUE);
  if(db_table_exists('profile_field')) { 
    db_drop_table('profile_field');
  }
  if(db_table_exists('profile_value')) { 
    db_drop_table('profile_value');
  }
  watchdog('startupseven', 'update_7023 - Migrated profile fields to user field api fields.');
  return 'update_7023 - Migrated profile fields to user field api fields.';
}
stephenrobinson’s picture

also you could use the field permissions in D7 core?

deekayen’s picture

Status: Active » Closed (duplicate)