Open scott-nz opened 5 years ago
Can you please share the relevant module versions you’re using?
Issue identified with following version silverstripe-elemental-userforms: 2.1.2 silverstripe-elemental: 1.0.0
Same issue exists when using the following versions: silverstripe-elemental-userforms: 3.0.x-dev, 3.0.0 silverstripe-elemental: 4.1.x-dev, 4.0.3 these versions were tested using https://github.com/silverstripe/cwp-recipe-kitchen-sink
Pretty sure this is generic to most/all blocks types in that it doesn't carry things across.
Just encountered this, the fields are duplicated in the database but they’re not assigned to the new block. $this->owner->ID
is 0
when it attempts to clone the fields here:
My very naïve workaround for now is this:
<?php
namespace App\Extensions\Elements;
use SilverStripe\Core\Extension;
class ElementFormExtension extends Extension
{
public function onBeforeDuplicate()
{
$this->owner->write();
}
}
When duplicating a page that contains a user form block, the block is created on the new page but it contains no form fields.
Steps to reproduce: Add user form block to a page Add form fields to the form block Publish Form and page Duplicate page Form block is created but contains no form fields
When duplicating a page, the content of other elemental blocks appears to be duplicated correctly