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
Incorrect behaviour after Product update with invalid public base URL #3028
Conversation
@mayorova it would be best if it will be the same as before otherwise it will break our automatic tests |
Apparently, at previous Formtastic versions the default inline_order was: But they have changed that into this: So, I propose to use the default inline_order to avoid more monkey patching @mayorova @JaurbanRH |
@@ -3,4 +3,4 @@ | |||
= semantic_form_for @service, url: admin_service_path(@service) do |form| | |||
= render partial: 'api/services/forms/integration_settings', locals: { form: form, service: @service } | |||
= form.actions do | |||
= form.commit_button 'Update Product', button_html: { name: 'update_settings' } | |||
= form.commit_button 'Update Product', button_html: { name: 'update_settings', value: 'true' } |
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.
Looks good but what does this do?
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.
It ensures that when the error occurs, it doesn't redirect to the edit template, as you can see here:
render action: params[:update_settings].present? ? :settings : :edit # edit page is only page with free form fields. other forms are less probable to have errors |
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.
So value: 'true'
is just to make #present?
return true in case there are no fields? Could you explain a little bit?
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.
Yes, this is another thing related to the Formtastic upgrade. At the previous version, that commit button was returning true
by default, but after the upgrade we have to add the value: 'true'
so the user stays at :settings
, which was part of the issue, the user being redirected to :edit
when sending the form with an invalid URL.
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.
This brings form to the behavior of master
so lets merge it. Investigate later the hiccup with validation when type of proxy is changed but invalid URLs set.
Fix Integration > Settings Incorrect behaviour after Product update with invalid public base URL
Fix Integration > Settings Incorrect behaviour after Product update with invalid public base URL
Fix Integration > Settings Incorrect behaviour after Product update with invalid public base URL
Which issue(s) this PR fixes
THREESCALE-8557 Incorrect behaviour after Product update with invalid public base URL
Verification steps