verbb / smith

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

Copy/Clone failing in Craft 3.4 #3

Closed ockam closed 4 years ago

ockam commented 4 years ago

Description

When trying to copy or clone a small matrix (only 1 type with 3 fields), I get an error:

Undefined index: type in /vendor/verbb/smith/src/controllers/FieldController.php:35

When looking at the log, the post contains numerous empty lines:

$_POST = [
    'field' => 'contenuCanal'
    'blocks' => [
        0 => [
            0 => '837'
        ]
        1 => [
            0 => ''
            1 => ''
            2 => ''
            [3 ... 834] <= see note below
            835 => ''
            836 => ''
            837 => [
                'type' => 'canal'
                'enabled' => '1'
                'fields' => [
                    'canal' => 'flash'
                    'titre' => ''
                    'texte' => '<p>Le club de football</p>'
                ]
            ]
        ]
    ]
]

Note: I removed lines in the sample for the sake of brevity but they’re all there in the log.

I know it was working at some point before I upgraded to Craft 3.4

I made a lot of changes while developing this section, if that may have an effect on this behavior.

Additional info

engram-design commented 4 years ago

Yep, you'll want to give the Craft 3.4-compatible version a go in 1.1.0