com_component_name
com_component_name
viewcom_componentname
view that does not existHi there! I am not sure if this is a bug. I have migrated a component whose former name was of type com_component_name
. As you can see there is a second underscore in the component's name. Thus, the component does not meet Joomla's naming convention for components. However, this was working fine for a Joomla 3 component. But now, on Joomla 5, there is a redirect to com_componentname
views when hitting any toolbar button in the component's backend.
Is this intended by design or is this a possible bug in the routing system?
Thank you for your feedback!
Labels |
Added:
No Code Attached Yet
|
Hi @HLeithner!
Thank you for your answer!
If you ask for the outputted form parameters, they seem to be correct:
<form action="/orthos/administrator/index.php?option=com_orthos_doctors&layout=edit&id=783" method="post" name="adminForm" id="adminForm" class="form-validate">
And this is the response header after submitting:
HTTP/1.1 303 See other
Date: Fri, 01 Nov 2024 16:03:08 GMT
Server: Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.2.12
Referrer-Policy: unsafe-url
X-Powered-By: PHP/8.2.12
Location: http://localhost/orthos/administrator/index.php?option=com_orthosdoctors&view=doctors
Expires: Wed, 17 Aug 2005 00:00:00 GMT
Last-Modified: Fri, 01 Nov 2024 16:03:09 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Length: 0
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=utf-8
Not sure, if this is helpful.
However, when renaming the component from com_component_name
to com_componentname
, all redirects are correct and existing.
I will bring this to the next Maintainers meeting in 2 weeks, I'm not 100% sure if it's a bug we want to solve since, as you said, it doesn't full fill the naming convention.
ok, we discussed this in the maintainer meeting and would like to support _ in component name, but we can't replicate your issue.
so maybe you can provide a simple component where this issue happens?
I have a component with an underscore in the name and the Toolbar works fine. We need your code to check.
Labels |
Added:
Information Required
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2024-11-26 17:23:26 |
Closed_By | ⇒ | Hackwar |
Since there was no response in the last 3 weeks, I'm closing this one. If you still have the issue, please open a new ticket and reference this one here.
Dear Harald!
Dear Martin!
Thank you for your comprehensive feedback!
I'm sorry for my late reply. I still have this issue, yes.
@MacJoom Is it possible to have a look into your extension that works fine with an underscore in its name? I have renamed my extension and therefore don't have a working copy any more to reproduce this issue.
@HLeithner Do you still have a copy of your component with additional underscores? If you can't replicate my issue I will maybe find the issue on my side with help of your boilerplate component.
Anyway, thank you very much for discussing it and testing it.
Hi @HLeithner,
Hi @MacJoom,
I have finally figured out what the problem has been.
Controllers like FormController
use ComponentHelper::getComponentName
to guess the component's name. They extract the part in question from the namespace.
While this works fine for component names with scheme com_componentname
it will always fail for names with scheme com_component_name
as the corresponding namespace won't have any underscores in its name.
The solution is to explicitly set the $option
variable.
From my point of view this should be stated clearly in the Joomla! Programmers Documentation if not done yet.
Thank you!
From my point of view this should be stated clearly in the Joomla! Programmers Documentation if not done yet.
@maggus Can you update the Manual?
Good question, the option parameter is filtered normally with the
CMD
filter which actually allows_
, have you tracked down where the redirect is happening? is the parameter in the form right?