Needs work
Project:
Profiler
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Sep 2010 at 20:37 UTC
Updated:
13 Feb 2012 at 23:43 UTC
Since some of the core nodeapi functions (eg, path_nodeapi()), call user_access, things like this:
nodes[foo][path] = foo
aren't working. This patch fakes $user->uid = 1 prior to calling node_save(). Not sure if this should be more general, or performed at a higher level, but it works for the example above.
| Comment | File | Size | Author |
|---|---|---|---|
| profiler.user_access.patch | 840 bytes | jhedstrom |
Comments
Comment #1
q0rban commentedI'm concerned about other implications of this. Are you using this patch with success?
Comment #2
jhedstromI've used this on several projects without any obvious ill-effect.
It seems like the proper way to do this, is to determine when in the installation process Drupal is setting uid = 1 (since upon completion, the user is logged in as uid 1), and then perform these tasks after that--if possible.
Comment #3
jhedstromChanging back to needs review--just ran into this issue again on a 6.x project.
Comment #4
q0rban commentedThis still terrifies me. :) We should at least clean up after ourselves by setting the $user object back the way it was.