Project

General

Profile

Actions

Bug #90073

closed

Change sorting of records in list module / draft workspaces breaks workspace module

Added by This Mächler over 4 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Workspaces
Target version:
Start date:
2020-01-09
Due date:
% Done:

100%

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

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.


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #91679: Change sorting of records in list module / draft workspaces breaks workspace moduleClosed2020-06-19

Actions
Related to TYPO3 Core - Bug #91025: List of changes in workspace view stays empty in BEClosed2020-04-14

Actions
Actions #1

Updated by This Mächler over 4 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.

Actions #2

Updated by This Mächler over 4 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" :-)

Actions #3

Updated by rene elsaesser about 4 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?

Actions #4

Updated by This Mächler about 4 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)

Actions #5

Updated by This Mächler about 4 years ago

  • Tags set to workkspace sorting
  • Complexity set to no-brainer
Actions #6

Updated by Andreas Kiessling about 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;

Actions #7

Updated by David Menzel about 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.

Actions #8

Updated by Gerrit Code Review almost 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

Actions #9

Updated by Anonymous almost 4 years ago

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

Updated by Benni Mack almost 4 years ago

  • Status changed from Resolved to Closed
Actions #11

Updated by This Mächler almost 4 years ago

  • TYPO3 Version changed from 9 to 10

The same issue is there again in TYPO3 10.4
Please fix

Actions #12

Updated by This Mächler almost 4 years ago

  • Related to Bug #91679: Change sorting of records in list module / draft workspaces breaks workspace module added
Actions #13

Updated by This Mächler almost 4 years ago

  • TYPO3 Version changed from 10 to 9
Actions #14

Updated by Benni Mack over 3 years ago

  • Related to Bug #91025: List of changes in workspace view stays empty in BE added
Actions #15

Updated by Benni Mack over 3 years ago

  • Status changed from Closed to New
Actions #16

Updated by Gerrit Code Review over 2 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

Actions #17

Updated by Gerrit Code Review over 2 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

Actions #18

Updated by Gerrit Code Review over 2 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

Actions #19

Updated by Gerrit Code Review over 2 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

Actions #20

Updated by Benni Mack over 2 years ago

  • Status changed from Under Review to Resolved
Actions #21

Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF