I noticed that nodes don't get their status changed when the allowed registration until time has passed (all nodes show a status of 1). Could we expose this value as a field so that rules could be used to change the node status when the time entered in this field has passed?
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 2458527-expose-allowed-registrations-until-to-rules.patch | 1.31 KB | dpfitzsi |
Comments
Comment #1
rudiedirkx commentedWhat does "a status of 1" mean? You mean published? Registration enabled?
"Allow registrations until" is a field, isn't it? Rules knows about that.
Comment #2
dpfitzsi commentedI noticed in the node_registration_node table that all of my nodes have a status of 1 despite many of them being past their event start date (sometimes by months). Shouldn't this status change once the event start date has passed?
I can't find allow registrations until as a field in either views or rules. It seems that is included as serialized data in the node_registration_node table under the column settings.
Comment #3
rudiedirkx commentedMax registration datetime can come from 2 places:
1. A date field value
2. An offset (like "2 days") (in combination with the event datetime)
If it's a date field, Rules can use that. If it's the offset, there is indeed no exposed property for that. I can point you in the right direction, but I'm probably not fixing.
In case you might:
1. Create a new node property in
node_registration_entity_property_info_alter(). Type 'date' probably.2. Add its value logic in
node_registration_metadata_entity_get_properties(), using$entity->registration->max_registration_time()3. That should expose it to Rules.
Comment #4
dpfitzsi commentedThanks rudiedirkx for your clear instructions. I have been able to expose the setting to Rules and now it fires just as expected. Thank you. I have attached the patch.
Comment #5
dpfitzsi commentedComment #6
dpfitzsi commentedComment #7
rudiedirkx commentedGreat, I'll add that soon.