Umbraco-cms: V8.7RC - Blocklist editor wont reflect nor save updates on blocklist elements with custom views

Created on 21 Aug 2020  路  3Comments  路  Source: umbraco/Umbraco-CMS

Umbraco version

I am seeing this issue on Umbraco version: In 8.7 RC

## Reproduction / steps to reproduce

  • create a new block list datatype, yes to live, no inplace
  • add a new blocklist element "MyFancyBlock" with one field, title as text (one-line)
  • create a custom view (see view code below)
  • select custom view for the blocklist element
  • add the whole thing to a doctype "page".
  • create some content with page doctype
  • add a block with "MyFancyBlock" and fill in the title. Observe that title is reflected as it should be in the view.
  • then click the block element - it openthe overlay, update the title. Observe that the title is NOT updated in the view

Other observations

  • If you remove the custom view from the block list element, then it saves and updates as expected.
  • Blocklist element is created as element, and default settings (not variant or ...)
  • no errors in the console

Extra error

If you open for editing, and click "Discard changes" the following console error is thrown:

angular.js?cdv=1:15635 TypeError: Cannot read property 'variants' of undefined
    at mapElementValues (umbraco.services.js?cdv=1:1046)
    at Object.blockObject.retrieveValuesFrom (umbraco.services.js?cdv=1:1504)
    at Object.close (umbraco.directives.js?cdv=1:18252)
    at Object.vm.close (umbraco.controllers.js?cdv=1:1001)
    at fn (eval at compile (angular.js?cdv=1:16486), <anonymous>:4:161)
    at UmbButtonController.destination.<computed> [as action] (angular.js?cdv=1:11475)
    at UmbButtonController.clickButton (umbraco.directives.js?cdv=1:2164)
    at fn (eval at compile (angular.js?cdv=1:16486), <anonymous>:4:245)
    at callback (angular.js?cdv=1:29019)
    at ChildScope.$eval (angular.js?cdv=1:19461)

"MyfancyBlock"

<button ng-click="api.editBlock(block, block.hideContentInOverlay, index, parentForm)" > 

    <div class="text-block">
        <h1>{{block.data.title}}</h1>
    </div>
</button>

Expected result

Updated content

Actual result

Stale content

Most helpful comment

Sorry for the late reply, this has indeed been fixed immediately in this PR: https://github.com/umbraco/Umbraco-CMS/pull/8701

Thanks for reporting, I'll close this one! 馃憤

All 3 comments

In future version you will be able to write ng-click="block.edit()". which should hopefully remove any misunderstandings in terms of the code to write.

We will look into this issue and whether we can replicate it.

@nielslyngsoe This kind of blocked me from building and testing backend custom views - has it been solved or is there another way to do it?

Sorry for the late reply, this has indeed been fixed immediately in this PR: https://github.com/umbraco/Umbraco-CMS/pull/8701

Thanks for reporting, I'll close this one! 馃憤

Was this page helpful?
0 / 5 - 0 ratings