umco / umbraco-vorto

1:1 multilingual property editor wrapper for Umbraco

Home Page:https://our.umbraco.org/projects/backoffice-extensions/vorto

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RTE: Cannot read property 'getContent' of null

enkelmedia opened this issue · comments

Hi!

I'm using Vorto 1.5.3 on Umbraco 7.5.4 and have addeda grid editor to the view. Works fine to load it the first time, add content and so on but when switching back and forth between the language-tabs I get this error after a while:

Cannot read property 'getContent' of null

The error comes from the Umbraco Directives-file (from the RTE-property editor):

                        var unsubscribe = scope.$on("formSubmitting", function () {                       
                            scope.value = tinyMceEditor.getContent();
                        });

and are thrown when Vorto broadcasts the formSubmitting-event.

                     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;
                                 }
                            });

I guess that the editor is removed from the view and that is why the editor can't find the tinyMceEditor-variable?

Another thing with the grid in Vorto is that it does not seem to "redraw" the grid after save and publish. Ie. the "Headline (H1)" grid editor looks like a nice H1 in the grid but after saving it does not reload and looks like paragraf or something.

When I'm working with a "regular" grid-editor and pushed Save and Publish, the whole editor redraws it self - this is not done when the grid is inside a Vorto-wrapper.

See this move to get a visuall presentation of the issue: https://www.dropbox.com/s/34mrsyrgdqfswm0/Screen%20Vorto%20Issues.mp4?dl=0

Me spam is back again. Turns out the the grid controller wipes all style-configuration etc during "formSubmitting" to prepare the model to be sent to the server. After this it reloads all the configuration values again and this does not work when it's inside the Vorto-wrapper.

I'm not sure how at the moment but I guess that saving the configuration and then reapply after the fromSubmitting-event could do the trick.