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.36k stars 590 forks source link

3.4: In-Context editing throws a VueJS error on widgets from Global #3424

Open ytilis opened 3 years ago

ytilis commented 3 years ago

To Reproduce

Step by step instructions to reproduce the behavior:

  1. Create a widget area in @apostrophe/global (ie, a footerText field that you can add Rich Text to)
  2. Add it to the template via {% area data.global, 'footerText' %}
  3. Add a Rich Text widget with some content to our global area and save
  4. In-context on the page, click Edit Rich Text
  5. See error Screen Shot 2021-09-16 at 8 29 57 PM

Expected behavior

I expected to be able to edit the field in-context

Describe the bug

A VueJS error is thrown:

[Vue warn]: Error in v-on handler (Promise/async): "TypeError: Cannot read properties of null (reading '_url')" found in ---> at node_modules/apostrophe/modules/@apostrophecms/area/ui/apos/components/AposAreaWidget.vue

at node_modules/apostrophe/modules/@apostrophecms/area/ui/apos/components/AposAreaEditor.vue TypeError: Cannot read properties of null (reading '_url') at VueComponent.edit

Details

Version of Node.js:

Node v14.7.5

Server Operating System:

MacOS with my MongoDB instance running in Docker

Additional context:

I've attached the boilerplate clone I modified to recreate the problem, as well as a DB backup with some test data, as described above and show in the screenshot above.

The DB can be restored by extracting the zip file and running mongorestore --gzip --archive=a3-boilerplate_2021-09-16_20-46-42.archive

The login is User: test Pass: test

a3-boilerplate.zip a3-boilerplate_2021-09-16_20-46-42.archive.zip

abea commented 3 years ago

Definitely a bug. The intended behavior is that it would open an editor for the appropriate context document (in this case the global doc). This is on our current sprint list of error tickets.