"Recipes" results tab not appearing for "Recipes" source

Created on 31 July 2024, 6 months ago
Updated 1 August 2024, 6 months ago

Problem/Motivation

Enabling the "Recipes" source should make the "Recipes" results tab available on the Project browser page after enabling the "Recipes" source from the settings, which is not happening.

Steps to reproduce

  1. On Drupal 11.x branch which is up to date.
  2. Clone or download the Project Browser module
  3. Enable the module and do a cache clear
  4. Go to module's settings page /admin/config/development/project_browser
  5. Enable for example "Drupal core" and "Drupal.org (mocked)" and save the form, and visit /admin/modules/browse, you will notice tabs will appear with no. of results for both these sources
  6. Now again go to the settings page and enable one more source Recipesand save the form and visit the Browse page again
  7. You will notice the "Recipes" tab won't appear and in addition to this your "Drupal core" and "Drupal.org (mocked)" tabs will disappear

Proposed resolution

๐Ÿ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia prashant.c Dharamshala

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

Merge Requests

Comments & Activities

  • Issue created by @prashant.c
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia hetal.solanki

    Hetal.Solanki โ†’ made their first commit to this issueโ€™s fork.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia hetal.solanki

    @Prashant.c

    After following your recommendations, I enabled Drupal.org (mocked) and Drupal Core, and I can see both tabs. Following that, I enabled recipes. I see all the tabs with the results; I've included a screenshot for reference. Please correct me if I'm incorrect on anything in this scenario.

    Thank you!!

  • Status changed to Closed: works as designed 6 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia narendraR Jaipur, India

    This seems to be a momentary issue which is fixed now. Please feel free to re-open if issue still persists.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sourav_paul Kolkata

    I've checked the issue, it's working as expected.

    Attaching SS:

  • Status changed to Active 6 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia prashant.c Dharamshala

    I am still facing this on the Drupal 11.xbranch and Project Browser 2.0.xbranch.

    Please see the attached video (MP4)
    https://www.drupal.org/files/issues/2024-08-01/project_browser%20_%20no_... โ†’
    or
    https://www.awesomescreenshot.com/video/30109604?key=65c4ed47642ae06794a...

    Re-opening the issue.

  • Status changed to Closed: works as designed 5 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sourav_paul Kolkata

    @Prashant.c I am not facing this issue on Drupal 11.0.0-rc1 and Project Browser 2.0.0-alpha2.
    Please find the screen recording with it.

    attaching my composer.json for your reference

    {
        "name": "drupal/recommended-project",
        "description": "Project template for Drupal projects with a relocated document root",
        "type": "project",
        "license": "GPL-2.0-or-later",
        "homepage": "https://www.drupal.org/project/drupal",
        "support": {
            "docs": "https://www.drupal.org/docs/user_guide/en/index.html",
            "chat": "https://www.drupal.org/node/314178"
        },
        "repositories": [
            {
                "type": "composer",
                "url": "https://packages.drupal.org/8"
            }
        ],
        "require": {
            "composer/installers": "^2.0",
            "drupal/admin_toolbar": "^3.5",
            "drupal/core-composer-scaffold": "^11",
            "drupal/core-project-message": "^11",
            "drupal/core-recommended": "^11",
            "drupal/project_browser": "^2.0@alpha",
            "drupal/upgrade_status": "^4.3",
            "drush/drush": "^13"
        },
        "conflict": {
            "drupal/drupal": "*"
        },
        "minimum-stability": "dev",
        "prefer-stable": true,
        "config": {
            "allow-plugins": {
                "composer/installers": true,
                "drupal/core-composer-scaffold": true,
                "drupal/core-project-message": true,
                "phpstan/extension-installer": true,
                "dealerdirect/phpcodesniffer-composer-installer": true,
                "php-http/discovery": true
            },
            "sort-packages": true
        },
        "extra": {
            "drupal-scaffold": {
                "locations": {
                    "web-root": "web/"
                }
            },
            "installer-paths": {
                "web/core": [
                    "type:drupal-core"
                ],
                "web/libraries/{$name}": [
                    "type:drupal-library"
                ],
                "web/modules/contrib/{$name}": [
                    "type:drupal-module"
                ],
                "web/profiles/contrib/{$name}": [
                    "type:drupal-profile"
                ],
                "web/themes/contrib/{$name}": [
                    "type:drupal-theme"
                ],
                "drush/Commands/contrib/{$name}": [
                    "type:drupal-drush"
                ],
                "web/modules/custom/{$name}": [
                    "type:drupal-custom-module"
                ],
                "web/profiles/custom/{$name}": [
                    "type:drupal-custom-profile"
                ],
                "web/themes/custom/{$name}": [
                    "type:drupal-custom-theme"
                ]
            },
            "drupal-core-project-message": {
                "include-keys": [
                    "homepage",
                    "support"
                ],
                "post-create-project-cmd-message": [
                    "<bg=blue;fg=white>                                                         </>",
                    "<bg=blue;fg=white>  Congratulations, youโ€™ve installed the Drupal codebase  </>",
                    "<bg=blue;fg=white>  from the drupal/recommended-project template!          </>",
                    "<bg=blue;fg=white>                                                         </>",
                    "",
                    "<bg=yellow;fg=black>Next steps</>:",
                    "  * Install the site: https://www.drupal.org/docs/installing-drupal",
                    "  * Read the user guide: https://www.drupal.org/docs/user_guide/en/index.html",
                    "  * Get support: https://www.drupal.org/support",
                    "  * Get involved with the Drupal community:",
                    "      https://www.drupal.org/getting-involved",
                    "  * Remove the plugin that prints this message:",
                    "      composer remove drupal/core-project-message"
                ]
            }
        },
        "require-dev": {
            "palantirnet/drupal-rector": "^0.20.3"
        }
    }
    

    Hence closing this...
    Feel free to open if you are still facing this issue..

  • Status changed to Active 5 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia prashant.c Dharamshala

    @Sourav_Paul, kindly try cloning and setting up Drupal 11 from the version control https://www.drupal.org/project/drupal/git-instructions โ†’ and switching to 11.x branch. Please confirm.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia prashant.c Dharamshala

    I tried to debug this and found it is throwing the following warning for the Recipes source

    Warning: Undefined array key "name" in Drupal\project_browser\Plugin\ProjectBrowserSource\Recipes->getProjects() (line 96 of modules/project_browser/src/Plugin/ProjectBrowserSource/Recipes.php).
    Drupal\project_browser\Plugin\ProjectBrowserSource\Recipes->getProjects(Array) (Line: 171)
    Drupal\project_browser\EnabledSourceHandler->doQuery(Array) (Line: 113)
    Drupal\project_browser\EnabledSourceHandler->getProjects(Array) (Line: 59)
    Drupal\project_browser\Controller\ProjectBrowserEndpointController->getAllProjects(Object)
    call_user_func_array(Array, Array) (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 593)
    Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 183)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
    Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 53)
    Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
    Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)
    Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 106)
    Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
    Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
    Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 709)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

    The actual error that is preventing the code from executing for Recipes source is the following:

    TypeError: Drupal\Component\Utility\Html::escape(): Argument #1 ($text) must be of type string, null given, called in /var/www/html/core/lib/Drupal/Component/Render/FormattableMarkup.php on line 256 in Drupal\Component\Utility\Html::escape() (line 431 of /var/www/html/core/lib/Drupal/Component/Utility/Html.php).

  • Status changed to Needs review 5 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia prashant.c Dharamshala

    Further debugging found that in some cases either name is empty which throws a warning and when the description is empty/NULL it throws 500error and prevents the results from loading.

    I temporarily fixed it by adding a condition to skip those rows where one of these values is empty, not sure if this would be a good fix or not, needs reviews.

  • Pipeline finished with Failed
    5 months ago
    Total: 559s
    #249313
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Kanchan Bhogade

    Hi
    I am not facing this issue on Drupal 11 and Project Browser 2.0.x
    Followed the recommended Steps to reproduce the issue

    Attaching screenshot for reference

  • Status changed to Postponed: needs info 5 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States chrisfromredfin Portland, Maine

    @prashant.c - you're saying this happens if you have bad locally-available recipes in your codebase? I'm not sure if PB needs to protect against bad recipes in this way or not... but even weirder, recipes are validated to have a name key...

    https://drupal.slack.com/archives/C01UHB4QG12/p1724858015514949?thread_t...

  • Status changed to Closed: works as designed about 2 months ago
  • ๐Ÿ‡ฆ๐Ÿ‡บAustralia pameeela

    Closing since Adam confirmed in Slack that recipes require a name key.

Production build 0.71.5 2024