Field made non-visible by workflow_fields is still visible on node's "View" tab

dan3h - November 10, 2007 - 01:13
Project:Workflow Fields
Version:5.x-1.x-dev
Component:Miscellaneous
Category:feature request
Priority:normal
Assigned:infojunkie
Status:closed
Description

On the *Edit* tab (eg. "node/123/edit"), the workflow_fields module is working like a charm for me, hiding and making a field uneditable depending on the role and workflow-state. It's very nice.

But for the node's corresponding *View* tab (eg. "node/123"), the field that is supposed to be hidden field stays very much visible, and I've tried everything I can think of.

- I have unchecked the "administer nodes" permission. (This turned out to be important! Otherwise, you can always view and edit anything, and workflow_fields is unable to restrict access to things.)

- For my CCK type (called 'test_type'), I have unchecked the "create test_type content", "edit test_type content" and "edit own test_type content" preferences, as I'm thinking workflow_access is supposed to take care of that now.

I also have run it in my debugger, setting a breakpoint at the start of every function in the workflow_fields.module. What I found is that when on the View tab of a node ("node/xxx"), none of that code gets run *at all*.

Any idea what I'm doing wrong?

I have 5.2 (or 5.3?) of drupal, the latest version of workflow and workflow_fields, and 5--1.3 of CCK.

Thanks!
Dan

#1

infojunkie - November 12, 2007 - 06:13
Category:support request» feature request
Assigned to:Anonymous» infojunkie

That's right, the view tab is not currently handled. It's a planned future enhancement :-)

#2

infojunkie - November 12, 2007 - 07:10
Status:active» fixed

Fixed! Please provide feedback so that I can close the issue.

#3

dan3h - November 13, 2007 - 17:18

Kratib,

Thanks for the excellent and quick response! Works like a charm.

One bug though-- I created a node, which makes me the author of that node. I didn't give the 'author' group permission to see/edit a certain field in this type/state, but I *did* give permission to the 'sysadmin' role, which this user belongs to, and which is the role I assign every single drupal permission to. And yet, I wasn't able to see the field. The fact that I wasn't the author trumped me belonging to a role that was permitted to see it.

So I patched your code to fix this problem, and it worked for me. I don't know if it breaks anything else, but it is attached here for your perusal.

Thanks again!

Dan

AttachmentSize
workflow_fields__author-bug.patch 941 bytes

#4

infojunkie - November 14, 2007 - 05:52
Status:fixed» closed

Dan, thanks! I looked at the patch and checked it in.

 
 

Drupal is a registered trademark of Dries Buytaert.