From b5895940106cce02f6f7a6b064fea44dc673f822 Mon Sep 17 00:00:00 2001 From: Thomas Templeton Date: Wed, 6 Feb 2019 11:37:20 +1100 Subject: [PATCH] Fix paste/clone issue with number field values not being retained --- src/services/Blocks.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/services/Blocks.php b/src/services/Blocks.php index ce9732fd..398a12c5 100644 --- a/src/services/Blocks.php +++ b/src/services/Blocks.php @@ -91,7 +91,9 @@ public function renderTabs(Block $block, bool $static = false, $namespace = null $newNamespace = $namespace . '[__NEOBLOCK__][fields]'; $viewService->setNamespace($newNamespace); - $isNewBlock = $block->id === null; + // Ensure that this block is actually new, and not just a pasted or cloned block + // New blocks won't have their levels set at this stage, whereas they will be set for pasted/cloned blocks + $isNewBlock = $block->id === null && $block->level === null; $tabsHtml = [];