Project

General

Profile

Actions

Bug #82032

closed

Copying page containing tt_content irre elements causes error

Added by Tobi Kretschmann over 6 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
DataHandler aka TCEmain
Target version:
-
Start date:
2017-08-03
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
medium
Is Regression:
Sprint Focus:

Description

If the content element has an inline relation to tt_content (PID is the same) and the parent page is copied and pasted, the following error message will be displayed.

'1: Repeated attempt to copy record "tt_content:17671" with override values' (see screenshot)

The TCA for tt_content used to reproduce it, is:

$additionalFields = [
    'parent_id'                 => [
        'config' => [
            'type' => 'passthrough',
        ]
    ],
    'item' => [
        'exclude'    => 0,
        'label'      => 'Element',
        'config'     => [
            'type'             => 'inline',
            'foreign_table'    => 'tt_content',
            'foreign_field'    => 'parent_id',
        ],
    ],
];
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('tt_content', $additionalFields);

$GLOBALS['TCA']['tt_content']['types']['content_element']['showitem'] .= '
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:palette.general;general,
item
--palette--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:palette.access;access,
';    

Files

error-message.jpg (22 KB) error-message.jpg Tobi Kretschmann, 2017-08-03 15:16
reproduce_82032.zip (2.71 KB) reproduce_82032.zip Extension to help reproduce the issue. Readme inside. Rémy DANIEL, 2018-02-14 17:27

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #87351: Delete content elements containing tt_content irre elements causes errorClosed2019-01-07

Actions
Actions #1

Updated by Heiko Bihlmaier over 6 years ago

  • Tracker changed from Bug to Epic
  • Priority changed from Should have to Must have

Hello,

I have the same error, but I don't have an IRRE Content Element.

I get this error when I copy a normal page with normal and mask content elements.

This is very annoying, because my customer needs this feature.

Actions #2

Updated by Heiko Bihlmaier over 6 years ago

  • Tracker changed from Epic to Bug
  • TYPO3 Version set to 8
  • Complexity set to nightmare
Actions #3

Updated by Kevin Purrmann over 6 years ago

Pointed out that tt_content field 'l10n_source' causes the problem.

In Datahandler on line 3363:

        if ($this->isRecordCopied($table, $uid)) {
            if (!empty($overrideValues)) {
                $this->log($table, $uid, 1, 0, 1, 'Repeated attempt to copy record "%s:%s" with override values', -1, [$table, $uid]);
            }
            return null;
        }

$overrideValues is l10n_source => 0. Set in line 3624 and called in 3634.

May it helps.

Actions #4

Updated by Heiko Bihlmaier over 6 years ago

Can we fix this as soon as possible?

Actions #5

Updated by Heiko Bihlmaier over 6 years ago

I make a temporary bugfix directly into the datahandler.

unset($overrideValues['l10n_source'])

Then the copy process works.

Actions #6

Updated by ondro no-lastname-given over 6 years ago

Tobi Kretschmann wrote:

If the content element has an inline relation to tt_content (PID is the same) and the parent page is copied and pasted, the following error message will be displayed.

'1: Repeated attempt to copy record "tt_content:17671" with override values' (see screenshot)

The TCA for tt_content used to reproduce it, is:

[...]

Can confirm same behaviour with typo3 8.7.4

Actions #7

Updated by Christoph Lehmann over 6 years ago

Confirmed in 8.7.6

Actions #8

Updated by Tymoteusz Motylewski over 6 years ago

  • Category set to Localization

Thanks for the info.
Can you provide a small test extension to be able to quickly reproduce it?

Actions #9

Updated by Heiko Bihlmaier over 6 years ago

You only need a page with content to reproduce this error.

When you wish, I can make a test system, where you can login in to test.

Actions #10

Updated by Christoph Lehmann over 6 years ago

@Heiko: Do you have problems with deleting pages too ("Attempt to delete pages without delete-permission")? The will be deleted, but the message occurs. That was reported by an editor...

Actions #11

Updated by Christoph Lehmann over 6 years ago

Error message on copying

I digged a little bit more into it and for me it's maybe an issue with gridelements:

  1. Add a page
  2. Add a gridlements ce
  3. Add an element into the grid element
  4. copy the page

Heiko, do you use gridelements too and is this our issue?

Actions #12

Updated by Heiko Bihlmaier over 6 years ago

@christoph -

Our customer uses gridelements to build the site. Is that the reason for the copy error ?
Within the deletion process no error occurred.

Actions #13

Updated by David Bender over 6 years ago

Heiko Bihlmaier wrote:

Our customer uses gridelements to build the site. Is that the reason for the copy error ?
Within the deletion process no error occurred.

I can confirm this behaviour with copying pages containing gridelements, too. For admin users as well as for editors.

Do you have problems with deleting pages too ("Attempt to delete pages without delete-permission")? The will be deleted, but the message > occurs. That was reported by an editor...

I can confirm this behaviour as well, but only for editors (and containing gridelements). Within my admin user no error occured, as described above.

Actions #14

Updated by Felix Nagel over 6 years ago

Same issue here, TYPO3 8.7.6.

This seems to be an issue caused by copying IRRE elements (e.g. gridelements, flux sections, ...) in the page module.

Actions #15

Updated by Gernot Ploiner over 6 years ago

Same error occurs with Mask and nested content (this is based on IRRE).

Actions #16

Updated by Laurent Foulloy over 6 years ago

I confirm the error in TYPO3 8.7.8 when using one gridelement ce which contains one element.

As far as I can understand from the code, the method copySpecificPage() loops on all contents in the page, i.e. the gridelement ce and its child.
When processing the gridelement ce, the method copyRecord() is called. =This method calls the method copyRecord_processInline() which itself calls the method copyRecord_raw() for each child. This leads to have the child marked as copied.
After having processed the gridelement ce, its child is processed again by copyRecord()in the loop in copySpecificPage() which leads to the error.

Could one solution be to skip the call to copyRecord()when the record is already marked as copied ?

For example changing the following condition in copySpecificPage() solves the problem but I am not sure if there are side effects.

if ($row[$languageField] > 0 && $transOrigPointer > 0 && isset($rows[$transOrigPointer])) {
    continue;
}

to

if (($row[$languageField] > 0 && $transOrigPointer > 0 && isset($rows[$transOrigPointer])) || $this->isRecordCopied($table, $row['uid'])) {
    continue;
}
Actions #17

Updated by Stefan P about 6 years ago

What is the state of this bug? We are experiencing this as well, but with our own private implmentation of grid-like content elements (where a CE is an inline child of another CE), we do not have any other extension that alters tt_content.

Actions #18

Updated by Stephan Brun about 6 years ago

I still can reproduce the behaviour with TYPO3 8.7.9 and Gridelements 8.0.0
But only as an editor, not as admin.

I have also the error message "Attempt to delete pages without delete-permission" on deleting pages, which Christoph mentioned.

Actions #19

Updated by Rémy DANIEL about 6 years ago

Hello

Some further information on the cause of this issue...

This issue was introduced by change "[FEATURE] Introduce l10n_source field for tt_content", changeId: I3ecfeedb656c64681e5e3021cad6b708482520dc, review: https://review.typo3.org/51070

With this change, a copied record now have its l10n_source reset to 0.

But, this conflict with a preceding change which prevent an embedded record to be copied twice.
This is the purpose of the error message "Repeated attempt to copy record...": to prevent to copy a record that will be processed inside another copyRecord() call for the record of the default language. See commit message of changeId: I6647b02095343756d3a41b0c0e985b4777429cd8 reviewed on http://review.typo3.org/32356

So... what to do now?

I hope specialists of localization and workspace handling in the dataHandler will read that ;-)

Actions #20

Updated by Rémy DANIEL about 6 years ago

I've attached a simple extension to help reproduce the issue.

Actions #21

Updated by Tymoteusz Motylewski about 6 years ago

The easiest way to reproduce it is to:
- install EXT:Styleguide (it's included in the core require-dev depenedencies)
- go to styleguide module (help icon from top toolbar)
- navigate to "TCA / Records" tab
- click "Create styleguide page tree with data"
- go to page module
- try to copy "inline 1n"page
- Errors will appear:

1: Repeated attempt to copy record "tx_styleguide_inline_1n_child:15" with override values
1: Repeated attempt to copy record "tx_styleguide_inline_1n_child:14" with override values    
1: Repeated attempt to copy record "tx_styleguide_inline_1n_child:18" with override values

The next step would be to create a functional test case illustrating the issue.
I think a test typo3/sysext/core/Tests/Functional/DataHandling/IRRE/ForeignField/Modify/ActionTest.php
dataset could be extended to make copyPage test fail.

Actions #22

Updated by Rick Feuerabend about 6 years ago

Can also confirm this bug with TYPO3 v8.7.8 and mask v3.0.3. Mainly the copying of inline elements is working and just the log message is shown. But sometimes it happens that the inline elements are duplicated.

Actions #23

Updated by Karsten B B about 6 years ago

The same for me. "1: Repeated attempt to copy record "tt_content:1589" with override values" in TYPO3 8.7.11.

Actions #24

Updated by Lorenz Ulrich about 6 years ago

Same problem here with EXT:gridelements.

Actions #25

Updated by Jo Hasenau about 6 years ago

  • Status changed from New to Accepted
  • Complexity changed from nightmare to medium
Actions #26

Updated by Webadmin no-lastname-given almost 6 years ago

Still happens in Typo3 8.7.13 with gridelements installed...

Actions #27

Updated by Sebastian Schmal almost 6 years ago

Webadmin no-lastname-given wrote:

Still happens in Typo3 8.7.13 with gridelements installed...

same here! PLZ fix after 9 Months! Thanks!

Actions #28

Updated by Wolfgang Wagner over 5 years ago

Bug still present in 8.7.18

Actions #29

Updated by Michael Grundkötter over 5 years ago

Still present in TYPO3 8.7.19 with gridelements 8.2.3

Actions #30

Updated by Tom Arnold over 5 years ago

Still present in 8.7.19 with custom nested elements (via Mask_Export). Despite the error showing in the backend (as an admin user, too) the elements then are copied correctly. I think this has changed since I first stumbled across this issue in the same install some months ago, where elements were missing in the copied page.

Actions #31

Updated by Stefan P over 5 years ago

  • Category changed from Localization to DataHandler aka TCEmain

We have this also in a project with Gridlements, TYPO3 8.7.19.

I changed the category from Localisation to DataHandler because this is not restricted to localisation, it also affects single-language copies.

Actions #32

Updated by Bernhard Berger over 5 years ago

still present in 8.7.20 :/ Hard to sell TYPO3 on new customers when they get massive error messages while basic work with the CMS :/

Actions #33

Updated by Gerrit Code Review over 5 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59202

Actions #34

Updated by Gerrit Code Review over 5 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59202

Actions #35

Updated by Gerrit Code Review over 5 years ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59234

Actions #36

Updated by Gerrit Code Review over 5 years ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59235

Actions #37

Updated by Christoph Lehmann over 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #38

Updated by Gerfried no-lastname-given over 5 years ago

Really? The fix was to remove the message?

Actions #39

Updated by Gerrit Code Review over 5 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59281

Actions #40

Updated by Gerrit Code Review over 5 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59281

Actions #41

Updated by Gerrit Code Review over 5 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59281

Actions #42

Updated by Mathias Brodala over 5 years ago

  • Status changed from Under Review to Resolved

More changes will be done in separate tickets.

Actions #43

Updated by Mathias Brodala over 5 years ago

  • Related to Bug #87351: Delete content elements containing tt_content irre elements causes error added
Actions #44

Updated by Benni Mack almost 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF