Download & Extend

Access to node/%node/edit controlled by OG instead of spaces and OG

Project:Spaces
Version:6.x-3.2
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs work

Issue Summary

Spaces is -1. Og is 0. Spaces does it's menu alter. Og is does it's.

Bam, access callback for node/%node/edit is og_menu_access_node_edit instead of spaces_access_menu, so linking to node/%node/edit fails with patch for #936234 active (Tabs would trigger redirect, as it'd test access to the tab, so despite not being at that tab it would redirect).

This is the second time I've had issues with contrib modules running after spaces's menu alter (views unpublished for node/%node/view), making spaces_access_menu disappear. I think the menu alter runs too late and the weight should be at least 1 . I know there is a reason for it being -1, but I don't know why (I believe it was mentioned to me at some point, but forgot).

Comments

#1

Status:active» needs review

Here's a quickie patch.

AttachmentSize
960318_spaces_weight.patch 842 bytes

#2

Settings pre-patch:

Weight Name Version
-1 Spaces (spaces) 6.x-3.0-beta6
1 Spaces OG (spaces_og) 6.x-3.0-beta6
-19 Spaces User (spaces_user) 6.x-3.0-beta6

Wouldn't bad things potentially happen with Spaces and Spaces OG sharing a weight?

#3

Status:needs review» needs work

Ye, spaces_og_menu_alter needs to run after spaces_menu_alter to alter the items spaces_menu_alter adds, however there's a flaw in with that menu alter that #936234: call to router during menu access check causes infinite loop reveals; node/%node/features doesn't redirect (it was relying on other local tasks to redirect).

<?php
    $items
['node/%node/features']['access callback'] = 'spaces_og_access_admin';
   
$items['node/%node/features']['access arguments'] = array(1);
?>

edit: Appreantly I meant to say more, and left a "However," at the bottom. I don't remember what I was going to say.

#4

I also noticed that you need to make sure boxes runs after spaces or you get a WSOD (seems that the spaces_controller class isn't loaded for spaces_controller_boxes).

#5

Status:needs work» needs review

Here's one with spaces_og.install.

Can ya make a patch for boxes?

(Let's see if my attempt to add a file via patch works...)

AttachmentSize
960318_spaces_spaces_og_weight.patch 4.07 KB

#6

How has this been sitting here for so long? I was having a problem where trying to edit the Features for a Space result in access denied- adjusting the weights as in the patch above fixed the problem.

Unfortunately that patch will not apply for whatever reason. Here's an updated patch, with a couple of typos fixed.

AttachmentSize
spaces-960318-6.patch 4.36 KB

#7

Status:needs review» needs work

Ah- just noticed #4. Indeed, the patch needs to update the weight of boxes to be heavier than spaces, else you get a nasty error.

#8

Version:6.x-3.0» 6.x-3.2
Category:feature request» bug report

This is a bug, and I think still an issue with 6.x-3.2...

#9

I found the issue in a clean OpenAtrium 1.1 installation.

Sorry but I missed myself in the discussion...

Setting this order (weight in brackets) it need to work, isn't it?
og (0) > spaces (1) > spaces_og (2) > spaces_user (3) > boxes (4)

Thanks,
m.

nobody click here