Project detail page is throwing an exception

Created on 19 June 2024, 5 months ago
Updated 14 August 2024, 3 months ago

I have not identified a clear pattern yet but the /admin/modules/browse/{module_name} route is throwing the following exception:

ModulePage.svelte:102 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'title')
    at create_fragment$1 (ModulePage.svelte:102:48)
    at init (index.mjs:1891:37)
    at new ModulePage (ModulePage.svelte:55:59)
    at Array.create_if_block_2 (App.svelte:53:23)
    at create_then_block (App.svelte:53:23)
    at update (index.mjs:1385:51)
    at index.mjs:1420:13

The mocked Drupal.org source is working as expected if it is the only source. But if I enable the Recipes source (for example) and I try to access one project detail page, I face the exception.

Steps to reproduce:

  • Enable project browser
  • Enable Drupal (mocked) and Recipes sources
  • On project browser page, click any project listed by Drupal (mocked)
🐛 Bug report
Status

Closed: outdated

Version

2.0

Component

Code

Created by

🇫🇷France vbouchet

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

Merge Requests

Comments & Activities

  • Issue created by @vbouchet
  • 🇫🇷France vbouchet

    As per my investigation, this is because the Recipes source is not updating the number of result.

    Object.entries(data).forEach((item) => {
      const [source, result] = item;
      if (result.totalResults !== 0) {
        $activeTab = source;
        [project] = result.list;
        projectExists = true;
      }
    });
    

    The JS behind /admin/modules/browse/{module_name} still invokes all the source plugins but expect only one source to return results.

    Globally, I think the JS should be aware of the active source tab so other sources can act appropriately:
    - In case it is the /browser, run a lightweight query as the goal is only to know the number of projects matching the criteria.
    - In case it is the /browser/{project_name}, don't do anything

  • Status changed to Needs review 5 months ago
  • 🇫🇷France vbouchet

    The suggested commit is not reworking the global implementation, just fixing the way total is counted in the Recipe sources so it does count only after filtering is applied.

  • Pipeline finished with Success
    5 months ago
    Total: 932s
    #202980
  • 🇮🇳India Kanchan Bhogade

    Hi
    I've tried to reproduce the issue on Drupal 11.x
    But the Project detail page is working as expected without any error.
    I followed the same steps as mentioned in the summary to reproduce the issue, please let me know if I'm missing something

  • 🇮🇳India vinmayiswamy

    +1 to #5. I have also tried to reproduce the issue on Drupal versions 10.2.x and 11.x by following the steps outlined in the summary. However, the project details page is functioning as expected and does not throw any exceptions as described in the issue summary.

    @vbouchet, please advise if we might have missed something.

    Thanks!

  • 🇫🇷France vbouchet

    I will try to check but given the recent change in the js, it is possible the issue is not here anymore.

    However, the suggested code change is still valid, the recipes source plugin is setting the $total before doing the filtering.

  • 🇮🇳India prashant.c Dharamshala

    Prashant.c changed the visibility of the branch 3455715-project-detail-page to hidden.

  • 🇮🇳India prashant.c Dharamshala

    Prashant.c changed the visibility of the branch 3455715-project-detail-page to active.

  • Status changed to Closed: outdated 3 months ago
  • 🇺🇸United States chrisfromredfin Portland, Maine

    The current MR has no changes to the active codebase, which I think means that this fix was implemented in a different issue, and this is Closed (Outdated).

    If someone disagrees, you can open a new (related) issue.

Production build 0.71.5 2024