Project

General

Profile

Actions

Bug #83870

closed

DataHandler::clearPrefixFromValue is missing the leading space in the regexp

Added by Wolfgang Klinger about 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Category:
DataHandler aka TCEmain
Target version:
-
Start date:
2018-02-13
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
no-brainer
Is Regression:
Sprint Focus:

Description

The result is, that if you copy or duplicate (with the new upcoming 'Duplicate' feature) a record the prependAtCopy postfix is not increased as expected.

Here's the detailed explanation:

Duplicated page header: 'Test (copy 6)'

the regexp of cleaPrefixFromValue returns: 'Test ' (with an additional space)

$count = 0 in the first run

database query executed:
SELECT COUNT FROM `tt_content` WHERE (`pid` = 2) AND (`header` = 'Test ') AND (`tt_content`.`deleted` = 0)

$rowCount -> 1 (the original page matches with title 'Test')

getCopyHeader is called again (recursively)
parameters: $count = 1, $value = 'Test '

$checkTitle is constructed as 'Test (copy 1)' with a space too much
and therefore no further pages with (copy X) postfixes are found.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #83909: Unit test DataHandler->clearPrefixFromValue()Closed2018-02-15

Actions
Actions

Also available in: Atom PDF