Umbraco-CMS icon indicating copy to clipboard operation
Umbraco-CMS copied to clipboard

BlockList: Cannot read properties of undefined (reading 'variants')

Open rpteasolutions opened this issue 1 year ago • 2 comments

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

10.8.5

Bug summary

This was also tested on 13.2.2.

Sometimes when trying to submit changes to a BlockList item it throws an error clicking the button. If you cancel and discard your changes, open up the item again, make your changes and submit it, you are allowed to this time.

The error: angular.js:15697 TypeError: Cannot read properties of undefined (reading 'variants') at mapElementValues (umbraco.services.min.js?d=638479086250000000:1:154281) at blockObject.retrieveValuesFrom (umbraco.services.min.js?d=638479086250000000:1:164536) at Object.submit (umbraco.directives.min.js?d=638479086250000000:1:576152) at vm.submitAndClose (umbraco.controllers.min.js?d=638479086250000000:1:184676) at fn (eval at compile (angular.js:16548:15), :4:170) at d. [as action] (angular.js:11517:22) at UmbButtonController.clickButton (umbraco.directives.min.js?d=638479086250000000:1:47809) at fn (eval at compile (angular.js:16548:15), :4:245) at e (angular.js:29123:13) at b.$eval (angular.js:19523:16)

Specifics

Tested in Firefox and Chrome using throttling, seeing the same behaviour.

Steps to reproduce

  1. Create an Element type with a Textstring
  2. Create a BlockList datatype with your element as a block
  3. Create a Docment type with the BlockList as a property, allow the Document type as root too
  4. Create a node of the Document type
  5. Create an item on the property
  6. Save and publish the node
  7. Open dev tools and set throttling in the network tab to something slow enough for the next steps
  8. Click Save and publish
  9. Before the success message is shown, click on the existing item
  10. Wait for the success message to appear
  11. Click Submit
  12. Error will be shown in the Console tab Repeating step 8-11 should reproduce the problem every time.

Expected result / actual result

Expected result: Being able to submit the new changes or not being able to open the item until the Save and publish action is done. Actual result: Javascript error. See bug summary.

rpteasolutions avatar Apr 05 '24 10:04 rpteasolutions

Hi there @rpteasolutions!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

  • We'll assess whether this issue relates to something that has already been fixed in a later version of the release that it has been raised for.
  • If it's a bug, is it related to a release that we are actively supporting or is it related to a release that's in the end-of-life or security-only phase?
  • We'll replicate the issue to ensure that the problem is as described.
  • We'll decide whether the behavior is an issue or if the behavior is intended.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot :robot: :slightly_smiling_face:

github-actions[bot] avatar Apr 05 '24 10:04 github-actions[bot]

Hey! Thanks a lot for reporting this issue and providing clear reproduction steps🤩. I was able to reproduce this on versions 10.8.5, 13.2.2. The issue also occurs if you are using a Block Grid Editor. I will go ahead and mark this issue as a sprint candidate!

andr317c avatar Apr 15 '24 09:04 andr317c

Fixed in #16961, for v13.5.0.

leekelleher avatar Aug 27 '24 14:08 leekelleher

Not sure if it is related, but have upgraded to 13.5.0 and am now seeing similar errors with different values for the undefined part. This occurs when using the clipboard to copy content (from works, paste, falls over with the errors below)

angular.js:15697 TypeError: Cannot read properties of undefined (reading 'iconColor')
    at BlockCardController.vm.$onChanges (umbraco.directives.min.js?d=638620766350000000:1:456280)
    at angular.js:10646:15
    at r (angular.js:396:9)
    at p (angular.js:10642:9)
    at g (angular.js:9942:13)
    at angular.js:9807:30
    at angular.js:10221:16
    at d (angular.js:9985:16)
    at m (angular.js:10745:20)
    at angular.js:34084:15

AND

angular.js:15697 TypeError: Cannot read properties of undefined (reading 'layout')
    at Array.rawRteBlockResolver (umbraco.services.min.js?d=638620766350000000:1:203652)
    at resolvePropertyForPaste (umbraco.services.min.js?d=638620766350000000:1:8141)
    at umbraco.services.min.js?d=638620766350000000:1:6116
    at Array.forEach (<anonymous>)
    at clipboardTypeResolvers.<computed> (umbraco.services.min.js?d=638620766350000000:1:6065)
    at service.parseContentForPaste (umbraco.services.min.js?d=638620766350000000:1:8373)
    at BlockEditorModelObject.createFromBlockData (umbraco.services.min.js?d=638620766350000000:1:169322)
    at requestPasteFromClipboard (umbraco.directives.min.js?d=638620766350000000:1:582529)
    at Object.clickPasteItem (umbraco.directives.min.js?d=638620766350000000:1:578034)
    at fn (eval at compile (angular.js:16548:15), <anonymous>:4:366)

bradleykronson avatar Sep 16 '24 09:09 bradleykronson