apostrophecms / apostrophecms/apostrophe

Missing mongodb field "lastPublishedAt" for parked pages.

Open
#3,565 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
4.6k
Forks
650
Avg merge
19h 21m
Merged PRs (30d)
23

Description

## To Reproduce

Step by step instructions to reproduce the behavior:

> 1. Create parked page in page module options for example:
```
park: [
{
parkedId: 'blogParkedId',
slug: '/blog',
title: 'Blog',
type: 'default-page',
},
]
```
> 2. Run npm run dev
> 3. Check mongodb aposDocs collection and find Blog page in published version, there is no lastPublishedAt field.

![Screenshot from 2021-11-29 16-51-26](https://user-images.githubusercontent.com/51342345/143917762-a9e9f3aa-219d-4958-a751-2ec7a5d6a2c5.png)

> 4. Then you can create some page and try to move this page as child of parked page. This throw a forbidden error.

![unknown](https://user-images.githubusercontent.com/51342345/143917815-3523a48d-ae48-432b-a048-dc664ca1eaa7.png)
>5. Tested on newly created project by CLI.

## Expected behavior
> A parked page should have DB field "lastPublishedAt",

## Describe the bug
> This causes an forbidden error (Publish parent page first), while moving another page under this parked page as child.

## Details

**Version of Node.js:**
16.13.0

**Server Operating System:**
Linux

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue in a newly created project with the shown page module park configuration, then inspect the published Blog document in the MongoDB aposDocs collection. Verify how parked pages are published and how child-page moves validate the parent. Done means the parked page has lastPublishedAt and another page can be moved beneath it without the forbidden error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, mongodb
Domain
backend, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.