Project

General

Profile

Actions

Bug #87677

closed

Pasting content element to page does not work

Added by Philipp Seiler almost 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
-
Target version:
-
Start date:
2019-02-08
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
gridelements,paste,clipboard,copy,datahander,controller
Complexity:
Is Regression:
Sprint Focus:

Description

  1. Copy any content element like textmedia from page A.
  2. Go to page B - currently empty.
  3. Paste record in. Works.
  4. Copy another content element form page A.
  5. Go to page B.
  6. Paste record in after previously pasted record. Works.
  7. Copy another content element form page A.
  8. Go to page B.
  9. Paste record in on top ("Paste into this column"). Error.
1: Attempt to insert record "tt_content:123" on a page (Page Title) that can't store record type.

1: Attempt to insert record on page '[root-level]' (0) where this table, tt_content, is not allowed

Problem, it seems, lies in incorrect request parameters when calling the SimpleDataHandlerController.

Request parameters of a paste operation that works:

Array
(
    [route] => /ajax/record/process
    [token] => abc
    [cmd] => Array
        (
            [tt_content] => Array
                (
                    [123] => Array
                        (
                            [copy] => Array
                                (
                                    [action] => paste
                                    [target] => 3
                                    [update] => Array
                                        (
                                            [colPos] => 0
                                            [tx_gridelements_container] => NaN
                                            [tx_gridelements_columns] => 0
                                            [sys_language_uid] => 0
                                        )

                                )

                        )

                )

        )

)

Note that [target] is an integer referring to the page being copied to.

Request parameters of a paste operation that fails:

Array
(
    [route] => /ajax/record/process
    [token] => qwe
    [cmd] => Array
        (
            [tt_content] => Array
                (
                    [123] => Array
                        (
                            [copy] => Array
                                (
                                    [action] => paste
                                    [target] => Page Title
                                    [update] => Array
                                        (
                                            [colPos] => 0
                                            [tx_gridelements_container] => NaN
                                            [tx_gridelements_columns] => 0
                                            [sys_language_uid] => 0
                                        )

                                )

                        )

                )

        )

)

Note that [target] now is the page title (?!).
This leads to $this->tce->start($this->data, $this->cmd); in SimpleDataHandlerController being initialized with an invalid pageId value, and therefore failing to create correct cmd parameters. initializeClipboard will then also not be called.

I tried to debug this behaviour for about an hour, but I cannot for the love of anything find out, where this originates from.
This error also happens in some combinations with copying to different language columns.

Actions

Also available in: Atom PDF