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

CreateSnapshotAdminExtension bug fix #1709

Conversation

c-Rolland
Copy link
Contributor

Subject

I am targeting this branch, to fix a bug of CreateSnapshotAdminExtension::postRemove() method.

Closes #1708.

@c-Rolland c-Rolland force-pushed the bug-fix-CreateSnapshotAdminExtension branch from e82e80a to d43d698 Compare August 1, 2023 13:18
@c-Rolland c-Rolland force-pushed the bug-fix-CreateSnapshotAdminExtension branch from d43d698 to 6fa1707 Compare August 1, 2023 13:20
@@ -77,7 +77,7 @@ public function update(SiteInterface $site, ?OutputInterface $output = null, boo
if (
!$this->decoratorStrategy->isRouteNameDecorable($name)
|| !$this->decoratorStrategy->isRouteUriDecorable($route->getPath())
|| (null !== $routeHostRegex
|| (\is_string($routeHostRegex)
Copy link
Member

Choose a reason for hiding this comment

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

null !== $routeHostRegex
&& '' !== $routeHostRegex
&& ...

Will fix the psalm error

@VincentLanglet
Copy link
Member

@gremo Does it fix the issue for you too ?
Also, you introduce this PR #1293, does the previous bug you had is still fixed after this change ?

Comment on lines +43 to 47
if ($object instanceof PageInterface) {
return;
}

$this->createByPage($object);
Copy link
Member

Choose a reason for hiding this comment

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

I'm not familiar with this lib, maybe you can explain to me the change behind ?

SOmething like:
"This extension is used to create a snapshot of a Page. When you persist/update a Page or a PageBlock you want to update the snapshot of the Page. But when you remove something, the snapshot should only be updated if we remove a PageBlock. When we removed a Page, the snapshot should just be deleted with the page" ?

Choose a reason for hiding this comment

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

It works on my side. It prevent the snapshot to re-create the page on page deletion.

@gremo
Copy link
Contributor

gremo commented Aug 2, 2023

At the time of my old PR, the fix was targeting CreateSnapshotAdminExtension and the check for Page or Block was done in sendMessage, which in turn would create the snapshot.

Now the extension CreateSnapshotAdminExtension is completly refactored, but it's still active both for Page and Block (see admin.php).

@VincentLanglet I didn't checked it yet but it seems wrong to me: in case of a page removal, no snapshot would be created?

@VincentLanglet
Copy link
Member

@VincentLanglet I didn't checked it yet but it seems wrong to me: in case of a page removal, no snapshot would be created?

I don't know ; I never used this lib.

@SonataCI
Copy link
Collaborator

SonataCI commented Aug 3, 2023

Could you please rebase your PR and fix merge conflicts?

@eerison
Copy link
Contributor

eerison commented Sep 8, 2023

if it is fixing a bug, I would say it should have a test covering this bug.

it will help us to understand better what is the issue and what you are fixing.

@GeraudBourdin
Copy link
Contributor

hi , what is blocking on this MR ? it looks like it is solving my issue on my side.

Comment on lines +43 to 47
if ($object instanceof PageInterface) {
return;
}

$this->createByPage($object);

Choose a reason for hiding this comment

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

It works on my side. It prevent the snapshot to re-create the page on page deletion.

@VincentLanglet
Copy link
Member

VincentLanglet commented Nov 19, 2023

hi , what is blocking on this MR ? it looks like it is solving my issue on my side.

Hi @GeraudBourdin @thomasBourdin.
Good to know that this PR is fixing your issue.

Some context was need for me to understand why the PR #1293 was kinda revert here. The explication is now known. The goal of the link PR was to fix the snapshot when deleting PageBlocks. This PR is trying to solve things when deleting Pages.

What's missing now would be:

  • The psalm build was failing.
  • The PR has conflict.
  • Maybe a non-regression test could be great to avoid reintroducing the bug later.

If any of you want to resubmit a PR with a green Ci, I would be happy to merge it.
Feel free to ping me on it so I won't miss it.

@VincentLanglet
Copy link
Member

Solved in #1721

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

Successfully merging this pull request may close these issues.

Removing a page doesn't work from the edit route (works using batch delete)
7 participants