Drupal 9 compatibility, deprecated code

Created on 30 September 2020, over 3 years ago
Updated 25 March 2024, 3 months ago

Problem/Motivation

Aside from adding "core_version_requirement: ^8 || ^9" in the info.yml file, the module appears to be using db_query() - a deprecated function in Drupal 9. When I attempted to perform a search, I got the following error message:

An AJAX HTTP error occurred.
Path: /imce
HTTP Result Code: 200
StatusText: OK
ResponseText: Error: Call to undefined function Drupal\imce_search_plugin\Plugin\ImcePlugin\db_query() in Drupal\imce_search_plugin\Plugin\ImcePlugin\Search->opSearch() (line 43 of /PATH/TO/modules/contrib/imce_search/src/Plugin/ImcePlugin/Search.php).

🐛 Bug report
Status

RTBC

Version

1.0

Component

Code

Created by

🇺🇸United States JasonLuttrell Washington, DC area

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
  • 🇦🇷Argentina nexonOSX

    Found an issue with request which trow the following error:

    Symfony\Component\HttpKernel\Exception\BadRequestHttpException: Input value "data" contains a non-scalar value. in Symfony\Component\HttpKernel\HttpKernel->handle() (line 83 of /var/www/html/vendor/symfony/http-kernel/HttpKernel.php).

    So for this I refactored the way how is obtained the keywords parameter on the request, so it first get all paramenters and then validate if the keyword exist.

    so from:

        $keywords = $fm->request->request->get('data')['keywords'];
    
    

    To:

      $receivedData = $fm->request->request->all();
        $data = $receivedData['data'];
        $keywords = '';
        if (is_array($data) && isset($data['keywords'])) {
            $keywords = $data['keywords'];
        }
    

    This on the current fork.

Production build 0.69.0 2024