Copied to clipboard

Flag this post as spam?

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


  • Darren Eccles 59 posts 298 karma points
    Mar 21, 2017 @ 20:30
    Darren Eccles
    0

    Umbraco Preview - Not Working - Version 7.5.10

    Hi Guys,

    Just noticed my Preview section isn't working, when I click on the preview button I get the following error:

    Server Error in '/' Application.

    The resource cannot be found.

    Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

    Requested URL: /umbraco/preview/

    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1055.0

    The Url is going to: http://localhost:53114/umbraco/preview/?id=1065

    however I can get it working if I change the Url to include the index.html:

    http://localhost:53114/umbraco/preview/index.html?id=1065

    How can I change the path in the umbraco admin to include the index.html?

    Thanks

    Darren

  • Darren Eccles 59 posts 298 karma points
    Mar 21, 2017 @ 20:46
    Darren Eccles
    103

    Fixed it :)

    How to fix

    1. Go to the following folder in your project: Umbraco/Js/
    2. Open 'umbraco.controllers.js'
    3. Go to '$scope.preview' on Line 4980 and add index.html to lines 4988 and 4991

      $scope.preview = function (content) {
      
      
      if (!$scope.busy) {
      
      
      
      // Chromes popup blocker will kick in if a window is opened 
      // outwith the initial scoped request. This trick will fix that.
      //  
      var previewWindow = $window.open('preview/index.html?id=' + content.id, 'umbpreview');
      $scope.save().then(function (data) {
          // Build the correct path so both /#/ and #/ work.
          var redirect = Umbraco.Sys.ServerVariables.umbracoSettings.umbracoPath + '/preview/index.html?id=' + data.id;
          previewWindow.location.href = redirect;
      });
      
      }

      };

    Hopefully this will be useful for someone else

    Darren

  • Jeremias 53 posts 278 karma points
    Dec 18, 2017 @ 14:19
    Jeremias
    0

    Thank you Darren Eccles,

    I had the same problem and did not know how to fix it! Now it works!!! Thank you! (I work with Umbraco 7.7.7 and in my Project it was line 1427...)

  • Marcio Goularte 388 posts 1360 karma points
    Mar 30, 2018 @ 15:29
    Marcio Goularte
    0

    I had the same problem with version 7.9.2.

    But the code change I had to do in the file at:

     Umbraco/JS/umbraco.directives.js:  line 2407
    
    $scope.preview = function (content) {
                    if (!$scope.busy) {
                        // Chromes popup blocker will kick in if a window is opened 
                        // without the initial scoped request. This trick will fix that.
                        //  
                        var previewWindow = $window.open('preview/index.html?init=true&id=' + content.id, 'umbpreview');
                        // Build the correct path so both /#/ and #/ work.
                        var redirect = Umbraco.Sys.ServerVariables.umbracoSettings.umbracoPath + '/preview/index.html?id=' + content.id;
                        //The user cannot save if they don't have access to do that, in which case we just want to preview
                        //and that's it otherwise they'll get an unauthorized access message
                        if (!_.contains(content.allowedActions, 'A')) {
                            previewWindow.location.href = redirect;
                        } else {
                            $scope.save().then(function (data) {
                                previewWindow.location.href = redirect;
                            });
                        }
                    }
                };
    
  • Heather Floyd 610 posts 1032 karma points MVP 6x c-trib
    Apr 18, 2018 @ 20:33
    Heather Floyd
    4

    FYI - For Version 7.10 + This has all been changed...

    See: http://issues.umbraco.org/issue/U4-11090

    After I completed an upgrade from Umbraco Version 7.9.2 to 7.10.3 the "Preview" functionality was resulting in a 404 error.

    I saw both an /Umbraco/preview/ and an /Umbraco/preview.old/ folder in my site. Just to make sure the upgrade was completed properly, I downloaded the ZIP version of 7.10.3 and did a folder comparison with my site. The ZIP contents didn't include either "preview" folder, so I deleted them both from my site.

    After doing a hard reload in the browser, the preview functionality is now working properly for me.

  • Sumesh KP 35 posts 108 karma points c-trib
    Nov 15, 2018 @ 11:52
    Sumesh KP
    1

    Cool....

    We have upgraded website from Umbraco 7.2.x to 7.12.4 step by step. But we blocked in the final step by following error

    Server Error
    
    403 - Forbidden: Access is denied.
    You do not have permission to view this directory or page using the credentials that you supplied.
    

    I have tried many ways to fix the error such as Umbraco file permissions, Default document list, Manual degrade & upgrades etc.

    But at last I found the fix from Heather Floyd's Thread. It fixed by error. I have deleted the ~/Umbraco/preview and ~/umbraco/preview.zip from my folder andnow the preview section works perfectly

    Thank you @Heather Floyd

    • Sumesh
  • Heather Floyd 610 posts 1032 karma points MVP 6x c-trib
    Nov 15, 2018 @ 17:08
    Heather Floyd
    0

    I'm glad it helped, Sumesh!

  • Dave Mason 14 posts 94 karma points
    Mar 19, 2019 @ 16:22
    Dave Mason
    0

    This should really be in the version specific upgrade instructions! Thanks!

Please Sign in or register to post replies

Write your reply to:

Draft