When a CMS content document initially renders, the data type grid is displayed with an Add form and and an Update form directly beneath the grid and the Add button. Shouldn't it just be the Add button that is shown?
After adding an item, the Add and Update forms are no longer displayed, only the Add button, which is what I'd expect.
But then, if I go to a different document and return again, both the Add and Update forms are there again.
This is causing confusion for editors on my customer websites, where they enter data into the Add or Update form, and it doesn't do anything.
2 different 4.7.1.1 websites, each with a different version of the dll, as I was trying to see if it was a specific version that was causing the issue:
uComponents.Core.dll Version 3.1.1.29742
uComponents.Core.dll Version 3.1.0.27082
Both are exhibiting the same problem.
If it helps, the following packages are also installed on each website:
Thanks, Ove. There are javascript errors. I've pasted two of them below. In each case the "UmbracoImageViewer is not a function" error seems to be the problem, although I don't know what is causing this. In the jQuery selectors keyActivities and socialLinks are data type grid controls. I assume the following Inserticon and Editicon selectors are the Insert or Update forms with the property name ("icon") appended to it. Could the issue be that my document types have multiple data type grid controls? Or could it be that two different data type grid controls on the same document type that have the same property names causes an issue?
There are no 404 errors that I can see. But when looking at the HTTP headers there are no requests for ImageViewer.js. Another thing is that I have a single data type grid on another document type in the same umbraco site that contains a Media Picker and I don't get the error there, plus the add / update forms don't appear either.
Thanks to Ove's help I've managed to find what I think is the source of the issue, although it's complicated, and beyond my level of Umbraco expertise.
I have two document types (one called home, another called landing). I have two data type grid controls (one called banner and one called activities) on each page, both controls have media picker columns.
Both document types have a javascript file called DependencyHandler.axd, but each has a different s parameter in the query string:
Landing has considerably more data in the s parameter.
When looking at the contents of each file, they are almost identical, except that the Landing version contains the following javascript UmbracoImageViewer function on line 1):
Umbraco.Sys.registerNamespace("Umbraco.Controls");(function($){$.fn.UmbracoImageViewer=function(opts){var conf=$.extend({style:false,linkTarget:"_blank",umbPath:""},opts);return this.each(function(){new Umbraco.Controls.ImageViewer().init($(this),conf);});} $.fn.UmbracoImageViewerAPI=function(){if($(this).length!=1){throw"UmbracoImageViewerAPI selector requires that there be exactly one control selected";};return Umbraco.Controls.ImageViewer.inst[$(this).attr("id")]||null;};Umbraco.Controls.ImageViewer=function(){return{_cntr:++Umbraco.Controls.ImageViewer.cntr,_containerId:null,_context:null,_serviceUrl:"",_umbPath:"",_style:false,_linkTarget:"",init:function(jItem,opts){this._context=jItem.get(0).ownerDocument;Umbraco.Controls.ImageViewer.inst[this._cntr]=this;if(!jItem.attr("id"))jItem.attr("id","UmbImageViewer_"+this._cntr);Umbraco.Controls.ImageViewer.inst[jItem.attr("id")]=Umbraco.Controls.ImageViewer.inst[this._cntr];this._containerId=jItem.attr("id");this._umbPath=opts.umbPath;this._serviceUrl=this._umbPath+"/controls/Images/ImageViewerUpdater.asmx";this._style=opts.style;this._linkTarget=opts.linkTarget;},updateImage:function(mediaId,callback){this._showThrobber();var _this=this;$.ajax({type:"POST",url:_this._serviceUrl+"/UpdateImage",data:'{ "mediaId": '+parseInt(mediaId)+', "style": "'+_this._style+'", "linkTarget": "'+_this._linkTarget+'"}',contentType:"application/json; charset=utf-8",dataType:"json",success:function(msg){var rHtml=$("
Where the Home version has this (note the absense of the UmbracoImageViewer function declaration):
Umbraco.Sys.registerNamespace('Umbraco.Controls');Umbraco.Controls.TabView=(function(){var onChangeEvents=[];var obj={setActiveTab:function(tabviewid,tabid,tabs){for(var i=0;ivar activeTab=jQuery("#"+tabid).attr("class","tabOn");jQuery("#"+tabid+"layer").show();jQuery("#"+tabviewid+'_activetab').val(tabid);jQuery(".tinymceMenuBar").hide();jQuery(document).ready(function(){jQuery("#"+tabid+"layer .tinymceMenuBar:first").show();});for(var i=0;iif(!tvWidth){tvWidth=jQuery(window).width();if(document.location){tvWidth=tvWidth-10;}} var tabviewHeight=tvHeight-12;jQuery("#"+TabViewName).width(tvWidth);jQuery("#"+TabViewName).height(tabviewHeight);for(i=0;inextTab="0"+nextTab;if(nextTab!="00"){if(jQuery("#"+preFix+'_tab'+nextTab)!=null){setActiveTab(preFix,preFix+'_tab'+nextTab,eval(preFix+'_tabs'));}}}};return obj;})();function setActiveTab(tabviewid,tabid,tabs){Umbraco.Controls.TabView.setActiveTab(tabviewid,tabid,tabs);} function resizeTabView(TabPageArr,TabViewName){Umbraco.Controls.TabView.resizeTabViewTo(TabPageArr,TabViewName);} function resizeTabViewTo(TabPageArr,TabViewName,tvHeight,tvWidth){Umbraco.Controls.TabView.resizeTabViewTo(TabPageArr,TabViewName,tvHeight,tvWidth);} function tabSwitch(direction){Umbraco.Controls.TabView.tabSwitch(direction);} ;;;
I have searched the whole of the Home version of and the UmbracoImageViewer function declaration is nowhere to be seen.
So, I know it's probably a long shot, but are there any thoughts why the Home document type version of DependencyHandler.axd does not contain the UmbracoImageViewer function declaration? It appears to be the fact that this is missing that is causing the javascript on the page to fail, as it is called later on, in the page.
I have copies of the files should anyone want to see them.
Alternatively, does anyone have any suggestion on how I might get around this issue?
I think I have found the problem. Don't shoot me for not trying this from the outset as I could have saved a lot of hassle...
The additional Update form appears when the data type grid includes a Media Picker. Can someone please confirm if this is the case? As I said before, I'm running Umbraco 4.7.1.1, with uComponents 3.1.1
I don't know if it causes issues on any other versions. I've spent a huge amount of time on this. Hopefully a bugfix will be available, failing that a work around.
Also, I'm not certain what caused the Add form to appear in some circumstances, but it may be related.
I tried setting it up editors like you in your screenshot, and I cannot seem to reproduce the issue.
The DependencyHandler file is used by the Umbraco backend as a whole, including uComponents. It packs all javascript and css resources together in one file, so you will not see individual 404's while it is activated.
Try setting <compilation debug="true" /> in your web.config and load the page again.
One workaround you can try is to add a media picker to the "Generic Properties" tab (so its partly hidden). That should probably force Umbraco to load the ImageViewer file.
I did set <compilation debug="true" /> and can verify that ImageViewer.js was not loaded on the document type where the issue is occurring. The document type did not have a Media Picker property specified on it or a parent document type.
I then looked on the document type that was not exhibiting the issue, and it did have a Media Picker property specified. It also had the ImageViewer.js file loaded.
So I followed your workaround and added a Media Picker to the "Generic Properties" tab on the document type where the issue is occurring. Hey presto, the issue disappeared.
So, it appears that for some reason the ImageViewer.js file is not loaded when there is a uComponent Datatype Grid control that contains a Media Picker control, if the document type that the data type belongs to does not have a Media Picker on it or a parent document type.
I just wanted to say thanks for your time on this as I now have a workable solution. Although it would be nice to get the issue resolved properly at some point.
If I can I will mark your last post as the solution (I might not have enough KARMA yet...)
OMG!! I have just had this problem ... and adding a media picker to the Generic tab worked ... not sure what the client is going to think of that though! :-(
DataType Grid Bug
Umbraco 4.7.1.1
When a CMS content document initially renders, the data type grid is displayed with an Add form and and an Update form directly beneath the grid and the Add button. Shouldn't it just be the Add button that is shown?
After adding an item, the Add and Update forms are no longer displayed, only the Add button, which is what I'd expect.
But then, if I go to a different document and return again, both the Add and Update forms are there again.
This is causing confusion for editors on my customer websites, where they enter data into the Add or Update form, and it doesn't do anything.
What can I do to remove these forms?
Bump! Isn't anybody out there experiencing the same issue?
Here's a screenshot (it also sometimes has an "Add" form, same as the update one you can see here):
Hi Mark,
Can you tell me which version of uComponents you are using?
I will take a look, see if I can reproduce the issue.
Thanks, Lee.
Thanks Lee,
2 different 4.7.1.1 websites, each with a different version of the dll, as I was trying to see if it was a specific version that was causing the issue:
uComponents.Core.dll Version 3.1.1.29742
uComponents.Core.dll Version 3.1.0.27082
Both are exhibiting the same problem.
If it helps, the following packages are also installed on each website:
Those buttons are hidden on page load by a jquery script. It does look like something is preventing the script from running.
Could you check if there are any javascript errors in your backend?
Thanks, Ove. There are javascript errors. I've pasted two of them below. In each case the "UmbracoImageViewer is not a function" error seems to be the problem, although I don't know what is causing this. In the jQuery selectors keyActivities and socialLinks are data type grid controls. I assume the following Inserticon and Editicon selectors are the Insert or Update forms with the property name ("icon") appended to it. Could the issue be that my document types have multiple data type grid controls? Or could it be that two different data type grid controls on the same document type that have the same property names causes an issue?
Sounds more like you're missing a javascript file in your umbraco installation.
Could you check if there are any 404 errors when you load the page?
Specifically, if the file "ImageViewer.js" is loaded.
Thanks again, Ove.
There are no 404 errors that I can see. But when looking at the HTTP headers there are no requests for ImageViewer.js. Another thing is that I have a single data type grid on another document type in the same umbraco site that contains a Media Picker and I don't get the error there, plus the add / update forms don't appear either.
Thanks to Ove's help I've managed to find what I think is the source of the issue, although it's complicated, and beyond my level of Umbraco expertise.
I have two document types (one called home, another called landing). I have two data type grid controls (one called banner and one called activities) on each page, both controls have media picker columns.
Both document types have a javascript file called DependencyHandler.axd, but each has a different s parameter in the query string:
Home:
Landing:
Landing has considerably more data in the s parameter.
When looking at the contents of each file, they are almost identical, except that the Landing version contains the following javascript UmbracoImageViewer function on line 1):
else{c=this._getContainer().find(".bgImage");c.css("background-image","url('"+path+"')");}},_getContainer:function(){return $("#"+this._containerId,this._context);},_updateImageFromAjax:function(rHtml){this._getContainer().html(rHtml.find(".imageViewer").html());},_showThrobber:function(){var c=null;if(this._style!="ThumbnailPreview"){c=this._getContainer().find("img");c.attr("src",this._umbPath+"/images/throbber.gif");c.css("margin-top",((c.height()-15)/2)+"px");c.css("margin-left",((c.width()-15)/2)+"px");}
else{c=this._getContainer().find(".bgImage");c.css("background-image","");c.html("");var img=c.find("img");img.attr("src",this._umbPath+"/images/throbber.gif");img.css("margin-top","45px");img.css("margin-left","45px");}}}}
Umbraco.Controls.ImageViewer.cntr=0;Umbraco.Controls.ImageViewer.inst={};})(jQuery);
;;;
Where the Home version has this (note the absense of the UmbracoImageViewer function declaration):
I have searched the whole of the Home version of and the UmbracoImageViewer function declaration is nowhere to be seen.
So, I know it's probably a long shot, but are there any thoughts why the Home document type version of DependencyHandler.axd does not contain the UmbracoImageViewer function declaration? It appears to be the fact that this is missing that is causing the javascript on the page to fail, as it is called later on, in the page.
I have copies of the files should anyone want to see them.
Alternatively, does anyone have any suggestion on how I might get around this issue?
Thanks!
I think I have found the problem. Don't shoot me for not trying this from the outset as I could have saved a lot of hassle...
The additional Update form appears when the data type grid includes a Media Picker. Can someone please confirm if this is the case? As I said before, I'm running Umbraco 4.7.1.1, with uComponents 3.1.1
I don't know if it causes issues on any other versions. I've spent a huge amount of time on this. Hopefully a bugfix will be available, failing that a work around.
Also, I'm not certain what caused the Add form to appear in some circumstances, but it may be related.
Just to add. The additional forms disappear when you "Save & Publish". So the problem only appears to be on initial page load.
Hi
I tried setting it up editors like you in your screenshot, and I cannot seem to reproduce the issue.
The DependencyHandler file is used by the Umbraco backend as a whole, including uComponents. It packs all javascript and css resources together in one file, so you will not see individual 404's while it is activated.
Try setting <compilation debug="true" /> in your web.config and load the page again.
One workaround you can try is to add a media picker to the "Generic Properties" tab (so its partly hidden). That should probably force Umbraco to load the ImageViewer file.
Hi Ove.
I did set <compilation debug="true" /> and can verify that ImageViewer.js was not loaded on the document type where the issue is occurring. The document type did not have a Media Picker property specified on it or a parent document type.
I then looked on the document type that was not exhibiting the issue, and it did have a Media Picker property specified. It also had the ImageViewer.js file loaded.
So I followed your workaround and added a Media Picker to the "Generic Properties" tab on the document type where the issue is occurring. Hey presto, the issue disappeared.
So, it appears that for some reason the ImageViewer.js file is not loaded when there is a uComponent Datatype Grid control that contains a Media Picker control, if the document type that the data type belongs to does not have a Media Picker on it or a parent document type.
I just wanted to say thanks for your time on this as I now have a workable solution. Although it would be nice to get the issue resolved properly at some point.
If I can I will mark your last post as the solution (I might not have enough KARMA yet...)
No problem.
It might still not be a bug with uComponents though. The test i did earlier has no standard media picker property on it or any parent document type.
Could you see if the same problem happens if you create a new document type with the same data (except the media picker workaround)?
OMG!! I have just had this problem ... and adding a media picker to the Generic tab worked ... not sure what the client is going to think of that though! :-(
I´ll try to find a way to force the loading of ImageViewer.js when there is a Media Picker in the grid.
We're experiencing the same problem with uComponents 5.4.0/5.4.2.1 - was this fixed in 5.5??
@SC Web Team Yes, this is fixed
is working on a reply...