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
Other
4.36k stars 590 forks source link

3.0: Parked page type error #3192

Closed myovchev closed 2 years ago

myovchev commented 3 years ago

To Reproduce

  1. Park basically anything you want. I've played with the search but it's not relevant to it. Here is my @apostrophecms/page test config:
    module.exports = {
    options: {
    types: [
      {
        name: '@apostrophecms/home-page',
        label: 'Home'
      }
    ],
    park: [
      {
        parkedId: 'search',
        type: '@apostrophecms/search',
        _defaults: {
          slug: '/search',
          title: 'Search'
        }
      }
    ]
    }
    };
  2. Edit Title or Slug from the page management UI. The update fails with console error: TypeError: Cannot read property 'emit' of undefined

EDIT 6 July 2021 Additional information about this bug. It is present ONLY if the parked page type is NOT included in the types option.

Expected behavior

Defaults should be editable.

Details

*Apostrophe v3.0.1*

Version of Node.js: v12.21.0

Server Operating System: Ubuntu 20.04.2 LTS

myovchev commented 3 years ago

This is kind of showstopper in fact. It blocks any update from the UI overlay, so only contextual page changes are possible.

boutell commented 3 years ago

I am able to change the title of the home page, which is set via _defaults, so this is a bit surprising, but will try to reproduce it with additional parked pages using _defaults, as you suggest.

On Mon, Jun 28, 2021 at 6:51 AM Miro Yovchev @.***> wrote:

This is kind of showstopper in fact. It blocks any update from the UI overlay, so only contextual page changes are possible.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/apostrophecms/apostrophe/issues/3192#issuecomment-869581960, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAH27JFY72HDJFOEVYN44LTVBH2NANCNFSM47LKUM6A .

--

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

boutell commented 3 years ago

I cannot reproduce this issue with the configuration below:

    park: [
      {
        parkedId: 'wiggy',
        type: 'default-page',
        _defaults: {
          slug: '/wiggy',
          title: 'Wiggy'
        }
      }
    ]

I think the issue might be more specific. Can you create a test project?

myovchev commented 3 years ago

I've reproduced it on a clean a3-boilerplate project. I'll give you more details tomorrow.

myovchev commented 3 years ago

One quick question @boutell , do you have default-page in types? In my attempts the type is not present in the type page options.

myovchev commented 3 years ago

@boutell See the additional info (the EDIT) in the issue. It's a legit bug.

abea commented 3 years ago

I got this on the upcoming sprint backlog. 👍

myovchev commented 3 years ago

Thanks!