- πΊπΈUnited States crutch
This patch applies to 2.0.x-dev, however I'm not getting the results as expected, but I may not have the configuration correct
example 1 when using
instructor-resources|access-denied-403 (this works)
instructor-resources/unit-01|access-denied-403 (this is not working, even without patch)example 2 when using
instructor-resources|access-denied-403 (this works)
instructor-resources/*|access-denied-403 (this is not working) - Status changed to Needs work
almost 2 years ago 6:06pm 18 April 2023 - πΊπΈUnited States ikphilip Charlotte, NC, USA
When all paths are prefixed with a forward-slash (/) the matchPath function works as expected. Therefore the documentation for user input should be updated.
Upon further investigation I've found with release 2.0.0 (no patch) paths that aren't prefixed with forward-slash do not work correctly. I think that the input description (src/Form/PagesRestrictionSettingsForm.php:64) is incorrect. It also conflicts with the example configuration screenshot on the project landing page.
All this to say, we'll want a new patch that updates the description and either upgrades the stored paths or prefixes paths with a forward slash if none is found.
- πΊπΈUnited States ikphilip Charlotte, NC, USA
Updated patch #6:
- Uses PathMatcher::matchPath() method.
- Adds and utilizes a preparePath() method in src/Event/PagesRestrictionSubscriber.php which in addition to filtering and trimming the URL now prefixes the path with a forward-slash. This should suffice so that URLs which match the instructions work properly. This method is also called in src/Event/PagesRestrictionSubscriber.php in cases where paths were filtered and trimmed.
- Status changed to Needs review
almost 2 years ago 6:41pm 18 April 2023 - πΊπΈUnited States crutch
Thank you ikphilip. I have tried the patch on localhost dev http://localhost/bnd91/web/ and have some results.
1. When using only this 1 entry in the general settings
/educational-resources/elearning/what-does-it-mean-have-cgmp-mindset|access-denied-403
- It seems to be working for using or not using the forward slash in front
- URL structures are also now working.
- when forwarding to access denied page it is going to localhost/access-denied-403 which doesn't exist. It may need a base path so it will go to http://localhost/bnd91/web/access-denied-403
- flushing all caches seem to assure that new settings are current2. Test if access denied is unique by forwarding to home page
/educational-resources/elearning/what-does-it-mean-have-cgmp-mindset|home
- results are the same, when forwarding to home it is going to localhost/home.
3. Test a url structure to a target with a url structure
/educational-resources/elearning/molarity|life-science-degree-programs/medical-laboratory-technology
- url structures seem to work correctly on both sides of the setting
- has same base path issue in #1 and 2
- unsure about using a forward slash at the front of the target4. Test wildcard
- This works correctly
- has same base path issue in #1 and 25. Test allow roles to bypass
- Works correctly