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

Cannot use _path in Form URLs #18205

Open
Eriknag opened this issue Feb 24, 2025 · 0 comments
Open

Cannot use _path in Form URLs #18205

Eriknag opened this issue Feb 24, 2025 · 0 comments
Assignees
Labels
Milestone

Comments

@Eriknag
Copy link

Eriknag commented Feb 24, 2025

Description

When you provide a Form URL with a _path as array option the Form still autofills plugin, controller and action.
This results in an Exception later on, when Router::unwrapShortString checks for unwanted array options.

The bug can be fixed by adding _path to the check in FormHelper::_formUrl. For example:

        if (
            is_string($options['url']) ||
            (
                is_array($options['url']) &&
                    (
                        isset($options['url']['_name']) ||
                        isset($options['url']['_path'])
                    )
            )
        ) {
            return $options['url'];
        }

CakePHP Version

5.x

PHP Version

No response

@Eriknag Eriknag added the defect label Feb 24, 2025
@dereuromark dereuromark added this to the 5.1.7 milestone Feb 24, 2025
@markstory markstory self-assigned this Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants