elFinder Recursive search doesn't work on Drupal
elFinder Recursive search (hitting <ENTER>
while the search bar has focus) doesn't work on Drupal.
The problem is that upon hitting the Enter key, elFinder makes a request with the search term contained in a "q" parameter.
The q parameter is mangled by Drupal as the request is converted to a clean URL.
The problem can be resolved by inserting the following into CRM_Ckeditor5_Page_ImageManager:run (ckeditor5/CRM/Ckeditor5/Page/ImageManager.php) before $connector = new elFinderConnector(new elFinder($opts));
:
//Workaround for incompatibility between Drupal and elFinder's recursive search (hitting <ENTER> while Search bar is in focus).
//Restore original "q" parameter of the request which Drupal has rudely mangled.
if (($_GET['cmd'] ?? '') == 'search') {
parse_str($_SERVER['QUERY_STRING'], $params);
$_GET['q'] = $params['q'] ?? '';
}