apostrophe icon indicating copy to clipboard operation
apostrophe copied to clipboard

Page being a child of itself

Open nttfiles opened this issue 1 year ago • 5 comments

This happened to us in our live environment. A page somehow became a child of itself.

To Reproduce

In reality this happened through use of the UI only, we just don't know how. However, I know how to manipulate the database to replicate the issue.

  1. Choose a page to manipulate. I'd recommend using one with type default-page.
  2. Change the page's path property. A normal path might look like this: "{home-page-id}/{page-id}",
    change this to "{home-page-id}/{page-id}/{page-id}"

Expected behavior

I don't really know, I guess the expected behaviour would be for this not to happen in the first place.

Describe the bug

After following the steps above, the page is now a child of itself. This comes with some side effects:

  • The page does not show up in the page tree.
  • The page can not be saved, as it has a draft parent (itself), which has a draft parent (itself again), etc.

Details

Server Operating System: Ubuntu 22.04.2 LTS (GNU/Linux 5.15.0-112-generic x86_64) with node:lts-alpine3.15 Docker image

Screenshots: The message that pops up when trying to save this page: image

nttfiles avatar Sep 11 '24 13:09 nttfiles

Thanks for reporting this. This is, obviously, not a good outcome! However we don't yet have a path to reproduce it.

Let me know if you get any inkling of how it might happen again / see it again / spot something in the clouds.

boutell avatar Sep 11 '24 17:09 boutell

Unfortunately this was triggered by our editor as far as I know, so how it happens through the UI is a mistery to me. Though, by manipulating the database as described above, you can at least observe the effects. I'll be sure to let you know if this happens again, and what triggered it if we are able to find out.

nttfiles avatar Sep 11 '24 17:09 nttfiles

I'll check whether our API is allowing this. It doesn't really matter how the editor does it, the API should not allow it, so the path from here is straightforward on my end.

THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER APOSTROPHECMS | apostrophecms.com | he/him/his

On Wed, Sep 11, 2024 at 1:53 PM Maarten Marx @.***> wrote:

Unfortunately this was triggered by our editor as far as I know, so how it happens through the UI is a mistery to me. Though, by manipulating the database as described above, you can at least observe the effects. I'll be sure to let you know if this happens again, and what triggered it if we are able to find out.

— Reply to this email directly, view it on GitHub https://github.com/apostrophecms/apostrophe/issues/4724#issuecomment-2344326081, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAH27IEN757YVVWHMHVSDDZWB7TFAVCNFSM6AAAAABOBAVLJCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNBUGMZDMMBYGE . You are receiving this because you commented.Message ID: @.***>

boutell avatar Sep 12 '24 13:09 boutell

A PR fixing the issue is in review. Will be included in our next scheduled release if not sooner.

On Thu, Sep 12, 2024 at 9:14 AM Tom Boutell @.***> wrote:

I'll check whether our API is allowing this. It doesn't really matter how the editor does it, the API should not allow it, so the path from here is straightforward on my end.

THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER APOSTROPHECMS | apostrophecms.com | he/him/his

On Wed, Sep 11, 2024 at 1:53 PM Maarten Marx @.***> wrote:

Unfortunately this was triggered by our editor as far as I know, so how it happens through the UI is a mistery to me. Though, by manipulating the database as described above, you can at least observe the effects. I'll be sure to let you know if this happens again, and what triggered it if we are able to find out.

— Reply to this email directly, view it on GitHub https://github.com/apostrophecms/apostrophe/issues/4724#issuecomment-2344326081, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAH27IEN757YVVWHMHVSDDZWB7TFAVCNFSM6AAAAABOBAVLJCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNBUGMZDMMBYGE . You are receiving this because you commented.Message ID: @.***>

--

THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER APOSTROPHECMS | apostrophecms.com | he/him/his

boutell avatar Sep 12 '24 13:09 boutell

Thanks for the report!

On Thu, Sep 12, 2024 at 9:48 AM Tom Boutell @.***> wrote:

A PR fixing the issue is in review. Will be included in our next scheduled release if not sooner.

On Thu, Sep 12, 2024 at 9:14 AM Tom Boutell @.***> wrote:

I'll check whether our API is allowing this. It doesn't really matter how the editor does it, the API should not allow it, so the path from here is straightforward on my end.

THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER APOSTROPHECMS | apostrophecms.com | he/him/his

On Wed, Sep 11, 2024 at 1:53 PM Maarten Marx @.***> wrote:

Unfortunately this was triggered by our editor as far as I know, so how it happens through the UI is a mistery to me. Though, by manipulating the database as described above, you can at least observe the effects. I'll be sure to let you know if this happens again, and what triggered it if we are able to find out.

— Reply to this email directly, view it on GitHub https://github.com/apostrophecms/apostrophe/issues/4724#issuecomment-2344326081, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAH27IEN757YVVWHMHVSDDZWB7TFAVCNFSM6AAAAABOBAVLJCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNBUGMZDMMBYGE . You are receiving this because you commented.Message ID: @.***>

--

THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER APOSTROPHECMS | apostrophecms.com | he/him/his

--

THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER APOSTROPHECMS | apostrophecms.com | he/him/his

boutell avatar Sep 12 '24 13:09 boutell