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

Custom Route Generator not being called properly. #7318

Open
matthiasseghers opened this issue Mar 20, 2024 · 0 comments
Open

Custom Route Generator not being called properly. #7318

matthiasseghers opened this issue Mar 20, 2024 · 0 comments
Labels
Bug Error or unexpected behavior of already existing functionality

Comments

@matthiasseghers
Copy link

Q A
Sulu Version 2.5.10
PHP Version 8.2.5

Actual Behavior

When the sulu_route mapping is set to use the type generator, is still uses the default generator instead.

Expected Behavior

It appears that the generator-type isn't utilized here, as the default one is always used during automatic generation. Currently, there isn't a satisfactory solution for this since Normal route generation depends on the entity, which isn't accessible in the "api" call.
The generator used should be the one defined under the generator key, and the generate method should be called.

Steps to Reproduce

sulu_article.yaml

sulu_route:
    mappings:
        Sulu\Bundle\ArticleBundle\Document\ArticleDocument:
            generator: "type"
            options:
                blog: /blog/{implode("-", object)}
                guide: /guides/{implode("-", object)}

The ArtilceRouteGeneratorByType class will never be called by it's generate method, and instead the default one route generation will be called.

@matthiasseghers matthiasseghers added the Bug Error or unexpected behavior of already existing functionality label Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Error or unexpected behavior of already existing functionality
Projects
None yet
Development

No branches or pull requests

1 participant