Browse media library not opening - sitecore

We are using Sitecore 6.5 and the Browse link on images within the CMS backend is not opening up the window to select an image. A blank window just appears.
There is nothing in the Sitecore logs or window event logs. This used to work - when I compare the bin folders with the previous version, I only see a difference in the version of mscorlib.dll
I don't know if this is related, but when uploading a package we get the error
[ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.]
System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) +0
System.Reflection.RuntimeModule.GetTypes() +9
System.Reflection.Assembly.GetTypes() +143

I've seen something similar to this when the source path specified on the field was set to an invalid folder. If you take a look at the field definitions on the template, do they have a folder specified for the image location? Is that folder still valid?

The problem was the \sitecore\shell\applications\Media\MediaBrowser\MediaBrowser.xml file was complete empty.
We have no idea how this happened. Restoring the xml fixed this issue.

Related

javascript file loading problem in a web browser, relating to mime types, context Django debug_toolbar concerning Django/debug_toolbar versions >=3.X

I have noticed, at some point last year, that the debug_toolbar is not present anymore. Now I have found the problem, but do not actually completely understand what is happening and why. [Update: I have found an answer - see the last few paragraphs ]
The initial information is that I tried a lot of different version combinations for Django/delug_toolbar and there were no problems as the version number of both started by 2.
However, the toolbar is not showing itself if a version number starts by 3. The toolbar 2.2 should work with Django version 3 or larger also.
Now I have located the problem to be that toolbar.js is not loaded. There is a message in the developer tool's console:
:8001/static/debug_toolbar/js/toolbar.js:1 Failed to load module script: The server responded with a non-JavaScript MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec.
So I found the location of the toolbar.js under the static files folder of the debug_toolbar.
The file is loaded in a template base.html (in folder env\Lib\site-packages\debug_toolbar\templates\debug_toolbar)
There is a line:
<script type="module" src="{% static 'debug_toolbar/js/toolbar.js' %}" async></script>
But I do not understand why type="module" is preventing the browser to load and use the toolbar.js?
There was a section in the (https://readthedocs.org/projects/django-debug-toolbar/downloads/pdf/stable/) Django Debug Toolbar manual that said in case of the problem with mimetypes the user should edit Windows registry.
"1.6 Troubleshooting
On some platforms, the Django runserver command may use incorrect content types for static assets. To guess content types, Django relies on the mimetypes module from the Python standard library, which itself relies on the underlying platform’s map files. If you find improper content types for certain files, it is most likely that the platform’s map files are incorrect or need to be updated. This can be achieved, for example, by installing or updating the mailcap package on a Red Hat distribution, mime-support on a Debian distribution, or by editing the keys under HKEY_CLASSES_ROOT in the Windows registry"
Could someone please give me an explanation for what is going on here? I tried to find if there was any discussion about this problem with these new Django/Django Debug Tool versions but there was nothing to be found. The other discussion was concerning about the earlier versions.
Do I have a security setting of a browser (etc) that is causing the problem as there is no question about the people that have made the Debug toolbar would have implemented their code/settings not to work at all? I have tried Firefox/Edge/Chrome and the issue is in all of them.
I found a tip from another question.
By adding
if DEBUG:
import mimetypes
mimetypes.add_type("application/javascript", ".js", True)
to settings.py causes that the toolbar.js is loaded.
That addition solved the whole problem. There is no need to do anything for the Windows registry.
The discussion can be found here:
Failed to load module script: The server responded with a non-JavaScript MIME type of "text/plain". Strict MIME type checking i
So my question was in fact a duplicate.

NSLocationAlwaysUsageDescription and NSLocationWhenInUseUsageDescription ignored

Xcode 8.2 beta 8C30a, Swift 3, iPhone 5s.
I'm writing a weather app that wants to use the iPhone's location. To get authorisation I have set (all of) the following my Info.plist:
<key>NSLocationAlwaysUsageDescription</key>
<string>Your current location is used to provide you with a local weather forecast.</string>
<key>NSLocationUsageDescription</key>
<string>Your current location is used to provide you with a local weather forecast.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Your current location is used to provide you with a local weather forecast.</string>
Nevertheless, when I call LocationManager.requestWhenInUseAuthorization() then I get the following error:
This app has attempted to access privacy-sensitive data without a usage description.
The app's Info.plist must contain an NSLocationWhenInUseUsageDescription key
with a string value explaining to the user how the app uses this data
The key is there but not being seen. There is no entry for the app in the phone's settings menu (nor under privacy). Doubtless, I'm missing something simple. Any ideas?
I just encountered the same problem with one particular App, and I have several Apps with the same structure which are working just fine when I request authorization for Location Services.
In all cases, I have localized the Application, so I have several Info.plist files in my XCode project (e.g. one for the Base language which is English, another for French, etc).
I always manually edit my Info.plist files (viewing them "as Source Code") and add the NSLocationWhenInUseUsageDescription fields).
But in this specific App's case, I noticed that XCode was NOT showing the NSLocationWhenInUsageDescription field when I selected the App Target in the Project's list of Targets and then clicked on the "Info" tab. This is odd, because when I check the "Info" tab in my other XCode projects, edits made to the Info.plist file for the Base language appear here. So I manually added a NSLocationWhenInUseUsageDescription field to this "Info" UI and suddenly my new App was working correctly, requesting the user's permission to access Location Services when in use.
I'd recommend checking that all the fields you have added to your Info.plist file are reflected in the Target/Info screen. If they are not, you may have a similar problem, in which case the same fix may work for you.
I am guessing the root cause of the problem is a bug in the localization process. I recall that after selecting the Info.plist file as one of my localized files, I got an error from XCode at build time, complaining that it was missing an Info.plist file (it had moved Info.plist from the base.lproj folder to en.lproj when it "localized" the file). I reinstated the file that XCode had moved from the base.lproj folder to the en.lproj folder, and that seemed to make XCode happy again. But I think somehow it lost the ability to refresh itself, so subsequent additions to the Info.plist file(s) aren't being applied everywhere they need to be).

Sitecore 7.2 Media Library images not working with underscore in the name

I just upgraded a client's test installation of Sitecore to 7.2 (SP1) and now, any image that has an underscore in its name is throwing a 404 error when being referenced by a page. This was actually a series of upgrades from 6.4 so it's quite possible that a config setting somewhere got missed along the way, but I don't see anything standing out at me that would cause this problem.
If I change the image name to not have an underscore, it works fine, and it also works fine if I set "Media.UseItemPaths" to false, but they would prefer it if their image URL's had the file name displayed.
Can anyone help identify what may have gone wrong?
Due to a change in Sitecore 7.1, any replacements specified in encodeNameReplacements are now also applied to media items as well as regular items in the content tree.
One option is to remove the replaceWith="_" declaration, but the likely reason this was added was to possibly replace spaces in your URLs so they do not display with %20. Removing this declaration will mean they return!
You can instead apply the fix specified in this Sitecore Knowledgebase article: Sitecore is unable to open media items when using encodeNameReplacements

Umbraco error in Document Types

A long time ago I first setup a website in Umbraco. This seemed to be working fine.
I have now come back to it about a year later, and was initially getting the following error when selecting a Document Type (any document type in the Settings tab):
A bit weird, because earlier I didn't have this issue, but fine. I do what it says, and add <identity impersonate="true"/> to the <system.web> node in web.config.
While it does fix the initial issue, I now have the following on all document types:
When trying to create a new Document Type, I get the same kind of error, but then the ReturnUrl part is ReturnUrl=/umbraco/create.aspx?nodeId=init&nodeType=inittemplates&nodeName=Templates&rnd=20.2&rndo=21.2&nodeId=init&nodeType=inittemplates&nodeName=Templates&rnd=20.2&rndo=21.2' - but only if I tick the box 'Create template for this item'. The same happens when I try and create a Template.
After Googleing I came up with this: our.umbraco post with similar issue. One (unconfirmed) solution is that there's an illegal name in a document type/ template - but I haven't changed anything, and might be fixed by going into the database.
I did check the /masterpages folder, the only 'strange' characters in there are - and _.
In my Document Types I have on named 'Textpage (Two col)' and another named 'News & Events list'. I'm a bit hesitant to just delete them, since I don't have enough Umbraco knoledge to be sure this will fix my issue...
Is there any known solution for this, or will I also have to go into the database (and if so, whereabouts?)
I'm running Umbraco 4.7.2, assembly version 1.0.4500.21031.
I've hosted this site with GoDaddy.com - I don't know if that would be relevant.
[Update 1]
As per Tom Maton's comment:
The requirepermissions should be set to false, and have been.
in Appsettings I've set this:
<add key="umbracoUseMediumTrust" value="true" />
And I've added Trusted_Connection=yes to the connectionstring.
the problem remains.
[Update 2]
Tried the solution amelvin provided, but no dice. Doctypes and templates still give the error. I'm getting more certain it's some security issues. Which folder would correspond to the Templates? Would that be the masterpages folder? If so, what kind of permissions does that one need?
It could be that you don't have full trust on your Go Daddy environment?
Check this post out http://our.umbraco.org/forum/getting-started/installing-umbraco/17856-Umbraco-on-GoDaddy-Shared-Hosting
Could help resolve your issue.
The error could be a knock on from permissions errors as yet unsolved.
But the error is thrown if the content page does not have a template assigned or if Umbraco thinks it doesn't have a template. If absolutely nothing has changed to the site then it could be that the umbraco.config file has somehow got corrupted (it will contain all the doctype/template cross reference info). This can be fixed by right clicking on the top 'content' node and choose 'republish entire website'.
Secondly navigate to the settings | document types (if you can now) and check the templates dropdown on the first tab of the appropriate document type. If its set to 'please select' then this error will get thrown when any page tries to render without a valid template assigned. If a default template is assigned - then go to that template and re-publish it - Umbraco may have lost it.
If this does not work then check if the template is assigned properly. Go to the same place in the content tree as the problem page and try to add a node with the desired doctype. If no choices are offered then it could be that the parent tab no longer allows the correct doctypes as children nodes, so go back to the doctypes and check the allowed children (second tab) of the parent node.
If none of this works without odd errors being thrown then its a mystery!
Here are a list of Permissions required for Umbraco http://our.umbraco.org/wiki/reference/files-and-folders/permissions
Or you could use one of the steps below to check all the folder permissions.
http://our.umbraco.org/wiki/reference/files-and-folders/permissions/perform-permissions-check
Or install this package. http://our.umbraco.org/projects/backoffice-extensions/ugolive this will allow you to check the permissions are correctly setup.

Django and tinymcs: getting list of image files using external_image_list_url

I am trying to get external_image_list_url to work with tinymcs and Django. My understanding is that the user will be able to see a list of his or her images when clicking on the image icon (the one with the tree). From here an image can be selected and inserted.
Am I right that it is the icon with the tree? It's the one called "image". The one called "insertimage" doesn't work at all - the icon is not displayed. It and insertfile are the only ones that aren't displayed. I'm Ok with that unless I need it for this list functionality.
First I am trying just to get any image to appear in a list. I have done the following:
Created myexternallist.js and placed it where I keep my other JS files. I can access these other files via src = "/media/js/filename.js" because of my django settings. But is this also what I should put for:
tinyMCE.init({
external_image_list_url : "/media/js/myexternallist.js",
... })
In this file it says:
var tinyMCEImageList = new Array(["Logo 1", "/media/js/photo.jpg"],);
photo.jpg is in the same folder as myexternallist.js
I have also tried just "photo.jpg" and various other combinations. Not sure if my issue has to do with my relative paths or something else altogether. I'm not sure what an absolute path should be. Right now I'm working on localhost, but won't always be.
Solved it, argh. The issue was the comma near the end of the line "var tinyMCEImageList =..."
Now it works fine with the relative urls starting with /media
The clue was given by Firebug Console, which showed me the js error. I just happened to click there, but will be using that a lot from now on!