Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Cédric 8 posts 60 karma points
    Mar 16, 2014 @ 15:55
    Cédric
    1

    Javascript error with single quotes in literals

    When I set my user language to french I have several problems with the backend.
    For example I can't save any stylesheets or scripts.

    I discovered that the problem come from literals that contains single quotes.

    An example editing Sylesheets: /umbraco/settings/stylesheet/editStylesheet.aspx

    $(document).ready(function () {
                    var editor = new Umbraco.Editors.EditStyleSheet({
                        nameTxtBox: $('#body_NameTxt'),
                        originalFileName: 'ddsmoothmenu',
                        cssId: '1083',
                        saveButton: $("#body_save"),
                        editorSourceElement: $('#body_editorSource'),
                        text: {
                            cssErrorHeader: 'Impossible d'enregistrer la feuille de style',
                            cssSavedHeader: 'La feuille de style a été enregistrée',
                            cssSavedText: 'La feuille de style a été enregistrée sans erreurs.',
                            cssErrorText: 'Please make sure that you have permissions set correctly',
                        }
                    });
                    editor.init();
                   
                    //bind save shortcut
                    UmbClientMgr.appActions().bindSaveShortCut();
                });

    How can I open an issue for this problem?

    Thanks

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 16, 2014 @ 16:20
    Jan Skovgaard
    0

    Hi Cédric

    You can file bug reports at http://issues.umbraco.org/issues - When you have done so please post the link to it in here so others who may come across this post can jump right to the bug and vote it up.

    Hope this answers your question - and good catch by the way! :)

    /Jan

  • Bjarne Fyrstenborg 1284 posts 4038 karma points MVP 8x c-trib
    Mar 16, 2014 @ 16:28
    Bjarne Fyrstenborg
    0

    Hi Cédric

    Yes, the single quote (apostrophe) probably need to be replaced with \' or \\' before sent to javascript..

    so for cssErrorHeader it would look like:

    cssErrorHeader:'Impossible d\'enregistrer la feuille de style',

    so the value sent to the literal could use .Replace() method to escape the quote characters in the string..

    /Bjarne

  • Cédric 8 posts 60 karma points
    Mar 16, 2014 @ 16:58
    Cédric
    1

    I reported the issue: http://issues.umbraco.org/issue/U4-4455
    Thanks guys!

    For the moment I let my user language set to english and no problem

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 16, 2014 @ 17:36
    Jan Skovgaard
    0

    I just voted this bug up - If you make other findings of bugs/errors or think some areas of Umbraco can be improved please don't hesitate to file issues on the tracker or of course discuss it whith others here on our.

    Cheers,
    Jan 

  • Cédric 8 posts 60 karma points
    Apr 09, 2014 @ 14:04
    Cédric
    100

    Has been resolved in Umbraco 7.1.0

Please Sign in or register to post replies

Write your reply to:

Draft