Registration state is currently stored in the state property on registrations as the registration_state_id. Some or all of the following could resolve some challenges when using rules or metadata wrappers in general to set registration state.

  1. Rename state property in the schema to state_id so it is separate from the 'state' entity property when using metadata wrappers. Currently you can't cleanly use metadata wrappers to set the state of a registration.
  2. Provide a registration_get_states_options_list function to return a list of registrations states structured for option lists (used in rules, edit forms, etc)
  3. Provide a rules action for setting the registration state instead of relying on the 'set data value' action.
  4. Store the registration_state name instead of the ID in the DB. This would allow code/rules that rely on specific registration states to keep working using the exported names of those registration states instead of the numeric ids that might change.

There is also this issue: #1547190: States per registration type / states as fields - I haven't reviewed it yet for similarities, but it looks like a larger overhaul of the registration state system.

Comments

tauno’s picture

Assigned: Unassigned » tauno

I will be working on 2 and 4 from the list above. Holding off on 1 until we see if it's really necessary and 3 shouldn't be needed if the metadata setters/getters work properly.

tauno’s picture

Status: Active » Fixed

Merged into 7.x-1.x now. Hopefully some people will test out the update process before we roll another tagged release.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.