I started this off by following the rules documentation (http://drupal.org/node/878720) and creating file_entity events.

Comments

Status: Needs review » Needs work

The last submitted patch, file_entity-rules.patch, failed testing.

drupallerina’s picture

StatusFileSize
new2.28 KB

Seems like the test didn't like presave.

dave reid’s picture

Now that I realize it, everything except for the 'view' rules event needs to be submitted as a patch to add core support for file entities since core already provides file_presave/insert/update/delete hooks. File entity would provide support for the file view action.

drupallerina’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, file_entity-rules.patch, failed testing.

dave reid’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
dave reid’s picture

File entity has switched to a 7.x-2.x branch and the 7.x-1.x branch is no longer used. Please make sure to update your Git clones.

bradjones1’s picture

If the goal is to have fields implementing file_entity available in Rules, I think those implementing modules may be the proper place to do Rules integration. I just submitted a patch to media module that exposes mediafield to Rules - see #1321600: Entity API (and Rules) integration for mediafield.

Of note, I was able to successfully apply this patch to 7.x-2.x-dev and the actions did appear, but I think exposing the fields is a better approach than creating rules events. For instance, instead of triggering on every file_entity CRUD action, you can react to a node save and then add a condition on the specific field.

agentrickard’s picture

Mediafield module is deprecated in 7.x.2.

dave reid’s picture

Status: Needs work » Postponed

See the related issue in Rules: #826986: File API events

rodrigoaguilera’s picture

I think that that issue is for file field in core, there's no event in rules for when a entity of type file is created

dave reid’s picture

Status: Postponed » Closed (duplicate)

File field in core uses file entities natively. So #826986: File API events is the proper issue and officially closing this as a duplicate.