Right after installing open atrium, I get a big red message saying that "The content access permissions need to be rebuilt.". Instead of showing this to the user as the first thing they see, the installer should just rebuild the permissions.

Comments

hefox’s picture

(I wish whatever sets that variable would check if any nodes actually exist)

Anyhow sounds reasonable to just call http://api.drupal.org/api/drupal/modules!node!node.module/function/node_... as a post install task (not totally sure which hook off top of head).. in non batch mode, cause it's unlikely to be so many nodes that needs to be batched and not sure batching would work correctly for drush site-install and simpletest, thought it may.

mpotter’s picture

Status: Active » Fixed

Added node_access_rebuild to the oa_core install task. Committed to 8b6d140.

pancho’s picture

Version: 7.x-2.0-alpha2 » 7.x-2.0-alpha3
Assigned: Unassigned » pancho
Category: feature » task
Priority: Normal » Major
Status: Fixed » Needs work

Fatal error: Call to undefined function node_access_rebuild() in /openatrium-7.x-git/modules/features/oa_core/oa_core.profile.inc on line 19

In the 'install_load_profile' task, node_access_rebuild() is being called way too early: there's not yet a full bootstrap and the contrib modules are not yet installed.
IMHO, we should call it as late as possible in the 'install_finished' task, so contrib and apps and whatever else can create nodes, before the node access permissions are rebuilt.

@hefox in #1:

(I wish whatever sets that variable would check if any nodes actually exist)

Yeah, I thought about that, too. But even if there's no node at all, a catchall node access rule is being created, so the permissions need to be rebuilt anyway. Node access is one of the oldest subsystems in current Drupal going back to 2004, and we'd need to rewrite the whole subsystem in order to change that. Might still be doable for D8, if there's someone taking care of.

MatheoDJ’s picture

MatheoDJ’s picture

Assigned: pancho » Unassigned
Category: task » bug
Priority: Major » Critical

7.x-2.0-alpha3, the attempted fix prevents installation after selecting language, I always get:

Fatal error: Call to undefined function node_access_rebuild() in .../profiles/openatrium/modules/features/oa_core/oa_core.profile.inc on line 19

I edited the file to comment this out:

  // prevent notice after install to rebuild permissions
  node_access_rebuild();

becomes:

  // prevent notice after install to rebuild permissions
  // node_access_rebuild();

and now it works again...

MatheoDJ’s picture

MatheoDJ’s picture

Priority: Critical » Normal
Status: Needs work » Fixed
pancho’s picture

Version: 7.x-2.0-alpha3 » 7.x-2.0-alpha2
Category: bug » task

Ok, taking care of the followup in #1986398: Fatal error: Call to undefined function node_access_rebuild().
Setting back to original version and being a task.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.