Ok, the inline function call is not a better approach since there could be more than one insert in the rule depending on the content type hirarchy.
There are different options to solve this:
- Creating a function for each content type and call this function from the rule, the down side of this is that the insert would return a row and thus the db driver would return a "not dml nor ddl" exception, so the insert to the view would have to be invoked from a db_plpsql_exec and it would break any external direct insert to the view
- Having also a "dummy" dml call into the rule that would be invoked just to execute the function
- Taking content_revision__new call out of the rule, invoking it before the insert and the rule would just insert one row into the content type corresponding table
Which option makes more sense? (if any)