Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISSUE-385: Drupal 10.1 compatibility for our overriden Controllers/facet/exposed forms (Symphony 5 v/s GET) #391

Merged
merged 4 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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