I'm trying to unpublish a node based on a date field with Rules. I've followed this tutorial but somehow it doesn't seem to work.
Here's my Component:
{ "rules_unpublish_termin" : {
"LABEL" : "Unpublish Termin",
"PLUGIN" : "action set",
"OWNER" : "rules",
"REQUIRES" : [ "rules" ],
"USES VARIABLES" : { "node" : { "label" : "node", "type" : "node" } },
"ACTION SET" : [ { "node_unpublish" : { "node" : [ "node" ] } } ]
}
}
And here's the Rule:
{ "rules_unpublish_termin_rule" : {
"LABEL" : "Unpublish Termin Rule",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "rules", "rules_scheduler" ],
"ON" : { "node_insert--termin" : { "bundle" : "termin" } },
"IF" : [ { "node_is_published" : { "node" : [ "node" ] } } ],
"DO" : [
{ "schedule" : {
"component" : "rules_unpublish_termin",
"date" : [ "node:field-termin-datum:value" ],
"identifier" : "Unpublish content ID [node:nid] ([node:title]).",
"param_node" : [ "node" ]
}
}
]
}
}
I'm fairly new to Drupal and I've never used the Rules module so I'm not sure if there's something else I'm missing here.
edit:
I've been looking into it a bit more.
Currently I have 3 nodes in this bundle with the following dates:
2018-01-09 (which should have been unpublished today)
2018-05-12
2018-07-14
In the Tab Schudule under admin/config/workflow/rules/schedule I can see that the component rules_unpublish_termin
has a Schedule Date for 2018-07-14 00:00 which would correlate with the very last date, this seems a bit odd..