It could be useful to have the count of available units for each unit type in hook_bat_facets_search_results_alter() function context.

One use case could be filtering unit types that don't have a certain number of units available in a time range.

Comments

maurizio.ganovelli created an issue. See original summary.

acrollet’s picture

Status: Active » Needs review

Ciao Maurizio, thanks for the patch! I've updated it against the latest dev and made a couple changes, could you review? Please note I removed the params element as I don't see a need to pass a possible large variable around when the information can be retrieved again.

acrollet’s picture

StatusFileSize
new1.24 KB
acrollet’s picture

StatusFileSize
new1.26 KB

updated the patch with a more precise variable name.

maurizio.ganovelli’s picture

Status: Needs review » Reviewed & tested by the community

Thank you Adrian!
You're right, there's not need to pass param variable since all search parameters could be retrieved using \Drupal::request()->query->get('...') or \Drupal::request()->query->all().
I've tested the patch and it's working perfectly.

  • acrollet committed 7f608e7 on 8.x-1.x
    Issue #2962963 by acrollet, maurizio.ganovelli: Insert available units...
acrollet’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the contribution! Committed in 7f608e7.

Status: Fixed » Closed (fixed)

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