question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Infinite editing editorService.contentEditor unable to create new content item

See original GitHub issue

I am currently working on a back office extension to allow users to create new content items without leaving the context of the current item using the infinite editing features.

The documentation for the contentEditor hints that this should be possible by setting the create flag on the editor options to true. Although the docs mention Media and not Content?

create Boolean Create new content item

See: https://our.umbraco.com/apidocs/v8/ui/#/api/umbraco.services.editorService

However there is nowhere to set the alias of the type of content you would like to create, or where in the tree it should create the new item.

Reproduction

If I run the following:

function create() {
      var options = {
        create: true,
        submit: function (model) {
          editorService.close();
        },
        close: function () {
          editorService.close();
        }
      }
      editorService.contentEditor(options);
}

you end up with the following error.

GET http://localhost:2427/umbraco/backoffice/UmbracoApi/Content/GetEmpty?contentTypeAlias=undefined&parentId=1068 404 (Not Found)

1068 is the ID of the page I am currently on.

Bug summary

There should be a way to create a new piece of content using the editorService.contentEditor I would expect the editor object to have attributes for:

  • documentTypeAlias
  • parentId

Specifics

  • Umbraco 8.0.2

Steps to reproduce

As mentioned above

Expected result

To be able to initiate the creation of new content from the editorService.contentEditor with a call like the following

function create() {
      var options = {
        create: true,
        parentId: 1069,
        documentTypeAlias: 'contentPage',
        submit: function (model) {
          editorService.close();
        },
        close: function () {
          editorService.close();
        }
      }
      editorService.contentEditor(options);
}

Actual result

you can’t. And when you set the create flag I get the following error:

GET http://localhost:2427/umbraco/backoffice/UmbracoApi/Content/GetEmpty?contentTypeAlias=undefined&parentId=1068 404 (Not Found)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
pgregorynzcommented, Aug 2, 2019

Hey Umbraco team. I have put through a pull request to resolve this issue.

https://github.com/umbraco/Umbraco-CMS/pull/6031

1reaction
nul800sebastiaancommented, Jun 17, 2019

Sweet, @nielslyngsoe also seems to think it makes a lot of sense, so my fears have been removed.

Should be pretty easy to make sure those variables get passed along.

Read more comments on GitHub >

github_iconTop Results From Across the Web

content editor opened via the editorservice not triggering ...
I'm creating a custom control that allows for infinite editor of content nodes it's linked to with the editorService.
Read more >
Umbraco backoffice listview + infinite editing - part 3
We set up some config for the editor in an options object, we need to give it the id of the content node...
Read more >
Cloud Shell Editor interface overview
Cloud Shell comes with a built-in code editor that allows you to browse file directories, and view and edit files, with continued access...
Read more >
Automation 360 v.25 Release Notes
Review what's new and changed, and the fixes and limitations in the Automation 360 v.25 release.
Read more >
Block List Editor - How to build a website with Umbraco 10
In this episode I show you how I use the block list editor to create a row based page editing approach. We create...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found