-
Notifications
You must be signed in to change notification settings - Fork 79
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
WIP: FIX Existing URL query strings should be preserved #824
WIP: FIX Existing URL query strings should be preserved #824
Conversation
|
||
if (schemaUrl.indexOf('?') !== false) { | ||
const questionMarkIndex = schemaUrl.indexOf('?'); | ||
urlQueryString = schemaUrl.substring(questionMarkIndex + 1) + (urlQueryString || ''); |
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.
There's potential for a missing &
here.
12334ac
to
fc09101
Compare
I think this problem isn't limited to asset admin - as I'm having a very similar issue with recent history viewer work in elemental. Perhaps this is not the right place to fix this. I'm going to mark this as WIP until I figure out what's going on. |
Yeah, just reproduced on elemental as well. I think this could be a problem solved outside of this module |
It's worth noting that the backend counterpart for this code isn't really expecting to return any query strings, so we could probably just strip them off and ignore them. It'd be much better to return data in the schema body than in the URL for it |
Related: silverstripe/silverstripe-admin#607 |
FWIW I'm experiencing this behaviour when using Better Navigator. It provides an 'edit in CMS' button that appends a stage param to it's link (eg |
This should be fixed by silverstripe/silverstripe-versioned#173 now. |
Currently when adding an upload field to the CMS fields of a versioned object it's possible that the "createFileEndpoint" may be provided with URL query params - eg. from
VersionedStateExtension
. This PR makes sure any existing query is preserved (and prevents things like/my/base/link?stage=Stage/2
).