| Project: | CCK Gallery |
| Version: | 6.x-1.x-dev |
| Component: | Miscellaneous |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (won't fix) |
Issue Summary
When an image content is creating you select the gallery container by the gallery_list_nodereference.
This view uses a parameter: user id, by default "User ID from logged in user".
If any admin edit my gallery this list will be show the wrong gallery list. These are not my galleries but the admin's galleries.
But, if you change this view like this:
Arguments: "User posted or commented" then choose the "User ID from URL". After then an another option will appear: "Also look for a node and use the node author". Then validate as user and check the "Only allow numeric UIDs".
So, if you do not add an user id parameter it will use the edited node's owner user id. This is we need, I think.
I have just tested it. It works.
Comments
#1
Update: works in edit mode but not when you want to add a new node. The new (not saved) node has no owner... :(
I have not found any solution for this. But searching...
#2
Thanks for reporting. Can you please post an export of your revised view. =)
#3
any updates on this plz? bump ...
#4
My advice would be to create a separate view or display for gallery admin, rather than trying to make display fit all. It could be on the same view, and if you post back the View code incorporating an admin display then I'll happily incorporate it.
If admin wants to create an image on someone's behalf then they must set the authoring info on the node appropriately. This is core stuff.
So, post an updated view with an admin display by all means. But it's not really a bug - you're stepping outside of the intended behaviour for that view.
#5
I guess you are right about this being an extension. Attached is the admin view exported code named "admin_gallery_list_nodereference". I did this by editing view options as above:
Arguments: "User posted or commented" then choose the "User ID from URL". After then an another option will appear: "Also look for a node and use the node author". Then validate as user and check the "Only allow numeric UIDs".
Could you hi-lite what code needs to be updated in the module such that when logged-in as user1 (or anyone with "Admin" role) one can *EDIT* a cck node on behalf of any author AS WELL AS "if admin wants to *CREATE* an image on an author's behalf then they must set the authoring info on the node appropriately" part also works.
Of course every user can still create/edit his/her own cck_gallery nodes since we still have your original "gallery_list_nodereference" view intact.
Note: The Views2 export is for CCK Gallery Vs. 6.x-1.1
Thanks.
#6
Thanks for the view. Will incorporate. Setting to "needs review" so I don't forget.
Need to review the code of the module again - I wrote it almost a year ago. When I get chance, I'll take a look at the admin problem.
#7
Your argument code contains loads of references to roles, taxonomy terms, etc. that are unique to your Drupal instance. Can you create a version that does not contain this data? See:
<?php$handler->override_option('arguments', array(
'uid_touch' => array(
[...]
'validate_user_roles' => array(
'2' => 0,
'3' => 0,
'4' => 0,
'5' => 0,
'6' => 0,
),
'relationship' => 'none',
'default_options_div_prefix' => '',
'default_argument_user' => 1,
'default_argument_fixed' => '',
'default_argument_php' => '',
'validate_argument_node_type' => array(
'blog' => 0,
'forum' => 0,
'book' => 0,
'cck_gallery' => 0,
'cck_image' => 0,
'event' => 0,
'image' => 0,
'page' => 0,
'profile' => 0,
'story' => 0,
),
'validate_argument_node_access' => 0,
'validate_argument_nid_type' => 'nid',
'validate_argument_vocabulary' => array(
'1' => 0,
'3' => 0,
'4' => 0,
'5' => 0,
'7' => 0,
'6' => 0,
'2' => 0,
),
'validate_argument_type' => 'tid',
'validate_argument_transform' => 0,
'validate_user_restrict_roles' => 0,
'validate_argument_signup_status' => 'any',
'validate_argument_signup_node_access' => 0,
'validate_argument_php' => '',
),
));
?>
#8
This is clearly not moving on.