Getting crash when trying to set General Link value on sitecore - sitecore

I am working on a template that have a General Link field, when I am trying to set the Insert link on Sitecore Content Editor I am getting below crash:
I am working on Sitecore 8.0 (rev.150121)
Even though the other General link options is working fine:
Insert media link
Insert external link
Insert anchor
Insert email
Insert JavaScript
I added a new field to the same template as a general link filed as well and it is working fine even for the Insert link option.
when I view the Raw value for the item I found that the link had a default value set to "" when I removed it and save all is working fine, the other testing link that I added do not have this default value, and the field on the template itself do not have such value or any default value.

This is a duplication of the question found on the Sitecore StackExchange here. Just to avoid any open question, here is the answer as provided in the same question:
The issue you reported was fixed in Sitecore Experience Platform 8.0 rev. 150621 (8.0 Update-4) and you can upgrade your solution to address the problem.
Please take a look at the reference number 416281 in Sitecore CMS release notes on for additional details on the fix: https://dev.sitecore.net/Downloads/Sitecore%20Experience%20Platform/8%200/Sitecore%20Experience%20Platform%2080%20Update4/Release%20notes
If upgrade is not an option for you, we suggest you implement the following workaround to resolve the issue on your current solution:
Place the attached Sitecore.Support.416281 assembly to the \bin folder of your solution;
Open /sitecore/system/Field types/Link Types/General Link item in the Core database;
Clean up its Control field;
Put Sitecore.Support.416281 in the Assembly field and Sitecore.Support.Link in the Class field;
Save changes.
Please download the assembly : https://www.dropbox.com/s/hl7ho6wmnca8u2y/Sitecore.Support.416281.dll?dl=0

Related

How to link to html page at specific ID bookmark?

Using Diagrams.net (draw.io), I would like to link specific elements to web pages. This is easily accomplished currently by creating a link for the element (say a rectangle).
However, I would like to navigate directly to a specific id bookmark in the HTML page. I cannot seem to get that to work.
For example, if I try to use this syntax (which works in the browser location bar):
https://en.wikipedia.org/wiki/Canada#Geography
I will be taken to the main page:
https://en.wikipedia.org/wiki/Canada
However, the goal is to go to the "Geography" section of this page.
I have also tried the json syntax without any success:
data:action/json,{"actions":[{"open":"https://en.wikipedia.org/wiki/Canada#Geography"}]}
I have also played with different action syntax such as:
data:action/json,{"actions":[{"open":"https://en.wikipedia.org/wiki/Canada"},{"scroll":{"tags":["Geography"]}}]}
Note: I'm using the diagrams.net desktop version 14.1.8.
Thank you for taking the time to read this question.
Paul
On Windows this only seems to work if the browser isn't already open. There is not much we can do to fix this as we're passing the link to the OS.

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

What would be the SQL script to generate Sitecore Broken Link Report

I'm helping our Editors to clean up broken links and have been looking for answers to the following:
The Broken Link Report cannot be exported or sorted so it's not very useful (we have many broken links ~2000). Is there a SQL script that I can run to create the same report?
If an Editor fix a link, Rerun the report doesn't seem to take the item off the report. Does she have to Rebuild Link Database every time?
The Links button in the menu is helpful, but it is listing All Versions of referrers. Is there a SQL script to find only the lastest version?
When delete or archive an item and let Sitecore remove broke links, will all the affected items be published?
We are dealing with a large report (~2000 items) due to not maintaining it diligently. The goal is to reduce the number to 100~200 and keep it under control from now on. Any general advice on how to clean up broken links report is appreciated.
For your first (and partly third) questions:
In the Core database you can check what gets executed on the click of the Broken Link Report (the item that defines it is located in : /sitecore/content/Documents and settings/All users/Start menu/Right/Reporting Tools/Scan for Broken Links.
The application that gets started is /Applications/Tools/Broken Links.aspx, so if we look at *webroot*/sitecore/shell/Applications/Tools/Broken Links/Broken links.xml, we can see that the code used for it is Sitecore.Shell.Applications.Tools.BrokenLinks.BrokenLinksForm in the Sitecore.Client assembly.
Using Reflector you can see what it's executing. For your requirements, what I would say would be the easiest is to create your own version of the BrokenLinksForm, possibly simply adding an export functionality on it, or modify the code so it only takes the latest version. From looking at it very quickly I think the code to change (which is actually in the nested Scanner class) is:
...
foreach (ItemLink link in Globals.LinkDatabase.GetBrokenLinks(database))
{
list.Add(link);
}
...
You could possibly check whether the link item is the latest version, possibly by using something like
...
var version = link.GetSourceItem();
if (version.Versions.GetLatestVersion().Version == link.SourceItemVersion)
{
list.Add(link);
}
...
While you're at it you could of course also put in some sorting functionality :-)
It doesn't translate 1-on-1 with the Links button in the menu, but it should give you some pointers in the right direction.
As to your 2nd question: I believe that yes, the Link database does need to be rebuilt. I don't know if Sitecore has a schedule set up by default, but you could create your own agent in the <scheduling> node in the web.config to do this after X time.
Your last question: If you delete or archive an item and have Sitecore remove the broken links the affected items will, by default, not be published. If you have an auto-publish set up it'll show up of course.

Sitecore: Detect user in Page Editor mode

Can I know how to detect user is in page editor mode using code?
This is because, I have a component, when user browses from page editor, it will search in master_index folder instead of web_index folder.
Please check with : if (Sitecore.Context.PageMode.IsPageEditorEditing)
also is working on Sitecore 6.6, it not depends on Sitecore 7.
Please check also this Sitecore blog post by Martina Welander.
To check if is normal page use: if (Sitecore.Context.PageMode.IsNormal)
To check if is preview mode use: if (Sitecore.Context.PageMode.IsPreview)
Also are others PageMode:
IsPageEditorClassic
IsPageEditorDesigning
IsPageEditorEditing
IsPageEditorNavigating, etc
If you are curious you can check with Reflector or dotPeek this class: Sitecore.Context.PageMode from Sitecore.Kernel assembly.
Rather than checking the page mode, I think you just want to piggyback on the context database name -
var indexName = Sitecore.Context.Database.Name + "_index";
I am using this syntax in view to add a class for JS detection, same code can be used for back-end detection with bit modification:
<html class="#(Sitecore.Context.PageMode.IsPageEditor ? "inexpeditor" : "notexpeditor")">

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.