Fix ACL form code (was: Port ACL 5.x-1.5 to Drupal 6)

salvis - December 31, 2007 - 01:16
Project:ACL
Version:6.x-1.x-dev
Component:Code
Category:task
Priority:critical
Assigned:Unassigned
Status:closed
Description

I'll be looking for reviewers/testers...

#1

salvis - January 19, 2008 - 00:09
Status:active» needs review

The port is committed in HEAD, but it's completely untested. There weren't that many porting issues, and it has a good chance to work, but if you try it out, then be prepared for surprises, and certainly don't try it on a production site!!!

Since ACL has no interface of its own, it's a pain to test, and it may be a while before I get to port Forum Access and start doing serious testing myself. To help with testing, I've implemented the new hook_node_access_explain() in devel_node_access.module (see http://drupal.org/node/205317).

If you give it a go, then please let me know what you find. TIA!

#2

salvis - February 12, 2008 - 19:59
Priority:normal» critical

Both ACL and Forum Access are now ported to D6. Please give them a work-out and provide feedback, good or bad.

ACL HEAD
FA HEAD

Of course I'm also interested in feedback about any other D6 module using ACL.

#3

nbz - February 21, 2008 - 14:10

I have gone ahead and used this on a (mostly - still need to add a lot of content) production site. So far everything seems to work as expected.

http://www.therevival.co.uk

#4

salvis - February 21, 2008 - 23:28

Great, thank you for your feedback!

Are you using ACL with FA or ???

#5

nbz - February 21, 2008 - 23:33

Yes I am. Forum_Access and ACL. It works and no users have complained (well apart from me not adding them to the right groups...)

#6

salvis - February 22, 2008 - 01:23

Very good, thanks!

I'd like to get a few more green lights...

#7

nbz - February 24, 2008 - 18:21

A slight update - I have had one secret topic be available for all when it should only have been viewable to a single role. This then sorted itself out after around 10 minutes, but I did go to the forum settings, to check them Never made any changes, clicked save. probably something to do with a cache?

There is one other topic which is currently viewable to a different role.

In both cases the proper breadcrumb does not show - it just says "home" instead of "home > forums > forumname"

#8

salvis - February 24, 2008 - 20:49

That's very strange. I'm not aware of any caching being done there.

Can you temporarily install the devel_node_access module, which is part of the Devel module? This has a block that displays the {node_access} table entries for each node. This would help very much in pinning this down.

Forum Access definitely has no influence on the breadcrumb — there must be some other interference in your system.

#9

nbz - February 25, 2008 - 14:57

From Devel_node_access on that page I get the following:

Topic Title! forum_access 4 1 0 0 Role
Topic Title! acl 8 1 1 1 forum_access/8: Modname1, Modename2, Modname3

I am not a mamber of that role, nor one of the three named Mods.

The only module that I can think of which may be interfering with the breadcrumbs in Pathauto, but even with that disable I get the same error.

What *I think* could be the problem is that drupal is no longer seeing that topic as a forum topic for some reason, so is using the default breadcrumb - it having no parents. When I click edit, the forum it belongs to is not listed under the options - It is asking me to choose again. At the same time, it is present in the correct forum for those who are members.

#10

salvis - February 25, 2008 - 21:11

Can you close your site for two minutes (admin/settings/site-maintenance), disable Forum Access, and check what this does for your breadcrumb? I have a really hard time imagining how FA could cause a problem there.

You're not testing as user 1, are you? User 1 always sees all nodes...

Now that we have those records, please rebuild your permissions at admin/content/node-settings and check whether that makes any difference.

When I click edit, the forum it belongs to is not listed under the options - It is asking me to choose again.

That's a very interesting observation! According to the record you pasted, the node should be in forum/8 — is forum/8 not showing in the drop-down? But the node is listed under forum/8?

What happens if you go in as user 1? Then all forums should show in the drop-down — is the right one selected now when you try to edit the node? Is it forum/8 or what is it?

#11

nbz - February 25, 2008 - 23:43

I was going in with another user, but I just realised it had been given permission to "administer nodes" - that is the permission causing problems.

sorry, (probably) NOTABUG. Just the one topic that leaked into the wild for a short time is the only issue, but since I cannot reproduce, maybe it was me being silly again.

fyi, going in as user 1, the full breadcrumb is shown, and when clicking edit, it belongs to the right forum. Rebuilding permissions makes no difference - as expected since the role could administer permissions.

#12

salvis - February 26, 2008 - 00:45

Ah, yes, 'administer nodes' explains why you were able to edit but you didn't get the forum in the drop-down list.

Thank you for your feeback!

#13

nbz - March 8, 2008 - 14:19

ok just got another one which is viewable to all users (including anonymous) instead of just one role. There is one clue which I may or may not have overlooked earlier - this one is a poll. Does that make a difference?

EDIT - just had a look at the node access summary:

Title all 0 1 0 0 All users may view this node.

I assume this is a bug with forum_access? (I do NOT have content access installed. Never have.) Should I start a new issue there? (having a quick look at the module, it runs if ($node->type == 'forum') { on line 33 of forum_access.module. If this is the spot which controls views, I think this statement should be altered to check somehow check the taxonomy instead - all node types are allowed in the forums in Drupal 6.

#14

salvis - March 8, 2008 - 14:21

Forum Access controls access to nodes of the forum topic type. Poll is a type of its own, I assume...

all node types are allowed in the forums in Drupal 6

That's news to me. Yes, please post a new issue in the Forum Access queue.

#15

nbz - March 8, 2008 - 14:24

devel/node_access/summary:

All Nodes Represented

All nodes are represented in the node_access table.
Access Granted to Some Nodes

The following realms appear to grant all users access to some specific nodes. This may be perfectly normal, if some of your content is available to the public.

Public Nodes realm public nodes
all 237

Summary by Realm

The following realms grant limited access to some specific nodes.
Protected Nodes realm private nodes
acl 360
forum_access 3193

Other info was added to my last post - which included a hypothesis which may be total crack.

I will just repeat the line about the node access summary for that node:

Therealtitle all 0 1 0 0 All users may view this node.

#16

nbz - March 8, 2008 - 14:34

That's news to me. Yes, please post a new issue in the Forum Access queue.

Done:

http://drupal.org/node/231611

#17

nick.dap - August 3, 2008 - 20:05

Subscribing

#18

nbz - August 3, 2008 - 20:42

@pacemkr: afaik all that is left is for people to test the dev release to make sure that it is stable and there is nothing obvious missing. Please test :P

#19

nick.dap - August 4, 2008 - 00:39

Ah. Thank you. I'll see if I can give it a spin on my dev server. Is there any specific area that needs abuse? ;-P

#20

nbz - August 4, 2008 - 01:01

Apart from just looking around, the two mentioned on the project page *should* now be fixed:

Drupal Core 6 (#246162: Bug in Drupal Core 6.2 silently disables half of the node access mechanism): a fatal bug silently disables half of the node access mechanism; ACL cannot work properly until #153998: Access checks returning NULL is ugly. is fixed; the patch is committed and will appear in Drupal 6.3.

Not sure how to test though.

testing would probbaly have to be in conjunction with another access module such as forum_access

#21

fago - October 3, 2008 - 15:18

I've just worked on the content access acl integration for d6 - unfortunately the form code of acl was broken when it was included more than once into a form - as content access does. I've committed a fix for it -> http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/acl/acl.mod...

Now, it works fine even without notices. So I set this issue to fixed for now, for problems with 6.x I'd suggest to open separate issues.

#22

salvis - October 16, 2008 - 19:52
Status:needs review» fixed

Thanks, fago!

Let's close this here and continue with #322279: ACL for D6 Released.

#23

salvis - October 16, 2008 - 21:26
Title:Port ACL 5.x-1.5 to Drupal 6» Fix ACL form code (was: Port ACL 5.x-1.5 to Drupal 6)
Assigned to:salvis» Anonymous
Status:fixed» patch (to be ported)

Hmm, too fast...

@fago: please backport to D5.

#24

fago - October 20, 2008 - 10:57
Status:patch (to be ported)» fixed

I don't think this needs to be ported, afaik in d5 the form is working fine. The changes were necessary due to changes in the formapi how buttons are handled.

#25

Anonymous (not verified) - November 3, 2008 - 11:07
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.