Download & Extend

Cooperation with Clone/Revisioning/... module

Project:Taxonomy Access Control
Version:6.x-1.x-dev
Component:Integration with other modules
Category:bug report
Priority:normal
Assigned:DizzyC
Status:postponed

Issue Summary

I define Taxonomy access permissions that each user role has for each category.
When I edit, it works fine. I can choose just defined categories.
But it doesn't work with clone module. When I'm trying to clone a node I can choose all categories.

Comments

#1

Which version of Node clone are you using?

#2

I'm using Clone module 5.x-2.4

#3

I've encountered this same problem, using the most recent dev release of TAC (2.x branch, so it's not just in 1.1) and Clone 5.x-2.6.

After cloning, the user can select any category rather than just the allowed categories, and if the node is submitted, it gets tagged with that term.

When the user goes back to edit the cloned node after it's saved, the extra terms are no longer listed in the term selection box (and will get un-tagged following submit because of another issue: http://drupal.org/node/301597).

#4

We should test to see if this issue also exists in 6.x. This may be a bug in hook_nodeapi().

#5

Component:Code» Integration with other modules

#6

Category:support request» bug report
Priority:critical» normal

#7

Version:5.x-1.1» 6.x-1.x-dev
Status:active» postponed (maintainer needs more info)

Moving issue to 6.x branch; please set status to "active" if you confirm this bug in a current (6.x) release of TAC.

#8

Status:postponed (maintainer needs more info)» active

I landed here looking for a solution to this problem.
I can confirm this issue on TAC 6.x-1.2 with Node Clone 6.x-1.x-dev

#9

Assigned to:Anonymous» DizzyC
Status:active» needs review

Found the 'problem'.
Solution is really simple.

In taxonomy_access.module line 460 (taxonomy_access.module,v 1.107.2.19 2010/03/18 21:38:51 xjm).

In the implementation of hook_db_rewrite_sql() you have this line:

<?php
$op
= (arg(0) == 'node' && (arg(1) == 'add' || arg(2) == 'edit')) ? 'create' : 'list';
?>

this needs to become:

<?php
$op
= (arg(0) == 'node' && (arg(1) == 'add' || arg(2) == 'edit' || arg(2) == 'clone')) ? 'create' : 'list';
?>

So it takes Node Clone's menu router into account as a node creation op. That is 'node/%/clone' => arg(2) == 'clone'.

This should probably be reviewed and committed as it is pretty straight forward.

That's all folks,
Cheers!

#10

Status:needs review» postponed

Thanks for your research. So, yet another arg() special case.

As I've mentioned in other issues, this entire hook needs work. Otherwise, we have to account for every special URL pattern every other module might have.

Postponing this for #903522: Move control of create into hook_form_alter() and hook_nodeapi() to prevent numerous problems. I recommend the fix described above in the meanwhile.

See also:
#660668: TAC + revisioning: Empty taxonomy term select list on node/add for regular users
#818212: Critical bug with node_revisions - vid as revision id versus vocab id

#11

Title:Taxonomy access and clone module» Cooperation with Clone/Revisioning/... module

I don't have the time or guts to try the patch in #903522.
I was tracing problems on a live client system and ended up in the db_rewrite_sql stuff; created a patch; and only then spotted all these interrelated issues.

So here's an updated version of the 'intermediate fix' in #9, which also addresses problems with (paths to edit screens created by) the Revisioning module.

AttachmentSizeStatusTest resultOperations
308682-11.patch956 bytesIgnored: Check issue status.NoneNone
nobody click here