Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTE: Cannot read property 'getContent' of null #75

Open
enkelmedia opened this issue Dec 7, 2016 · 4 comments
Open

RTE: Cannot read property 'getContent' of null #75

enkelmedia opened this issue Dec 7, 2016 · 4 comments

Comments

@enkelmedia
Copy link

enkelmedia commented Dec 7, 2016

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?

@enkelmedia
Copy link
Author

enkelmedia commented Dec 7, 2016

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.

@enkelmedia
Copy link
Author

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

@enkelmedia
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant