I've tried to implement this, specifically filtering based on registration_entity.status, but it's beyond my knowledge level. I defined a filter, and extended views_handler_filter_boolean_operator in its handler, but I just end up filtering based on node.status.

I can't be the first to want to filter nodes with registration entities in this way, so perhaps there is a way to accomplish this through the ui, with the existing tools, that I am overlooking?

Comments

dpi’s picture

The problem with status is that it is a computed value, and is not simply taken from the status database field.

Personally I would like to see this change for this exact reason.

For now, it is impossible.

levelos’s picture

Title: Views -- Filter Host Entities based on registration settings » Enable views filtering on registration_entity.status

I'm not really sure how this could be a stored value giving everything that's checked inside of registration_status(). The function could be used to update the registration_entity.status property, which in and of itself currently has a different meaning, when a registration is saved, when entity settings are saved, and/or during cron, but none of those would guarantee it'd be accurate.

joetsuihk’s picture

Version: 7.x-1.x-dev » 7.x-1.1
Category: feature » bug

This is no longer the case after 7.x-1.1 version
I can add exposed filter(as a dropdown), but other fields of registration state no longer works...

I guess there is a problem on relationship, as anything under registration_state is not working.
I change this to bug instead.

I am not sure if others want to change the issue title as well.

nwom’s picture

Version: 7.x-1.1 » 7.x-1.x-dev
Category: bug » feature

@joetsuihk

I think you are mixing "Registration State" and "Registration Status" up.

The state is the state of a user registration. Whether it be pending, registered, waiting list, etc.

Status is the status of the registration itself. So if there are open slots it will display as "Open", and once all slots are full "Closed".

Basically this thread is for a way to filter based on on the status of the registration. Currently only the registration state is able to filtered. However, the status is currently available as a views field.

Since this is currently not possible, it is a feature request.

Would anyone know of a workaround using a PHP filter using the Views PHP module? Thanks in advance.

lightsurge’s picture

This is disappointing. Without this I'm currently filtering with a hook_views_pre_render, causing all kinds of gripes.

It would be nice to be able to filter on registration_entity.status even if it is unreliable, until such time as registration_status() keeps it updated.

Closing https://drupal.org/node/1651142 as duplicate (I also messed about trying to code a filter in.

retrodans’s picture

Issue summary: View changes
StatusFileSize
new2.83 KB

Okay, so had a simile requirement, and have created a patch file to add a nice filter in. The requirement for this was we want two views, one for open and another for closed, and needed the ability to change layout based on this. The filter seemed the most sensible approach.

Note: This is my first foray into views handlers, so any tips would be appreciated, and I will try to bring it inline with the standard approach.

Dan

retrodans’s picture

Status: Active » Needs review
guypaddock’s picture

This looks good to me.

For the benefit of anyone else just jumping in to this thread, the patch in #7 only filters on whether or not registrations are enabled for a particular node, not whether or not registration is closed (either because it's full, time is before the open date, time is after the close date, or a module that alters the status has closed it).

If you are looking to filter based on whether registration is open or closed, see my patch in #2377835: Implement missing views filters (capacity used, registration status, dates).

markusd1984’s picture

Title: Enable views filtering on registration_entity.status » Broken/missing handler
Version: 7.x-1.x-dev » 7.x-1.6
Issue tags: +Broken/missing handler

The handler for this item is broken or missing and cannot be used. If a module provided the handler and was disabled, re-enabling the module may restore it. Otherwise, you should probably delete this item.

Might that be due to the changes up till 7.x-1.6?

markusd1984’s picture

Title: Broken/missing handler » Enable views filtering on registration_entity.status

@retrodans any way I can troubleshoot this?

markusd1984’s picture

Version: 7.x-1.6 » 7.x-1.x-dev
john.oltman’s picture

Status: Needs review » Closed (outdated)
Issue tags: -