• I just updated to 1.9.120 and it only shows “Survey is loading…” on the frontend. In the console is the following error:

    boat-storage-rates/:111 Uncaught ReferenceError: theme is not defined
        at Object.success (boat-storage-rates/:111:39)
        at c (jquery.min.js?ver=3.7.1:2:25304)
        at Object.fireWith [as resolveWith] (jquery.min.js?ver=3.7.1:2:26053)
        at l (jquery.min.js?ver=3.7.1:2:77782)
        at XMLHttpRequest.<anonymous> (jquery.min.js?ver=3.7.1:2:80265)

    In the backend, when I am trying to edit the survey, I am getting the following error: Error. Editor content not saved.

    After downgrading back to 1.9.68, it works correctly again. Are there any adjustments I need to make for it to be compatible with the 1.9.120 update?

Viewing 3 replies - 1 through 3 (of 3 total)
  • I have just discovered the same problem. As “thewebtailors”reports … theme is not defined.

            <script>
                jQuery.ajax({
                    url:  "https://xxxxxxxx.org/wp-admin/admin-ajax.php?action=SurveyJS_GetSurveyJson",
                    type: "POST",
                    data: { Id: 3 },
                    success: function (data) {
                        var json = {}
                        if (data.json) {
                            json = JSON.parse(data.json.replace(/\\\"/g, "\"").replace(/\\\\/g, "\\").replace(/\\'/g, "'"));
                        }
                        if (data.theme) {
                            theme = JSON.parse(data.theme.replace(/\\\"/g, "\"").replace(/\\\\/g, "\\").replace(/\\'/g, "'"));
                        }
                        initSurvey3(json, theme);
                    }
                });
    
                function initSurvey3(json, theme) {
                    // Survey.StylesManager.applyTheme('stone');
    
                    // var customCss = {
                    //                     // }
    
                    const survey3 = new Survey.Model(json);
                    survey3.applyTheme(theme);
                    window.survey3 = survey3;
                    survey3                    .onComplete
                        .add(function (result) {
                            jQuery.ajax({
                                url:  "https://xxxxxxx.org/wp-admin/admin-ajax.php?action=SurveyJS_SaveResult",
                                type: "POST",
                                data: { SurveyId: '3', Json : JSON.stringify(result.data) },
                                success: function (data) {}
                            });
                            //document
                            //    .querySelector("#surveyResult-3")
                            //    .innerHTML = "result: " + JSON.stringify(result.data);
                        });
    
                    jQuery("#surveyElement-3").Survey({model: survey3/*, css: customCss*/});
                }
            </script>        

    The global javascript variable “theme” would have to have been defined and ideally with a value in Shortcode etc. so that at function initSurvey3(), the variable “theme” existed and had some value.

    That is the problem. Now I am going off to have a look in the code for my site and modify the JS so that it works.

    Plugin Author devsoftbaltic

    (@devsoftbaltic)

    Hello,

    thank you for the reporting! I believe that we’ve fixed both problems (frontend and backend) and updated the plugin.

    Thanks,
    Dmitry
    SurveyJS Team

    Dmitry,

    I am aware that on Github the Version has been bumped to at least 1.9.925 but WordPress will not manually or automatically update as it believes that there has not been a change – i.e. still on 1.9.920. I checked a few seconds before writing this post.

    I probably could do some updating manually but I fear to do this.

    This is becoming URGENT.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Error after Updating to 1.9.120’ is closed to new replies.