Showing posts with label X-Frame-Options. Show all posts
Showing posts with label X-Frame-Options. Show all posts

Friday 23 June 2017

IE11 cannot save meta data when inside an iFrame

Problem:  I have two SharePoint sites, I am iFraming once site collection within a PageViewer control on the other SharePoint site.  I have disabled the iFrame security restrictions.  When I try edit the list item field columns, the data will not save in IE11.  Using IE 11 on the Order pages (without the iFraming) works.
The error manifests in that the Title is validating as if the title is blank when it's already filled in and most of the metadata is not saved/persisted on save.  MMS term data is the only data saved.

Initial Hypothesis:  As Chrome and lower level browsers work, the issue has to be with the implementation of IE.  I can see console errors in the IE developer toolbar "attachEvent" withi the SharePoint init.debug.js file is throwing the console JavaScript error. It appears that the issue only occurs in IE 11 when editing or adding list field data when the SharePoint site is within an iFrame.   So not common scenario but if you are using iFrames, it will affect a large portion of my user base.

Resolution:  Edit the master page in the Orders site collection to ensure the init.js uses the alternate path so the code shall save.


Posts on the iFraming issue Series:
IE11 not saving field data iframe Issue (This post)
Term Store/MMS musing when using iFrames (WebTaggingDialog)
Displaying SharePoint Site Pages in iFrames

Tuesday 20 June 2017

Term store mussings with iFrames

Problem: I have a SharePoint site (ClientOrders i.e. https://orders.radimaging.com/sites/client1) being iFramed in another SharePoint site (Portal i.e. https://portal.radimaging.com/), to iframe in the ClientOrders site collection.
I want to iframe in the list within the Portal page, show the list for my customers orders and allow the user to select a different term set when editing the order metadata i.e. Language.

Initial Hypothesis:  In the site Order Site Collection, I need to allow the site to be iFramed, I do this by suppressing the iFrame HTTP header that stops sub domain iFrame using the server control: AllowFraming.  See this post for details.  Once the pages on the Order site collection can be iFramed, I use a Page Viewer Web Part in the Portal site collection on a page and now I can see my Orders inside the Portal SharePoint site collection.  All is good up to this point.

The user edits the order item metadata and when the reach the language they with to change from English to Spanish.  The user clieck on the select termset icon (two tickets) and the popup (webTaggingDialog.aspx) fails to load with the Security exception.  This aspx page uses it's own master page on the 15 hive than can be updated (watch out for CU's overriding the change).  The information below highlights the change should you be prepared to change system hive files:

When adding term set meta data to a SharePoint list item, the SharePoint use a Root hive/15 hive file, WebTaggingDialog.aspx:
/_layouts/15/WebTaggingDialog.aspx?Field=Content%20Language&IsDlg=1

Resolution: In my case, I need to allow the Order Site Collection page to be iFramed so I had to go to the WFE's and change the hive (as this is a share system page), I changed the master page to suppress the SameOrigin HTTP response (using theAllowWebFraming server control).  I added the X-Framing-Options header back with the SameOrigin and allowfrom https://order.radimaging.com using IIS.  So just plain horrible.  The WebTaggingDialog.asp does not use the site collection master page.  I amend the dialog.master file.  the page now opens but it does not load the treeview control used to display the term set data e.g. Language

Problem: Now the problem is that the WebTaggingDialog is not loading the treeview control to display the term set.

Initial Hypothesis: JS lazy loading issue or it is using the iFrame parent page (Portal) rather then (the calling page) to build up the display.

Workaround:  I don't want to mess with the root hive dialog.master or webTaggingDialog.aspx as these are system pages and I need to write custom JavaScript and inject it to make the tree control work.  I simply uses JavaScript to hide the term store popup page (I never open the webTaggingDialod.aspx).
In the end, I disabled the Term set picker control by hiding the icon (2 tickets image shown above) and type ahead works for selecting content types and I do not offer the WebTaggingDialog.aspx.

Posts on the iFraming issue Series:
IE11 not saving field data iframe Issue
Term Store/MMS musing when using iFrames (This post)
Displaying SharePoinnt Site Pages in iFrames