diff --git a/core-bundle/src/Resources/contao/dca/tl_page.php b/core-bundle/src/Resources/contao/dca/tl_page.php index 563753f9e33..ff5b44f24cb 100644 --- a/core-bundle/src/Resources/contao/dca/tl_page.php +++ b/core-bundle/src/Resources/contao/dca/tl_page.php @@ -1461,7 +1461,7 @@ public function pastePage(DataContainer $dc, $row, $table, $cr, $arrClipboard=nu } // Prevent adding non-root pages on top-level - if ($row['pid'] == 0 && Input::get('mode') != 'create') + if (empty($row['pid']) && Input::get('mode') != 'create') { $objPage = $this->Database->prepare("SELECT * FROM " . $table . " WHERE id=?") ->limit(1) diff --git a/core-bundle/src/Resources/contao/drivers/DC_Table.php b/core-bundle/src/Resources/contao/drivers/DC_Table.php index 7291a2d03c2..7cbc268ba7b 100644 --- a/core-bundle/src/Resources/contao/drivers/DC_Table.php +++ b/core-bundle/src/Resources/contao/drivers/DC_Table.php @@ -3667,7 +3667,7 @@ protected function treeView() $_buttons = ' '; // Show paste button only if there are no root records specified - if ($blnClipboard && ($GLOBALS['TL_DCA'][$this->strTable]['list']['sorting']['mode'] ?? null) == 5 && ((empty($GLOBALS['TL_DCA'][$table]['list']['sorting']['root']) && $GLOBALS['TL_DCA'][$table]['list']['sorting']['root'] !== false) || ($GLOBALS['TL_DCA'][$table]['list']['sorting']['rootPaste'] ?? null)) && Input::get('act') != 'select') + if ($blnClipboard && ($GLOBALS['TL_DCA'][$this->strTable]['list']['sorting']['mode'] ?? null) == 5 && ((empty($GLOBALS['TL_DCA'][$table]['list']['sorting']['root']) && ($GLOBALS['TL_DCA'][$table]['list']['sorting']['root'] ?? null) !== false) || ($GLOBALS['TL_DCA'][$table]['list']['sorting']['rootPaste'] ?? null)) && Input::get('act') != 'select') { // Call paste_button_callback (&$dc, $row, $table, $cr, $childs, $previous, $next) if (\is_array($GLOBALS['TL_DCA'][$this->strTable]['list']['sorting']['paste_button_callback'] ?? null))