Skip to content

Conversation

@spoonerWeb
Copy link
Contributor

@spoonerWeb spoonerWeb commented Jan 24, 2024

What this pr does

Checks if action is "publish" and add record to index queue.
Removed "swap" action as it's removed with https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/11.0/Breaking-92206-RemoveWorkspaceSwappingOfElements.html.

How to test

  1. Create a workspace
  2. Switch to workspace and create page
  3. Page is not in index queue -> correct
  4. Publish the page to LIVE workspace
  5. Page is not in index queue -> incorrect

Fixes: #3718

@dkd-kaehm dkd-kaehm added the BACKPORTABLE The changes SHOULD be backported label Jan 24, 2024
Copy link
Collaborator

@dkd-kaehm dkd-kaehm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix.
We'll backport it to 11.5 and then merge the both on same time.

@spoonerWeb Could you please sqaush the commits?

@dkd-friedrich
Copy link
Member

dkd-friedrich commented Feb 23, 2024

I'm not sure if we can drop 'swap' completely, EXT:workspaces is internally still handling swap actions and even building command maps with 'swap', e.g.

https://github.com/TYPO3/typo3/blob/cb5719e41c093220c57255c989b9e2ebbbcc431e/typo3/sysext/workspaces/Classes/Service/WorkspaceService.php#L170

            foreach ($versions as $table => $records) {
                foreach ($records as $rec) {
                    // For new records, the live ID is the same as the version ID
                    $liveId = $rec['t3ver_oid'] ?: $rec['uid'];
                    $cmd[$table][$liveId]['version'] = ['action' => 'swap', 'swapWith' => $rec['uid']];
                }
            }
        }
        return $cmd;

https://github.com/TYPO3/typo3/blob/402a65eabc5c09a2e31cffd23a36298f301c14c0/typo3/sysext/workspaces/Classes/Hook/DataHandlerHook.php#L119

            case 'swap':
            case 'publish':
                $this->version_swap(
                    $table,
                    $id,
                    (int)$value['swapWith'],
                    $dataHandler,
                    $comment,
                    $notificationAlternativeRecipients
                );
                break;

I think we should use both options to be on the safe side

@dkd-kaehm
Copy link
Collaborator

@spoonerWeb

Could you please check #3938 (comment)

# What this pr does

Checks if action is "publish" and add record to index queue.
Removed "swap" action as it's removed with https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/11.0/Breaking-92206-RemoveWorkspaceSwappingOfElements.html.

# How to test

1. Create a workspace
2. Switch to workspace and create page
3. Page is not in index queue -> correct
4. Publish the page to LIVE workspace
5. Page is not in index queue -> incorrect

Fixes:  TYPO3-Solr#3718
@kitzberger
Copy link
Contributor

As far as I understand it, "swap" has been removed? "publish" is sufficient, no?

https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/11.0/Breaking-92206-RemoveWorkspaceSwappingOfElements.html

@etnicoliver
Copy link

As far as I understand it, "swap" has been removed? "publish" is sufficient, no?

https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/11.0/Breaking-92206-RemoveWorkspaceSwappingOfElements.html

That's what I understood. I tested this patch and it seems to work; it's just not the same line in version 13.0.3: https://patch-diff.githubusercontent.com/raw/TYPO3-Solr/ext-solr/pull/3938.patch

Copy link
Collaborator

@dkd-kaehm dkd-kaehm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests must be adjusted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BACKPORTABLE The changes SHOULD be backported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Publishing records doesn't update the index queue

5 participants