Copied to clipboard

Flag this post as spam?

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


  • Dan 15 posts 86 karma points
    Sep 19, 2018 @ 21:31
    Dan
    0

    Unable to login into Umbraco due to JavaScript error

    Unable to login into Umbraco due to JavaScript error. When trying to log into Umbraco, on the login screen there is a script console error saying that filetypes in undefined.

    The line is (line: 4747 in umbraco.services.js) which is as follows:

                formatFileTypes: function (fileTypes) {
                var fileTypesArray = fileTypes.split(','); //error is here!!!!!
                var newFileTypesArray = [];
                for (var i = 0; i < fileTypesArray.length; i++) {
                    var fileType = fileTypesArray[i];
                    if (fileType.indexOf('.') !== 0) {
                        fileType = '.'.concat(fileType);
                    }
                    newFileTypesArray.push(fileType);
                }
                return newFileTypesArray.join(',');
            },
    

    After further investigating and debugging, I have found in the that a media helper in the umbraco.controllers.js calls this method which passes in:

    Umbraco.Sys.ServerVariables.umbracoSettings.imageFileTypes
    

    To solve this issue, I have tried adding extra the following config settings to the umbracosettings.config file but this does not solve the issue.

    <imaging>
            <!-- what file extension that should cause umbraco to create thumbnails -->
            <imageFileTypes>jpeg,jpg,gif,bmp,png,tiff,tif</imageFileTypes>
            <!-- what attributes that are allowed in the editor on an img tag -->
            <allowedAttributes>alt,border,class,style,align,id,name,onclick,usemap</allowedAttributes>
            <!-- automatically updates dimension, file size and extension attributes on upload -->
            <autoFillImageProperties>
                <uploadField alias="umbracoFile">
                    <widthFieldAlias>umbracoWidth</widthFieldAlias>
                    <heightFieldAlias>umbracoHeight</heightFieldAlias>
                    <lengthFieldAlias>umbracoBytes</lengthFieldAlias>
                    <extensionFieldAlias>umbracoExtension</extensionFieldAlias>
                </uploadField>
            </autoFillImageProperties>
        </imaging>
    

    The login screen is completely messed up showing all views for login, reset password etc as there is this script error. Has anyone had this error before and if so how did you fix it?

  • Nik 1593 posts 7151 karma points MVP 6x c-trib
    Sep 19, 2018 @ 22:02
    Nik
    1

    Hi Dan,

    Normally when the backoffice is screwy like that. I normally bump the client dependency version number in the Client Dependency config file. The backoffice JS is normally pretty stable in my experience that that often fixes it.

    Other times I've seen it being screwy have been when Url re-writes have change things from posts/gets by adding/removing trailing slashes and forcing lowercase urls so I'd check for things like that as well.

    Finally, If those don't fix it. I'd possible download a clean install of the same version number and then replace the contents of Umbraco and UmbracoClient folders with the files from the clean install - This is very much a last resort style action though.

    Nik

  • Dan 15 posts 86 karma points
    Sep 24, 2018 @ 09:39
    Dan
    0

    Hi Nik,

    Thanks for the advice, unfortunately none of your suggestions worked. It is absolutely bizzare how this has happened, I have never encountered an issue like this before. Like you said, the back office is mostly reliable.

    Thanks,

    Dan

Please Sign in or register to post replies

Write your reply to:

Draft