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?

Comments

rudiedirkx’s picture

What does "a status of 1" mean? You mean published? Registration enabled?

"Allow registrations until" is a field, isn't it? Rules knows about that.

dpfitzsi’s picture

I 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.

rudiedirkx’s picture

Max 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.

dpfitzsi’s picture

Thanks 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.

dpfitzsi’s picture

Version: 7.x-1.16 » 7.x-1.x-dev
dpfitzsi’s picture

Status: Active » Needs review
rudiedirkx’s picture

Great, I'll add that soon.