I recently upgraded from 4.2 to 5.1 to get access to some of the new API functionality. In the process I seem to have lost the critical functionality of being able to filter views by availability (specific date and date range.) This capability is critical to my production site and the upgrade seems irreversable, Users have made many changes since the upgrade, so an old backup is a big problem.

Can you either tell me what the replacement for filtering on availability is supposed to be (CID doesn't seem to be it), how to enable filtering by availability, or how to manually undo the update.php changes so that 4.2 will function again on my site? Thanks!

Mack

Comments

mackmccauley’s picture

P.S. This is a super useful module and I really appreciate all you've done with it as well as the effort to move it forward. I'm sorry in advance if this is some foul-up on may part. I've been through all the readies and change logs and can't see what would be happening.

fietserwin’s picture

The changelog states:

Incompatibilities with 7.x-4.2:
-------------------------------
These are actions and checks you have to perform manually after you have
upgraded to this version.
- Clear all caches.
- Update ALL your views related to availability. All functionality is still
there, but may have been moved or renamed. So you may get "broken handler"
messages or handlers that do different things than before. E.g. "filtering on
availability" will now be "filtering on calendar ID".

So, yes, things have changed, because every piece f data is now available to Views. However, I think that the changelog is incorrect. The filter is now named (assuming the availability field is on a node):

Content: {<em>field name</em>} is available
Filters on availability during the defined period.

Whereas before, cid was "abused" to filter on availability (cid itself was seen as a useless field/filter, but now that we can descend into the availability tables it is needed to create the relations).

Is this what you were looking for? Let me know, and I will update the documentation.

mackmccauley’s picture

Thanks for the response! I really appreciate the help.

This sounds like exactly what I was looking for, however it is not showing up as an available filter option or contextual filter option. The only options presented are:
field_calendar:cid
field_calendar:name
field_calendar:enabled

If you would like to e-mail me I can send you site name and login credentials so you can take a look yourself. Maybe I am missing something obvious.

Thanks again.

fietserwin’s picture

Could you first do some debuggig to see if the filter gets defined. Please add

    drupal_set_message("Added filter on availability for field $field_name");

as last line within the if to function availability_calendar_field_views_data_alter() in file ...\sites\all\modules\availability_calendar\views\availability_calendar.views.inc.

Then clear all caches and visit the edit view page. By then the message should have appeared several times.

mackmccauley’s picture

OK. That hook is not getting called. I neither received the messages, nor hit a breakpoint I set on entry to the function. I'm sorry that I am not enough of a views expert to explore why...

fietserwin’s picture

- I assume you are on Views 3.7?
- If so, this looks like a corrupt install Does function availability_calendar_views_api() gets called and does it return the correct path?
- Do you have entity api installed?

mackmccauley’s picture

I've postponed the update to Views 3.7 as it was crashing me for some other reason. I'll try to drive through that and see if it solves the problem. I did not see a minumum version of views mentioned in the documentation. What has been tested with?

mackmccauley’s picture

OK, it was a views version issue. My bad for not staying on the upgrade treadmill. Many thanks for the help.

fietserwin’s picture

To be able to mention a minimum version, could you indicate what version was giving you the problems?

fietserwin’s picture

Status: Active » Closed (works as designed)