Bug #90073
closedChange sorting of records in list module / draft workspaces breaks workspace module
100%
Description
Core: Exception handler (WEB): Uncaught TYPO3 Exception: Argument 1 passed to TYPO3\CMS\Workspaces\Service\GridDataService::getSystemLanguages() must be of the type integer, null given, called in ..../typo3_src-9.5.13/typo3/sysext/workspaces/Classes/Service/GridDataService.php on line 601 | TypeError thrown in file ...../typo3_src-9.5.13/typo3/sysext/workspaces/Classes/Service/GridDataService.php in line 614. Requested URL: https://dev.sgparch.ch/typo3/index.php?route=%%2Fajax%%2Fworkspace%%2Fdispatch&token=--AnonymizedToken--
This breaks the workspace-module functionality (doesn't load properly), up the whole tree, appears when I change the sorting of records in a sys-folder in list module. This sys-folder and all ancestors produce the bug when I open the list module.
The only way to overcome this redactionally is to edit something in a sibling page/folder and do a workspace mass action there. Else you are stuck. Very annoying.
Updated by This Mächler almost 5 years ago
The same thing also happens after moving a record from one sys-folder to another. The error occurs then when selecting the target folder in the workspace-module.
Updated by This Mächler almost 5 years ago
When I create a NEW record in draft workspace, and move it then, the error does not show up.
I should tell my customers "it's safer to not use workspaces at all. But it might work if you are lucky" :-)
Updated by rene elsaesser almost 5 years ago
This Mächler wrote:
The same thing also happens after moving a record from one sys-folder to another. The error occurs then when selecting the target folder in the workspace-module.
Hi,
moving records on pages also.
I changed the code(type hinting) in typo3/sysext/workspaces/Classes/Service/GridDataService.php : Line 613 to:
/**
* @param int|null $pageId
*
* @return array
*/
public function getSystemLanguages(?int $pageId)
{
if (!isset($this->systemLanguages)) {
$translateTools = GeneralUtility::makeInstance(TranslationConfigurationProvider::class);
$this->systemLanguages = $translateTools->getSystemLanguages($pageId);
}
return $this->systemLanguages;
}
and that seems does the trick
same as Bug https://forge.typo3.org/issues/89692?
Updated by This Mächler almost 5 years ago
I can confirm that this solves the issue.
Nullable type hint does it:
...
611: * @param int|null $pageId
...
614: public function getSystemLanguages(?int $pageId)
Updated by This Mächler almost 5 years ago
- Tags set to workkspace sorting
- Complexity set to no-brainer
Updated by Andreas Kießling over 4 years ago
I can confirm the error, the fix seems to work. But i think that it needs to be tackled differently.
The missing pid originates from \TYPO3\CMS\Workspaces\Service\WorkspaceService::getMoveToPlaceHolderFromPages -> the generated query does not contain any pid, but only wspid.
https://github.com/TYPO3/TYPO3.CMS/blob/d794b188606c0e9cd93d764ed71cedd92a051248/typo3/sysext/workspaces/Classes/Service/WorkspaceService.php#L532
And at another place, wspid is used instead of just using the pid property:
https://github.com/TYPO3/TYPO3.CMS/blob/d794b188606c0e9cd93d764ed71cedd92a051248/typo3/sysext/workspaces/Classes/Service/WorkspaceService.php#L686
So replacing the code in here seems to work https://github.com/TYPO3/TYPO3.CMS/blob/ca19817b4ccf312498f59428d215dfb26fb02074/typo3/sysext/workspaces/Classes/Service/GridDataService.php#L183
Before:
$pageId = $table === 'pages' ? $record['uid'] : $record['pid'];
After
$pageIdField = $table === 'pages' ? 'uid' : 'wspid'; $pageId = isset($record[$pageIdField]) ? (int)$record[$pageIdField] : null;
Updated by David Menzel over 4 years ago
TYPO3 9.5.14/9.5.15
I have the same error message as the thread starter and two errors in workspace:
1) When I create an element on a page I don't see that content element in the workspace modul to get approval and publish it. But that's randomly, not every page is effected.
-> I tried the change from Andreas Kiessling and that works and now I see the content elements again in the workspace module.
On another page I had the same problem with another error message: the solution here was to update the reference index: https://forge.typo3.org/issues/91025
2) I created a mask element which has an IRRE field in workspace mode. I publish that element. Now, if I add another IRRE element in workspace mode this new IRRE element is already available in the live mode without any approval ô_O
Maybe that's another issue, not sure.
Updated by Gerrit Code Review over 4 years ago
- Status changed from New to Under Review
Patch set 2 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62974
Updated by Anonymous over 4 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset e413054c5398a5784f9f2495201ad2f717d8ace6.
Updated by This Mächler over 4 years ago
- TYPO3 Version changed from 9 to 10
The same issue is there again in TYPO3 10.4
Please fix
Updated by This Mächler over 4 years ago
- Related to Bug #91679: Change sorting of records in list module / draft workspaces breaks workspace module added
Updated by Benni Mack over 4 years ago
- Related to Bug #91025: List of changes in workspace view stays empty in BE added
Updated by Gerrit Code Review almost 3 years ago
- Status changed from New to Under Review
Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72609
Updated by Gerrit Code Review almost 3 years ago
Patch set 2 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72609
Updated by Gerrit Code Review almost 3 years ago
Patch set 3 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72609
Updated by Gerrit Code Review almost 3 years ago
Patch set 4 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72609
Updated by Benni Mack almost 3 years ago
- Status changed from Under Review to Resolved
Applied in changeset fd7607ee5ff8d8c8da50218a423036158c2e9032.