apostrophecms / apostrophe

A full-featured, open-source content management framework built with Node.js that empowers organizations by combining in-context editing and headless architecture in a full-stack JS environment.
https://apostrophecms.com
MIT License
4.34k stars 591 forks source link

Page being a child of itself #4724

Open Pixelguymm opened 2 weeks ago

Pixelguymm commented 2 weeks ago

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:

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

boutell commented 2 weeks ago

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.

Pixelguymm commented 2 weeks ago

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.

boutell commented 2 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

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