magento / adobe-stock-integration

Magento Adobe Stock integration Community Project.
Open Software License 3.0
60 stars 92 forks source link

Uncaught Error: You cannot apply bindings multiple times to the same element. #84

Closed TomashKhamlai closed 5 years ago

TomashKhamlai commented 5 years ago

Preconditions:

  1. php bin/magento config:set adobe_stock/integration/enabled 1
  2. php bin/magento config:set adobe_stock/integration/api_key \<key>
  3. php bin/magento config:set cms/wysiwyg/enabled disabled
  4. php bin/magento config:set admin/security/admin_account_sharing 1
  5. php bin/magento config:set admin/security/use_form_key 0
  6. php bin/magento cache:flush

Steps to reproduce:

  1. Navigate to Content > Elements > Pages
  2. Click Add New Page button
  3. Fill Title with "Test CMS Page"
  4. Expand the "Content" section
  5. Fill Content Heading with "Test Content Heading"
  6. Click "Insert Image..." button
  7. Click "Cancel"
  8. Click "Insert Image..." button

Expected result:

:heavy_check_mark: JS works as expected

Actual result

:x: JS error in knockout.js::3287

Uncaught Error: You cannot apply bindings multiple times to the same element.
    at applyBindingsToNodeInternal (knockout.js:3287)
    at applyBindingsToNodeAndDescendantsInternal (knockout.js:3233)
    at Object.ko.applyBindings (knockout.js:3444)
    at _super (wrapper.js:73)
    at Object.applyBindings (bound-nodes.js:120)
    at Object.applyBindings (wrapper.js:78)
    at bindings.js:84
    at Array.forEach (<anonymous>)
    at jQuery.fn.init.$.fn.applyBindings (bindings.js:81)
    at panel.js:18
  applyBindingsToNodeInternal @ knockout.js:3287
  applyBindingsToNodeAndDescendantsInternal @ knockout.js:3233
  ko.applyBindings @ knockout.js:3444
  _super @ wrapper.js:73
  applyBindings @ bound-nodes.js:120
  (anonymous) @ wrapper.js:78
  (anonymous) @ bindings.js:84
  $.fn.applyBindings @ bindings.js:81
  (anonymous) @ panel.js:18
  (anonymous) @ main.js:31
  execCb @ require.js:1650
  context.execCb @ resolver.js:145
  check @ require.js:866
  enable @ require.js:1143
  init @ require.js:774
  (anonymous) @ require.js:1416
  setTimeout (async)    
  req.nextTick @ require.js:1755
  localRequire @ require.js:1405
  window.require @ mixins.js:245
  init @ main.js:24
  (anonymous) @ main.js:96
  .each..forEach @ underscore.js:150
  (anonymous) @ main.js:79
  apply @ main.js:76
  (anonymous) @ mage.js:98
  dispatch @ jquery.js:5232
  elemData.handle @ jquery.js:4884
  trigger @ jquery.js:5136
  jQuery.event.trigger @ jquery-migrate.js:633
  (anonymous) @ jquery.js:5866
  each @ jquery.js:376
  each @ jquery.js:142
  trigger @ jquery.js:5865
  (anonymous) @ browser.js:76
  fire @ jquery.js:3238
  fireWith @ jquery.js:3368
  done @ jquery.js:9846
  callback @ jquery.js:10317
  XMLHttpRequest.send (async)    
  send @ jquery.js:10260
  ajax @ jquery.js:9744
  openDialog @ browser.js:69
  onclick @ (index):1

Important

The bug caused by performing two requests for gallery data retrieving. Should be fixed in Magento 2 open source edition. We need to eliminate the second redundant request.

TomashKhamlai commented 5 years ago

Couldn't reproduce on clean Magento without extension.

sivaschenko commented 5 years ago

Fixed in https://github.com/magento/magento2/pull/23621