updateFacetsBlocks should not send a request if there is no facet block

Created on 21 March 2024, 3 months ago

Problem/Motivation

The updateFacetsBlocks JS function sends its request even if we know that the Ajax call will result in a 404 error because \Drupal\facets\Controller\FacetBlockAjaxController::ajaxFacetBlockView() throws a \Symfony\Component\HttpKernel\Exception\NotFoundHttpException when $path or $facets_blocks are empty.

This can happen when using custom facets rendering that uses Ajax to update (without being blocks).

Proposed resolution

Add a simple test before sending the request to prevent error.

๐Ÿ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

๐Ÿ‡ซ๐Ÿ‡ทFrance DuaelFr Montpellier, France

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024