I'd like to invoke a specified feed importer after a node of a particular content type is deleted (this is all within the same site).
I started with Rules and found that the so called 'after' events don't actually occur after the operation has been written to database. Discussing in this issue in the rules issue queue the idea was floated of using hook_post_action.
I did have a look but couldn't work out how to integrate this to rules. I looked for examples but didn't find anything comparable that I could use as a template.
I actually found an acceptable and reliable workaround to doing this for creation and updating. However, I haven't found a workaround for invoking the feed importer after a node has been deleted.
hook_post_action has hooks so you can write your own functions that invoke the functions in that module. So, in theory I should be able to do something like:
function mymodule_node_postdelete($node) { feeds_import('myfeedimporter',0); }
However, I'm not sure what command to use to invoke the feed. I've hunted through the feeds module and it looks like feeds_action_import_feed
may be the function that is invoked by Rules, but I'm not sure that it works or that I've specified it properly:
$params_array = array( "importer" => "myfeedimporter", "feed_nid" => "0" ); feeds_action_import_feed('myfeedimporter',0, $params_array);
While I think, if it works, a simple invocation of the feed importer would suffice for my needs, there would be much greater value to the wider Backdrop community if we could use these post action hooks as events in Rules (I note the D8/9 module 'Business Rules' has an issue for adding this in).
I would appreciate some pointers as to how I can invoke the feeds importer, either in my custom implementation of hook_node_postdelete, or in Rules.
Recent comments
@yorkshirepudding - Thank you! That's just what I needed. In the code, it's actually fontyourface_ui_settings_form (with underscores rather than dashes). Now it's working ... I only have to figure...
Question about hook_form_FORM_ID_alter
Oh the benefits of a new set of eyes.... I don't know how many times I've looked at that css and not spotted that! Mind you, in my defense, my eyes are over 70 years old (and obviously in need of...
How to over-ride grid-flexbox.css
thanks yorkshirepudding, i used the CSS Injector option with this code and it works .views-table caption { font-weight: bold; color: blue; font-size: 26px; }
How to change the format of the Views group title field?
@Ian Spotted the issue: Your selector has "1-wrapper" rather than "l-wrapper" (i.e. the numeral for one rather than lowercase L) Try: @media (min-width: 75em) { div.l-wrapper-inner.container....
How to over-ride grid-flexbox.css
@yorkshirepudding Yes I did flush the caches :) I've also used Firefox to inspect the element - which is where I get the "div.1-wrapper-inner.container.container-fluid" from. While hovering on that...
How to over-ride grid-flexbox.css