-
Notifications
You must be signed in to change notification settings - Fork 226
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
FIX Tighten routing rule for userforms ping action #1224
FIX Tighten routing rule for userforms ping action #1224
Conversation
Can you please describe the perceived problem this change is intended to solve? I can't think of a scenario where this would be necessary? |
@GuySartorelli This is to prevent emergencies from visiting "/UserDefinedFormController" Versus |
It probably shouldn't error on any level of the structure, but why do you need to visit the URL of the controller? Does it happen when you submit a form that you made to be your homepage? |
After a quick play around, this happens even without any userform on the home page. There's a route in SilverStripe\Control\Director:
rules:
UserDefinedFormController//$Action: SilverStripe\UserForms\Control\UserDefinedFormController So, first step would be to find out what this route is even doing there in the first place. |
The premise of this PR is that a UserDefinedController is being loaded as the controller for a page that does not have a UserForm on it. The editor extension is missing. Simple as that. @tiller1010 I would suggest checking your
@GuySartorelli The confusion stems from the route being for a Page type controller, where no page is defined because it's a direct route. However the route URL controller defines "The page for If any commit should result from this error, I would guess that the route should probably more accurately be: SilverStripe\Control\Director:
rules:
UserDefinedFormController/ping:
Controller: SilverStripe\UserForms\Control\UserDefinedFormController
Action: ping I missed at the beginning of my reply that the controller is being called directly, with no action. What is the reason for this? I don't think it should happen. The second part of my reply deals more directly to that point. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of all of these changes, only the one in routes.yml seems necessary - that on its own resolves the issue.
I've also changed the target branch to |
648f308
to
00a25dc
Compare
00a25dc
to
237ad41
Compare
I've reset the commits and made the requested changes. Someone else will need to review this now, though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, I can still create and submit userforms
Had a look around, seems reasonable to limit this to just ping
ping is used here - https://github.com/silverstripe/silverstripe-userforms/blob/6/client/src/bundles/UserForms.js#L757
… UserDefinedForm
Closes #1223
Summary