Skip to content

Commit

Permalink
magento-engcom/import-export-improvements#58: Fix generation of impor…
Browse files Browse the repository at this point in the history
…t url

 - update the building of import url in before.phtml
 - check that we do not already have the form_key in our url,
 - build the newActionUrl first so that we always are using the same url to build the url
  • Loading branch information
dmanners committed Jun 16, 2018
1 parent 2910d8b commit 10ce88b
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,13 @@ require([
.loader('show');
var form = jQuery('#edit_form')
.one('invalid-form.validate', function(e){jQuery('body').loader('hide')});
newActionUrl = (newActionUrl ? newActionUrl : form.attr('action')) +
(form.attr('action').lastIndexOf('?') != -1 ? '&' : '?')+
'form_key=' + encodeURIComponent(form.find('[name="form_key"]').val());

newActionUrl = (newActionUrl ? newActionUrl : form.attr('action'));
if (newActionUrl.lastIndexOf('form_key') === -1) {
newActionUrl = newActionUrl +
(newActionUrl.lastIndexOf('?') !== -1 ? '&' : '?') +
'form_key=' + encodeURIComponent(form.find('[name="form_key"]').val());
}

form.trigger('save', [{
action: newActionUrl,
Expand Down

0 comments on commit 10ce88b

Please sign in to comment.