Skip to content

Commit

Permalink
Merge pull request #391 from esmero/ISSUE-385
Browse files Browse the repository at this point in the history
ISSUE-385: Drupal 10.1 compatibility for our overriden Controllers/facet/exposed forms (Symphony 5 v/s GET)
  • Loading branch information
DiegoPino authored Jan 8, 2024
2 parents 3e1d052 + 9598e9b commit f53d1e1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
}
],
"require": {
"drupal/core":"^10.1",
"strawberryfield/strawberryfield":"1.3.0.x-dev",
"league/html-to-markdown":"^5.0.0",
"erusev/parsedown": "^1.7",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@
options.data = $.param(params);
}
else {
if ((options.data == null) || (typeof(options.data) == 'undefined')) {
options.data = {};
}
options.data['exposed_form_display'] = $exposed_form;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use Drupal\Core\Render\RenderContext;
use Drupal\Core\Render\RendererInterface;
use Drupal\Core\Routing\RedirectDestinationInterface;
use Drupal\views\Ajax\ScrollTopCommand;
use Drupal\Core\Ajax\ScrollTopCommand;
use Drupal\views\Ajax\ViewAjaxResponse;
use Drupal\views\ViewExecutableFactory;
use Symfony\Component\DependencyInjection\ContainerInterface;
Expand Down Expand Up @@ -122,10 +122,10 @@ public static function create(ContainerInterface $container) {
* Thrown when the view was not found.
*/
public function ajaxView(Request $request) {
$name = $request->request->get('view_name');
$display_id = $request->request->get('view_display_id');
$name = $request->get('view_name');
$display_id = $request->get('view_display_id');
if (isset($name) && isset($display_id)) {
$args = $request->request->get('view_args', '');
$args = $request->get('view_args', '');
$args = $args !== '' ? explode('/', Html::decodeEntities($args)) : [];

// Arguments can be empty, make sure they are passed on as NULL so that
Expand All @@ -134,15 +134,15 @@ public function ajaxView(Request $request) {
return ($arg == '' ? NULL : $arg);
}, $args);

$path = $request->request->get('view_path');
$path = $request->get('view_path');
// If a view has an invalid Path (e.g you added some % somewhere) this will be null.
$target_url = $this->pathValidator->getUrlIfValid($path);
$dom_id = $request->request->get('view_dom_id');
$dom_id = $request->get('view_dom_id');
$dom_id = isset($dom_id) ? preg_replace('/[^a-zA-Z0-9_-]+/', '-', $dom_id) : NULL;
$pager_element = $request->request->get('pager_element');
$pager_element = $request->get('pager_element');
$pager_element = isset($pager_element) ? intval($pager_element) : NULL;
// Assume its there if not told otherwise
$exposed_form_display = (bool) $request->request->get('exposed_form_display', TRUE);
$exposed_form_display = (bool) $request->get('exposed_form_display', TRUE);

$response = new ViewAjaxResponse();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use Symfony\Component\Routing\RouterInterface;

/**
* Defines a controller to load an Modal Exposed Views Form Block via AJAX.
* Defines a controller to load a Modal Exposed Views Form Block via AJAX.
*/
class ViewsExposedFormModalBlockAjaxController extends ControllerBase {

Expand Down

0 comments on commit f53d1e1

Please sign in to comment.