verbb / smith

A Craft CMS plugin to add copy, paste and clone functionality to Matrix blocks.
MIT License
25 stars 9 forks source link

Can't copy more than 1 item. #10

Closed TC72 closed 4 years ago

TC72 commented 4 years ago

I'm running Craft CMS version 3.5.5 with Smith 1.1.6.

If I try to copy 1 unselected block it works fine, if I select blocks, even just 1 block then clicking copy does nothing. Console shows this error:

smith.js:240 Uncaught TypeError: n.parents is not a function
    at s.constructor._serializeBlocks (smith.js:240)
    at s.constructor.copyBlock (smith.js:147)
    at s.constructor.onOptionSelect (smith.js:114)
    at Object.o [as handler] (jquery.js:10771)
    at s.constructor.trigger (garnish.js:830)
    at s.constructor.selectOption (garnish.js:3468)
    at s.constructor.<anonymous> (garnish.js:3345)
    at s.constructor.<anonymous> (garnish.js:893)
    at HTMLAnchorElement.o (jquery.js:10771)
    at HTMLAnchorElement.dispatch (jquery.js:5429)
_serializeBlocks @ smith.js:240
copyBlock @ smith.js:147
onOptionSelect @ smith.js:114
o @ jquery.js:10771
trigger @ garnish.js:830
selectOption @ garnish.js:3468
(anonymous) @ garnish.js:3345
(anonymous) @ garnish.js:893
o @ jquery.js:10771
dispatch @ jquery.js:5429
v.handle @ jquery.js:5233
engram-design commented 4 years ago

Should be fixed in 1.1.7