Bug #86684
closed"No pseudo-site found in root line of page" when copying records from one sysfolder to another
100%
Description
**Hi,
I came across this problem when trying to copy news records in the backend.
\TYPO3\CMS\Core\DataHandling\SlugHelper->isUniqueInSite()¶
When copying a record, the isUniqueInSite() method is called to check if the news slug needs adjustment. This may trigger a No pseudo-site found in root line of page exception, depending on what pages are currently available in the backend.
It seems that the problem is found here:
$siteMatcher = GeneralUtility::makeInstance(SiteMatcher::class); $siteOfCurrentRecord = $siteMatcher->matchByPageId($pageId); foreach ($records as $record) { $siteOfExistingRecord = $siteMatcher->matchByPageId((int)$record['uid']); if ($siteOfExistingRecord->getRootPageId() === $siteOfCurrentRecord->getRootPageId()) { return false; } }
As far as I understand, the method $siteMatcher->matchByPageId((int)$record['uid']) will work only correctly, if the current table is "pages". When copying news records, $record['uid'] will contain the news' UID, and a matchByPageId->call is made with that UID. Sometimes this may work, depending on if that page happens to exists or not.
As for now I have created a workaround for this problem:
$siteMatcher = GeneralUtility::makeInstance(SiteMatcher::class); $siteOfCurrentRecord = $siteMatcher->matchByPageId($pageId); foreach ($records as $record) { if ($this->tableName === 'pages') { $siteOfExistingRecord = $siteMatcher->matchByPageId((int) $record['uid']); } else { $siteOfExistingRecord = $siteMatcher->matchByPageId((int) $record['pid']); } if ($siteOfExistingRecord->getRootPageId() === $siteOfCurrentRecord->getRootPageId()) { return false; } }
This seems to work, however I am not sure, if this may have unwanted side effects.
Regards,
Philipp
Updated by Susanne Moog about 6 years ago
- Sprint Focus set to On Location Sprint
Updated by Philipp Seiler about 6 years ago
- Priority changed from Should have to Must have
TYPO3 9.5.1 made changes to the method \TYPO3\CMS\Core\DataHandling\SlugHelper->isUniqueInSite(). The problem still persists however, or rather, a new exception shows up. This happens for example if you try to update the slug of a news record.
Argument 1 passed to TYPO3\CMS\Core\DataHandling\Model\RecordStateFactory::TYPO3\CMS\Core\DataHandling\Model\{closure}() must be of the type string, null given
I guess I better keep the old version of the method and my bugfix for now.
Edit: No, slug generation seems to be completely broken now. Better go back to 9.5.0.
Updated by Alexander Jaschke about 6 years ago
I can confirm that. It is not possible to copy or move news articles.
Not working in 9.5.0 and 9.5.1 with these errors.
Updated by Steffen Dietrich about 6 years ago
Can you provide some additional informations? I m testing this on 9.5.2 and can't reproduce it.
Or maybe I did something wrong? I got two News-folder, two List-view-pages and two Detail-pages and I can copy/move the news without any trouble.
I can also copy-paste-edit-show news within the same folder, no issues at all....am I missing something?
Updated by Gerrit Code Review almost 6 years ago
- Status changed from New to Under Review
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59229
Updated by Gerrit Code Review almost 6 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/59453
Updated by Benni Mack almost 6 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset b3c170461fe0d30898487b98848271993692e31e.
Updated by Arne Bracht about 4 years ago
- Description updated (diff)
Seems back in 9.5.21
Can't edit/new category "No pseudo-site found in root line of page
Updated by Rene Tobias about 4 years ago
Arne Bracht Bracht wrote:
Seems back in 9.5.21
Can't edit/new category "No pseudo-site found in root line of page
Same here.
Updated by Arne Bracht about 4 years ago
- Copied to Bug #92331: No pseudo-site found in root line of page added