Only return categories for the current source being displayed

Created on 22 January 2025, 5 days ago

Problem/Motivation

Enable "Contrib modules" and "Core modules" plugins.

Visit the "Extend > Browse" page and open the developer tools. There are two ajax calls, one for modules and one for categories. We can see that the project-browser/data/categories returns data for the two enabled plugins instead of the one being viewed.

Proposed resolution

Only return categories for the current plugin being displayed.

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ͺπŸ‡ΈSpain fjgarlin

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

Merge Requests

Comments & Activities

  • Issue created by @fjgarlin
  • First commit to issue fork.
  • πŸ‡¬πŸ‡ͺGeorgia gprtskh
  • Pipeline finished with Failed
    2 days ago
    Total: 453s
    #405741
  • Pipeline finished with Success
    2 days ago
    Total: 342s
    #405769
  • πŸ‡¬πŸ‡ͺGeorgia iamdroid

    Hi folks, I am going to review it as part of GlobalContributionWeekend2025

  • πŸ‡¬πŸ‡ͺGeorgia iamdroid

    I have reviewed the code and tested the actual behavior before and after the changes:

    1. The changes were tested on Drupal CMS 1.0.1 and Project Browser 2.0.x
    2. The changes were applied by obtaining the module version from the issue fork.
    3. The module installation process went fine
    4. There were no issues in Drupal log and browsers console
    5. endpoint response before:
      
      {
        "drupalorg_jsonapi": [
          {
            "id": "24830916-5c07-4446-89de-960915f87bf6",
            "name": "Access control"
          },
          {
            "id": "3df293b3-c9a1-4232-962b-3c8169e8e6e3",
            "name": "Accessibility"
          },
          {
            "id": "abf23828-f269-4d39-8589-b731209eb154",
            "name": "Administration tools"
          },
          {
            "id": "81212413-80b0-44d6-84fb-9078baa7ab25",
            "name": "Automation"
          },
          {
            "id": "754c04cb-6da2-42ba-9032-d64307f68f45",
            "name": "Content display"
          },
          {
            "id": "86237004-3801-40cf-96b5-fe7d60efccb5",
            "name": "Content editing experience"
          },
          {
            "id": "f1ca6464-1608-47fd-be11-1a398e6c9424",
            "name": "Decoupled"
          },
          {
            "id": "086cebcf-200f-4c34-886e-f9921919b292",
            "name": "Developer tools"
          },
          {
            "id": "0cd80c8e-5c20-43a8-aa3e-ec701007d443",
            "name": "E-commerce"
          },
          {
            "id": "cfef5e6a-b77b-4a2b-b669-e87b1266f3ac",
            "name": "Import and export"
          },
          {
            "id": "3322058a-a158-4806-ac5b-9bcabc95edac",
            "name": "Integrations"
          },
          {
            "id": "68428c33-1db7-438d-b1b3-e23004e0982b",
            "name": "Media"
          },
          {
            "id": "3cf38e0a-d4b1-426d-9b8e-008e7a41cf8d",
            "name": "Multilingual"
          },
          {
            "id": "d1322ab4-e2be-4f21-9e01-8c19b3da8bea",
            "name": "Performance"
          },
          {
            "id": "01df2105-2397-4a0e-b34c-80da1c3b1208",
            "name": "Search engine optimization (SEO)"
          },
          {
            "id": "8117d8b0-f171-414d-b384-0bafa81bef9f",
            "name": "Security"
          },
          {
            "id": "8d7b9b34-6ae2-4e9b-b3a2-f0bb3109500a",
            "name": "Site search"
          },
          {
            "id": "dcb48e9f-6afa-4842-8ef6-44b90b083fcc",
            "name": "Site structure"
          },
          {
            "id": "7c5db130-79b8-4130-a09c-c197333e7d13",
            "name": "User engagement"
          }
        ],
        "drupal_core": [
          {
            "name": "Core",
            "id": "Core"
          },
          {
            "name": "Core (Experimental)",
            "id": "Core (Experimental)"
          },
          {
            "name": "Field types",
            "id": "Field types"
          },
          {
            "name": "Migration",
            "id": "Migration"
          },
          {
            "name": "Multilingual",
            "id": "Multilingual"
          },
          {
            "name": "Web services",
            "id": "Web services"
          }
        ],
        "recipes": []
      }
      

      endpoint response after:

      [
        {
          "id": "24830916-5c07-4446-89de-960915f87bf6",
          "name": "Access control"
        },
        {
          "id": "3df293b3-c9a1-4232-962b-3c8169e8e6e3",
          "name": "Accessibility"
        },
        {
          "id": "abf23828-f269-4d39-8589-b731209eb154",
          "name": "Administration tools"
        },
        {
          "id": "81212413-80b0-44d6-84fb-9078baa7ab25",
          "name": "Automation"
        },
        {
          "id": "754c04cb-6da2-42ba-9032-d64307f68f45",
          "name": "Content display"
        },
        {
          "id": "86237004-3801-40cf-96b5-fe7d60efccb5",
          "name": "Content editing experience"
        },
        {
          "id": "f1ca6464-1608-47fd-be11-1a398e6c9424",
          "name": "Decoupled"
        },
        {
          "id": "086cebcf-200f-4c34-886e-f9921919b292",
          "name": "Developer tools"
        },
        {
          "id": "0cd80c8e-5c20-43a8-aa3e-ec701007d443",
          "name": "E-commerce"
        },
        {
          "id": "cfef5e6a-b77b-4a2b-b669-e87b1266f3ac",
          "name": "Import and export"
        },
        {
          "id": "3322058a-a158-4806-ac5b-9bcabc95edac",
          "name": "Integrations"
        },
        {
          "id": "68428c33-1db7-438d-b1b3-e23004e0982b",
          "name": "Media"
        },
        {
          "id": "3cf38e0a-d4b1-426d-9b8e-008e7a41cf8d",
          "name": "Multilingual"
        },
        {
          "id": "d1322ab4-e2be-4f21-9e01-8c19b3da8bea",
          "name": "Performance"
        },
        {
          "id": "01df2105-2397-4a0e-b34c-80da1c3b1208",
          "name": "Search engine optimization (SEO)"
        },
        {
          "id": "8117d8b0-f171-414d-b384-0bafa81bef9f",
          "name": "Security"
        },
        {
          "id": "8d7b9b34-6ae2-4e9b-b3a2-f0bb3109500a",
          "name": "Site search"
        },
        {
          "id": "dcb48e9f-6afa-4842-8ef6-44b90b083fcc",
          "name": "Site structure"
        },
        {
          "id": "7c5db130-79b8-4130-a09c-c197333e7d13",
          "name": "User engagement"
        }
      ]
      
    6. Filtering is working as expected.

    Everything looks good to me, thanks, RTBC.

  • πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

    This change is fine, but I think we might want to close it, and not commit it (although we should definitely transfer credit) in favor of πŸ“Œ Project Browser makes a pointless API request for categories Active , which will obviate this entirely.

Production build 0.71.5 2024