Bug #86453
closedException thrown in BE -> Template (PID 0) . TYPO3 8.7.19
100%
Description
Environment:¶
TYPO3 Version : 8.7.19
Webserver : Apache/2.4.10 (Debian)
PHP Version : 7.1.14
Database (Default) : MySQL 5.6.39
Application Context : Development/Docker
Composer mode : Enabled
Operating System : Linux 4.9.93-linuxkit-aufs
Third-party extensions: no
Problem:¶
BE -> Template -> PID 0 throws an exception, if the page reffered by sys_template entry doesn't exist in the database
This issue occures since in TYPO3 8.7.19
Steps to reproduce:¶
- BE -> Template: add new page.
- BE -> Template: create TS-Template for the new page
- DB -> delete the entry for the just created page directly in the database, table "pages" (keep the reffering entry in the table "sys_template"!)
- BE -> Template -> PID 0
Result:¶
Expected result: List of Templates
Actual Result: Exception
Uncaught TYPO3 Exception
Argument 2 passed to TYPO3\CMS\Core\Imaging\IconFactory::getIconForRecord() must be of the type array, null given, called in /app/vendor/typo3/cms/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateModuleController.php on line 602
TypeError thrown in file
/app/vendor/typo3/cms/typo3/sysext/core/Classes/Imaging/IconFactory.php in line 137.
Comment:¶
This issue can easily happen at some very old TYPO3-websites with a long history
Files
Updated by Gerrit Code Review about 6 years ago
- Status changed from New to Under Review
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/58472
Updated by Ioulia Kondratovitch about 6 years ago
- File 00_steps_before.png 00_steps_before.png added
Updated by Gerrit Code Review about 6 years ago
Patch set 2 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/58472
Updated by Riccardo De Contardi about 6 years ago
- File cattura.png cattura.png added
I tried the following test with TYPO3 9.5-dev (master)
1) create a page (name: tessssss)
2) click on it and create on it an ext typoscript template (name: +ext tessssss)
3) go on database and delete manually the page tessssss
4) click on root page (id=0) and on template module
Results¶
The "+ext tessssss" template is listed on a page without title and id
If you try to click on it, it leads to an exception
(1/1) #1534710048 TYPO3\CMS\Core\Exception\SiteNotFoundException No pseudo-site found in root line of page 841
Updated by Josef Glatz about 6 years ago
Riccardo De Contardi wrote:
I tried the following test with TYPO3 9.5-dev (master)
1) create a page (name: tessssss)
2) click on it and create on it an ext typoscript template (name: +ext tessssss)
3) go on database and delete manually the page tessssss
4) click on root page (id=0) and on template moduleResults¶
The "+ext tessssss" template is listed on a page without title and id
If you try to click on it, it leads to an exception
[...]
I could not reproduce the error within TYPO3 master (9.5.0-dev). Incidentally, the version is also set to TYPO3 v8 in the ticket.
Updated by Riccardo De Contardi about 6 years ago
@Josef Glatz I think you're right.
I just wanted to report the exception you get on version 9.5 if you try to perform the same operations (at least what I have understood). I guess it cannot be avoided :)
Updated by Ioulia Kondratovitch about 6 years ago
Riccardo, you got the steps right.
I didn't check the situation in TYPO3 9, but I agree, it might need a fallback (patch)
Riccardo De Contardi wrote:
@Josef Glatz I think you're right.
I just wanted to report the exception you get on version 9.5 if you try to perform the same operations (at least what I have understood). I guess it cannot be avoided :)
Updated by Josef Glatz about 6 years ago
Ioulia Kondratovitch wrote:
Riccardo, you got the steps right.
I didn't check the situation in TYPO3 9, but I agree, it might need a fallback (patch)Riccardo De Contardi wrote:
@Josef Glatz I think you're right.
I just wanted to report the exception you get on version 9.5 if you try to perform the same operations (at least what I have understood). I guess it cannot be avoided :)
Can you reproduce the error in TYPO3 master? If yes, please describe how I can reproduce it. Many thanks
Updated by Gerrit Code Review about 6 years ago
Patch set 3 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/58472
Updated by Ioulia Kondratovitch about 6 years ago
- File forge-86453-1.png forge-86453-1.png added
- File forge-86453-2.png forge-86453-2.png added
I cannot reproduce the error (originally reported by me in this ticket) in master.
I went over the steps described by Ricardo.
I can reproduce the problem described by Ricardo in master. Follow Steps 1-4 =>
(1/1) #1534710048 TYPO3\CMS\Core\Exception\SiteNotFoundException
No pseudo-site found in root line of page 20
in /app/web/typo3/sysext/core/Classes/Site/PseudoSiteFinder.php line 178
if (isset($this->pseudoSites[(int)$pageInRootLine['uid']])) {
return $this->pseudoSites[(int)$pageInRootLine['uid']];
}
}
throw new SiteNotFoundException('No pseudo-site found in root line of page ' . $pageId, 1534710048);
}
/**
* Find a site by given root page id
The problem is, we try to fetch a page without ID (screenshot)
This should be a new ticket, I think.
Josef Glatz wrote:
Ioulia Kondratovitch wrote:
Riccardo, you got the steps right.
I didn't check the situation in TYPO3 9, but I agree, it might need a fallback (patch)Riccardo De Contardi wrote:
@Josef Glatz I think you're right.
I just wanted to report the exception you get on version 9.5 if you try to perform the same operations (at least what I have understood). I guess it cannot be avoided :)
Can you reproduce the error in TYPO3 master? If yes, please describe how I can reproduce it. Many thanks
Updated by Joerg Kummer about 6 years ago
This behaviour was introduced with #81430
Updated by Gerrit Code Review almost 6 years ago
Patch set 4 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/58472
Updated by Ioulia Kondratovitch almost 6 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset e3a786d6e586eb25f4cc6e443d3b6446db4ebe1c.