No Code Attached Yet
avatar ThomasFinnern
ThomasFinnern
25 Jul 2025

Problem identified

When i want to see the configuration parameters of my rsgallery2 extension (just alive but barely working) then i get a resource not not found

When i call curl apiPath: 'v1/config/com_rsgallery2' then it responds with

{
    "errors": [
        {
            "title": "Resource not found",
            "code": 404
        }
    ]
}

I found the error in file plugins/webservices/config/src/Extension/Config.php at the end

new Route(['GET'], 'v1/config/:component_name', 'component.displayList', ['component_name' => '([A-Za-z_]+)'], $getDefaults),
new Route(['PATCH'], 'v1/config/:component_name', 'component.edit', ['component_name' => '([A-Za-z_]+)'], $defaults),

Proposed solution

The regex [A-Za-z_] should be [A-Za-z0-9_] on both lines
It has worked on my tests

Open questions

avatar ThomasFinnern ThomasFinnern - open - 25 Jul 2025
avatar joomla-cms-bot joomla-cms-bot - change - 25 Jul 2025
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 25 Jul 2025
avatar brianteeman
brianteeman - comment - 25 Jul 2025

My question would be is that regex an oversight or was there a specific reason it was restricted to alpha

avatar ThomasFinnern
ThomasFinnern - comment - 25 Jul 2025

It is checking the component name. So are component names with numbers allowed in joomla ?

avatar dgrammatiko
dgrammatiko - comment - 27 Jul 2025

My question would be is that regex an oversight or was there a specific reason it was restricted to alpha

The restriction is: component names could not start with number

avatar brianteeman
brianteeman - comment - 27 Jul 2025

so a better regex would be https://regex101.com/r/FYHAN9/1 ?

avatar ThomasFinnern
ThomasFinnern - comment - 28 Jul 2025

@brianteeman Your solution would allow numbers at the end which would suffice my extension name ;-)

In this particulat point of regex using we can allow the first solution. WE expect that the component is already installed and there is no need to restrict to "no number" at the start of the of the string

avatar brianteeman
brianteeman - comment - 28 Jul 2025

from what @dgrammatiko said I am assuming that the restriction already exists preventing extensions being installed beginning with a number. Someone would need to review the code to verify that

avatar ThomasFinnern
ThomasFinnern - comment - 28 Jul 2025

Just for info: i do remember component "j2xml" which can be found in JED

Add a Comment

Login with GitHub to post a comment