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),
The regex [A-Za-z_] should be [A-Za-z0-9_] on both lines
It has worked on my tests
Labels |
Added:
No Code Attached Yet
|
It is checking the component name. So are component names with numbers allowed in joomla ?
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
so a better regex would be https://regex101.com/r/FYHAN9/1 ?
@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
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
Just for info: i do remember component "j2xml" which can be found in JED
My question would be is that regex an oversight or was there a specific reason it was restricted to alpha