Searching for a .php file causes a 5xx error

Created on 12 July 2024, 9 months ago
Updated 31 July 2024, 9 months ago

Problem/Motivation

Searching for a file with a .php extension causes a 5xx error.

Steps to reproduce

  • On the search field enter Color.php. The autocomplete will show a single value, since there is a perfect match with a filename.
  • Click on the value shown by the autocomplete.
  • Click on the Search button.
  • The search block will redirect to https://api.drupal.org/api/drupal/11.x/search/Color.php.
  • The site will show the following error.

5xx Server Error

Drupal.org's servers encountered an error handling your request. Please try again in a few moments.

I tried from a private windows too, just to exclude it is caused from some extension, but it still happened.
I tried entering just Color. (period included), but the result is the same.
I tried entering index.php, but in this case I got the search page showing three results in Exact matches and four results in All search results.

🐛 Bug report
Status

Fixed

Version

2.0

Component

User interface

Created by

🇮🇹Italy apaderno Brescia, 🇮🇹

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

Comments & Activities

  • Issue created by @apaderno
  • Status changed to RTBC 9 months ago
  • 🇪🇸Spain fjgarlin

    Thanks for reporting.

    Checking the logs, we get:

    InvalidArgumentException: $string ("") must be a string. in Drupal\Core\StringTranslation\TranslatableMarkup->__construct() (line 132 of /app/web/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php).
    
    Backtrace	
    #0 /app/web/modules/contrib/api/src/Controller/SearchController.php(297): Drupal\Core\StringTranslation\TranslatableMarkup->__construct()
    #1 [internal function]: Drupal\api\Controller\SearchController->searchListingPage()
    ...
    

    Funnily enough, I was doing some clean up today and I fixed that in this commit: https://git.drupalcode.org/project/api/-/commit/e0c74f4e0d5fe7e5b413cc24...

    I will be deploying the fix tomorrow.

  • 🇮🇹Italy apaderno Brescia, 🇮🇹

    I apologize I did not report this earlier: The other time I notice this, drupal.org returned 5xx errors for external causes, and I thought that was happening on api.drupal.org too.

  • Status changed to Fixed 9 months ago
  • 🇪🇸Spain fjgarlin

    No need to apologize. I really appreciate the reporting/commeting/etc whenever it happens. With the transition to the new systems sometimes it's hard to tell whether it's an infra problem or a code problem.

    In any case, this was a code issue, it has been now fixed and deployed to production.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024