Closed (outdated)
Project:
Provision
Version:
6.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Nov 2010 at 10:44 UTC
Updated:
26 Feb 2016 at 14:28 UTC
Jump to comment: Most recent
When i'm creating a node through node_save() i can't set a path because of the limitation of path_nodeapi() (http://api.drupal.org/api/drupal/modules--path--path.module/function/pat...). In this function there is a user_access() call and the user running the installation profile is user 0, that imply that the user_access() check fails and the path attribute can't be set.
The bigger question is why the user running the installation profile isn't defined as user 1.
Here is a snippet to run if you want to reproduce the issue:
// Create page presentation
$node = array(
'title' => t('Presentation'),
'body' => t('Full description of the presentation node'),
'nid' => NULL,
'type' => 'page',
'teaser' => NULL,
'log' => '',
'created' => '',
'format' => FILTER_FORMAT_DEFAULT,
'path' => 'presentation',
'uid' => 1,
);
$node = (object) $node;
node_save($node);
Thanks!
Comments
Comment #1
steven jones commentedIs this a general support question about install profiles? Or is this a specific problem when using Aegir to install your site using the install profile?
Comment #2
artusamakI know it's true for Aegir for sure, but it can also apply as a general question. ;)
Comment #3
steven jones commentedLooking at the code, it would seem that Drupal logs user 1 in before the profile gets to run its tasks, but in provision it seems that we run the tasks, and then create the user, never logging them in.
This probably needs confirming properly, and then fixing?
Comment #4
artusamakFor sure the user in the Aegir installation context is 0.
Comment #5
steven jones commentedYeah, going to say this is a major AegirWTF, we should see if we can leverage Drush site-install, and if not, at least re-jig our stuff so that things are done in the same order as Drupal core.
Comment #6
helmo commentedThe 6.x-2.x branch will go EOL along with Drupal this week. So I'm closing
this issue. If it remains a confirmed issue in 7.x-3.x, feel free to re-open,
or better yet, create a new issue referencing this one.