Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] Add record to index queue when published #3938

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

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)

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
4 participants