0

I am trying to add a button to a page showing a community site discussion that launches a modal dialog showing the page with the discussion and all replies but when I click the button the modal dialog says there was an error and there is the message: Resource interpreted as Document but transferred with MIME type image/gif: "https://site.sharepoint.com/_layouts/15/images/blank.gif". in the console log. I have used the function to launch a modal dialog many times and it has always worked. When I test it on a typical Discussion Board list it works as well. Any thoughts on why a Community Discussion list would be different? Here is the code I am using for the modal dialog. In this case pageUrl = /sites/SharePointInitiativeSandbox/SitePages/Topic.aspx?RootFolder=/sites/SharePointInitiativeSandbox/Lists/Community%20Discussion/Test If I type this url into the browser window it works so I don't this it is the issue.

function dialogfunction(pageUrl) {
var options = { url: pageUrl, width: 800, height: 600, dialogReturnValueCallback: onCloseCallback };

SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);
}

function onCloseCallback(dialogResult, returnValue){
SP.UI.Notify.addNotification('Something has changed');
SP.UI.ModalDialog.RefreshPage(SP.UI.DialogResult.OK);
}
5
  • Did you try OpenPopUpPage('/sites/SharePointInitiativeSandbox/SitePages/Topic.aspx?RootFolder=/sites/SharePointInitiativeSandbox/Lists/Community%20Discussion/Test') Aug 24, 2015 at 19:22
  • I just did but I get the exact same error and message.
    – James11
    Aug 24, 2015 at 19:31
  • Not sure how site pages works, try /sites/SharePointInitiativeSandbox/lists/community%20discussion/flat.aspx?RootFolder=/sites/SharePointInitiativeSandbox/Lists/Community%20Discussion/Test . unfortunatly, both are working in my site Aug 24, 2015 at 20:16
  • @sekhar I tried that but got a message saying that page didn't exist. I have tested several different scenarios and it seems like there is definitely an issue with displaying any Community Discussions page all other pages display fine but any Community Discussion page triggers an error.
    – James11
    Aug 25, 2015 at 12:58
  • Changing the url to flat.aspx works now! Odd though because I don't think I did anything different from when I tried is before.
    – James11
    Aug 25, 2015 at 16:57

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.