0

Once solved this issue: How to define settings from an install profile

I would like to skip the Error Message I get on first load of the application:

Message d'erreur
Les permissions d'accès au contenu doivent être reconstruites. Reconstruire les permissions.

To do so, I've created a task to perform the function node_access_rebuild(FALSE);

function genius_install_tasks(&$install_state) {
  $tasks['genius_settings'] = array(
      'display' => FALSE,
      'type' => 'batch',
      'run' => INSTALL_TASK_RUN_IF_NOT_COMPLETED,
  );

  $tasks['link_taxonomy_menu'] = array(
      'display' => FALSE,
      'type' => 'batch',
      'run' => INSTALL_TASK_RUN_IF_NOT_COMPLETED,
  );

  $tasks['rebuild_permissions'] = array(
      'display' => FALSE,
      'type' => 'batch',
      'run' => INSTALL_TASK_RUN_IF_NOT_COMPLETED,
  );

  return $tasks;

}

But it seems to don't be enough.In fact, I set a message that I can't see, so I think this task maybe is not being perform.

function rebuild_permissions() {
    // Rebuild permissions
    node_access_rebuild(FALSE);
    // This message is set at the end of the node_access_rebuild
    // Keep here to ensure this task has been made
    drupal_set_message(t('Content permissions have been rebuilt.'));

}

I am going to try to change the type of the task to normal. EDIT: This change doesn't solve the problem

Mindwhile, appreciate reader, do you have any advice to do the rebuild permissions at the end of the installation correctly?

Thanks for the reading.

1 Answer 1

0

Finally it seems as it is done from the hook_install.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.