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

Have SlugHandler look up slugs automatically #8

Open
NightJar opened this issue May 10, 2019 · 0 comments
Open

Have SlugHandler look up slugs automatically #8

NightJar opened this issue May 10, 2019 · 0 comments

Comments

@NightJar
Copy link
Owner

Investigation issue.

If possible, it would be cool to have the SlugHandler try to pick default settings for itself if none are provided.
That is to say if no constructor argument is passed, nor is there any slug_trails config defined on the class it is applied to (or the data model thereof), perhaps it could look up for the settings in the extensions section for what relationship the Slug extension is applied to, and how it manages that. Assumptions would have to be made, or perhaps a default path could be generated? Unsure. Want to be careful of information leakage (e.g. exposing internal names of objects, which probably isn't that sensitive, but should at least be a consideration).

In the very least there should be a 404 thrown if no $slime is found, instead of generating an error:

[Warning] array_key_exists() expects parameter 2 to be array, null given
GET /some-page/some-slug
Line 103 in .../vendor/nightjar/ss-slug/src/SlugHandler.php
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

1 participant