I use "domain" as my purl processor for the sites module. When I create a node for a sites-site (hereafter named subsite), I can only view it on the main site. On the subsite I get "access denied".

After some research I found that the access check (sites_sites_access) happens before purl_init, so that the site context is not set yet for the check, which results in an "access denied".

Comments

koenvw’s picture

Status: Active » Needs review
StatusFileSize
new499 bytes

That's right ducktape, in _drupal_bootstrap_full() the call to menu_set_custom_theme() results in a hook_access() being triggered. hook_init only happens after that:

menu_set_custom_theme();
drupal_theme_initialize();
module_invoke_all('init');

In my case I fixed it by calling purl_init() explicitly in sites_sites_access() so we are always sure purl is initialized. purl_init() has a check so it only runs once during the request life time.

See patch attached.

takki’s picture

Status: Needs review » Closed (fixed)

Reviewed, tested and committed to 7.x-1.0. Thanks

guypaddock’s picture

Status: Closed (fixed) » Active

Re-opening -- this definitely isn't showing up on the 7.x-1.x branch. Perhaps it's on 2.x?

takki’s picture

Assigned: Unassigned » takki
Status: Active » Fixed

You are right, seems like I didn't add it to the release. Commited the patch now to 7.x-1.x-dev and 7.x-2.x-dev.

Status: Fixed » Closed (fixed)

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