Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.x] Redirect from com_component_name to com_componentname when clicking a component's toolbar button #44387

Open
maggus opened this issue Oct 31, 2024 · 5 comments

Comments

@maggus
Copy link

maggus commented Oct 31, 2024

Steps to reproduce the issue

  • Build a native, simple Joomla! 5 component with name com_component_name
  • Use a toolbar button in backend: New, Edit, Close, Cancel, whatever...

Expected result

  • User should probably be redirected to a com_component_name view

Actual result

  • User will be redirected to a com_componentname view that does not exist

System information (as much as possible)

  • Joomla 5.2.0
  • PHP 8.2.12

Additional comments

Hi 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!

@HLeithner
Copy link
Member

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?

@maggus
Copy link
Author

maggus commented Nov 1, 2024

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&amp;layout=edit&amp;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.

@HLeithner
Copy link
Member

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.

@HLeithner
Copy link
Member

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?

@MacJoom
Copy link
Contributor

MacJoom commented Nov 7, 2024

I have a component with an underscore in the name and the Toolbar works fine. We need your code to check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants