how is a rule triggered - for example, if an entry is created in the node table by a direct SQL insert, would a rule fire? If not, is there a way to do that - without the overhead of Services or anything more computationally expensive than a straight SQL insert or an HTTP POST from a trusted IP (ie no Drupal authentication needed, the external process is 'known good')

thanks,
Andy

Comments

ptmkenny’s picture

Category: task » support
tr’s picture

Issue summary: View changes
Status: Active » Fixed

Entity rules are triggered by entity hooks, which means that the hook has to be invoked for the Rule to be triggered.

The hooks are triggered when you manipulate Entities via the Entity API.

Bypassing the hooks by doing direct SQL calls to create entities is A Very Bad Idea because it circumvents all of the Drupal API and does not let any other module contribute to the process. Besides, it's actually a lot easier to use the API to create your entities than it is to do it directly with SQL. And if you ever add a field to your Entity, for instance, the API call will continue to work and properly create your entities, while your SQL will have to be rewritten to account for the new field. So, use the API and everything will work as it should.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.