umco / umbraco-vorto

1:1 multilingual property editor wrapper for Umbraco
https://our.umbraco.org/projects/backoffice-extensions/vorto
MIT License
44 stars 42 forks source link

scope.value.values can be null #84

Closed JimBobSquarePants closed 6 years ago

JimBobSquarePants commented 7 years ago

I've seen this error pop up a few times when I have empty Vorto values in a doctype and I save or publish a document type.

TypeError: Cannot set property 'en-AU' of null

The error is thrown in the function below.

var unsubscribe = scope.$on("vortoSyncLanguageValue", function (ev, args) {
                if (args.language === scope.language) {
                    scope.$broadcast("formSubmitting", { scope: scope });
                    scope.value.values[scope.language] = scope.model.value; // Error thrown here
                }
            });

It looks like you need to ensure values is always an array but maybe you know why is could ever be.

Jitse commented 7 years ago

I think this was already fixed in commits 97d9020 (#58) and 075b9cf on November 1st, it just hasn't been released yet.

mattbrailsford commented 6 years ago

Appears to be fixed