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

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.

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.

Getting crash when trying to set General Link value on 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

Modules appear in new DotNetNuke page, but they are not specified in any template file

I inherited a DNN (6.2.5, upgraded several times from 5.6.2) site and every time I add a new page, multiple instances of several modules (i.e. 3 copies of module A, 3 copies of module B, 1 copy of module C, etc.) appear automatically in the page, as if there were a template specifying them. I don't want them and have to delete them all every time I add a new page, which is a pain. Funny thing is, I have looked in all the *.template files and they are not specified in anywhere.
Does anyone have an idea of where to look to find why these modules appear automatically on adding a new page, despite their not being in any template file?
Thanks.
It's possible that each of them has "Display Module On All Pages" checked in the module settings. When that happens, they are injected implicitly on every page on the site.
Ian Robinson's comment is the root cause with the display issue.
BUT: I wanted to post a separate answer as a warning with more detail on how it works and a word of caution on making a change
You can find the module then "Uncheck" the "Display Module On ALl Pages" option. However, on certain versions of DotNetNuke doing this will remove it from all pages that it was automagically added to. Re-Checking this option will result in the content being added to the COntentPane of all pages, which might be what you want, and could have a major impact on your layout. SO be careful and I strongly recommend a backup of the site/database in case it goes wrong.
In general, this option is VERY scary to use!

Update sql not being executed for my component Joomla 2.5

I am trying to add a few new columns to certain tables in Joomla, since i need to migrate these fixes from dev to production i am trying to do this the clean way, updates trough the filesystem.
I have followed a few tutorials concerning this and did the following.
I created the folder updates/sql and put a new sql file in it with my new version (1.5).
I changed the version number in my xml file.
I refreshed my cache in the backend.
Here are the codes I used:
My version:
<version>1.5</version>
The update node:
<update>
<schemas>
<schemapath type="mysql">sql/updates/mysql</schemapath>
<schemapath type="sqlsrv">sql/updates/sqlsrv</schemapath>
<schemapath type="sqlazure">sql/updates/sqlazure</schemapath>
</schemas>
</update>
The sql file:
ALTER TABLE `#__mycomponent` ADD `field` VARCHAR(255);
I tested my query directly against the database and it worked, what am I missing?
Short answer - Joomla!'s DB migration tool only does them after uploading a new component via the Component Manager. It doesn't check for a migration on every $_REQUEST, which is what your question suggests.
Longer Answer
Make sure you run the upgrade via the component manager. Simply over-writing the files doesn't trigger Joomla's migration process. Check the #__schemas table for your component's ID, and it'll have a corresponding database schema version #. If that version hasn't incremented yet, then the migration wasn't applied.
Part of the problem is
I am trying to do this the clean way, updates trough the filesystem
While I agree with you, that would be the clean way: Joomla! wants you to do things the Joomla! way ;-)
Important Note about Joomla! SQL Files
SQL files cannot contain C style comments (# comment here), and must contain comments like this -- comment here Spent a few hours debugging my own code, and had to re-run an upgrade about 25 times to figure out where the database schema migration was failing.
Comments may support the /* Comment */ style syntax, but I have yet to test that as extensively. YMMV.

SketchFlow / SketchStyles is empty. ((Assets) Styles > SketchStyles)

I just installed the Expression Blend Studio 4 (Trial) from Microsoft.
I have several tutorials telling me to change the style, that I should go to
(Assets) Styles > SketchStyles
There is nothing under that area except a warning(and link)
This category shows all the styles you have created for the current document or application. Additional styles can be found in the online Expression Gallery.
That link gets me no where fast. It basically goes to the home page of Expression Blend.
If you look at this 90 second video.
http://electricbeach.org/files/sketchflow_overview.wmv
At the 30-36 second mark, he is switching the style from squiggly to something more professional.
I'm trying to demo that same thing, which I believe (keep in mind I'm new to this) I am changing FROM the WigglyStyles style to something else.
With
(Assets) Styles > SketchStyles
being empty, I don't know what I'm missing.
...........
So a 2 part question:
How do I get entries to show up under (Assets) Styles > SketchStyles?
(If different from #1), how do I change the overall style from WigglyStyles to something else (and back to WigglyStyles)?
Thanks!
Is misssing the SketchStyles.xaml.
SketchStyles.xaml – this file contain the resource dictionary with number of styles which SketchFlow project makes use of them internally.
Solution:
Create a new solution, a (sketchflow silverlight solution), copy the SketchStyles.xaml from your created solution drag and drop the to the project that doesn't have this file, and press ctrl+shift+B to build it.
hope it helped.
The message was throwing me off.
The little triangle, pointed "to the right" initially, has to be clicked (and then points down) exposing the sub items.
The message:
This category shows all the styles you have created for the current document or application. Additional styles can be found in the online Expression Gallery.
is what was throwing me off. (And I was thinking the same thing as alimbada, that my install went awry).
Once I expand "Styles" (via the small triangle), everything is there.
Ok!! Did I mention I'm a developer, not a designer?? (haha).
Aka, this was just a big "duh" moment.
Thanks.
I just had a quick play with Sketchflow since I have Blend installed and those styles show up fine. Maybe your install went awry?