Hi there,
I try to accomplish that as less data as possible about ownership and who wrote which article are stored inside drupal-database to prevent the leak of that information.
The enviroment I am working within takes the anonymousity of their users as a high priority.
In the same time the users wants to be able to change their own articles.
This is a contradiction which could be solved in more then one way - but I try to get it like this:

- The users can choose their level of anonymousity.
- If they choose the "common" anonymousity, they should be able to edit their articles for about one week. After that week the "author" of the node changes to a specific user (user #2, since user #0 does not work for an unknown reason to me)

I accomplished that with rules and rules_view and everything seems fine. But there are articles/nodes with uploaded images and files. And here comes the break-down:
The ownership of the files (information who was it uploading the file) does not change. This makes the rule I wrote useless for all the people uploading files to their nodes (mostly images), because you can easily figure out the user-login of the article from the images within/connected to the article
When I try to access file:owner rules tells me that "The selected data property doesn't support writing".

Why is that and is there a way to go around that? Is it possible to make that data property writeable for rules somehow? Till now I could accomplish everything I wanted to do dynamicaly with rules and would like to stick with that, because it makes the side better upgrade-able in the future and easier to manage in my point of view.
Also I dont see the reason for this file:owner-ship as it seems like it has nearly no effect - if i change the author of the node, the future-author can delete and upload new images as well. So I dont see much reason in keeping this information inside the database at all. Therefore I would like to use my Anti-Spam rules to edit the information directly after the upload / save of the node.
But maybe I am totaly wrong and somebody can explain me why rules cant change file:owner and why I should do it otherwise (like writing a custom module just for that task).
I am stuck with that now for yet a long time and we would like to go online with the project soon (by replacing a very old cms we used till now with drupal). Any Tips or Hints are welcome.

Comments

käptn barbarossa’s picture

i have solved it by writing a mini-module.
for other peoples interest:

function mymodule_file_presave(stdClass $file){
$file->uid = 0;
return $file;
}

thats all.
but still i am wondering why i could not do the exact same thing with rules...

käptn barbarossa’s picture

Status: Active » Closed (won't fix)