Searching for values in Page Controls

Posted by Community Admin on 04-Aug-2018 21:37

Searching for values in Page Controls

All Replies

Posted by Community Admin on 20-Mar-2012 00:00

I have a website with a lot of pages for a client that we migrated over from Sitefinity 3.7 to 4.x, and we're looking into migrating over to 5.x before too long.

In the meantime though... One of the issues I'm trying to resolve for my client is that we have a lot of bad links and images carried over from pages created in the old site to the new site and they're cleverly hidden within things like Content Block (Telerik.Sitefinity.Modules.GenericContent.Web.UI.ContentBlock) controls within pages, and we see these exceptions come up on our logs so I want to hunt them all down and fix them (we have a lot of pages so this would easily take TONS of hours to go through manually).

(e.g. On the old side we had some Content Blocks that had img tags pointing "/images/spacer.gif" and on the new site it's "/Content/images/spacer.gif" so it throws up exceptions in the logs, and these are contained within legacy pages all of our template pages are correct.)

Is this the correct SQL to search for that information, or am I missing some joins in here?

SELECT
       sfpn.[title_] as page_title
      ,sfpn.[url_name_] as page_url
      ,sfcp.[val]
      ,sfod.[object_type]
      ,sfod.[caption_]
      ,sfod.[place_holder]
      ,sfod.[collection_index]
      ,sfcp.[nme] as control_name
  FROM [dbo].[sf_control_properties] sfcp
  JOIN [dbo].[sf_object_data] sfod ON (sfcp.[control_id]=sfod.[id])
  JOIN [dbo].[sf_page_node] sfpn ON (sfod.[page_id]=sfpn.[id])
  where
  lower([val]) like '%spacer.gif%'
  order by
  page_title,
  page_url,
  control_name

This thread is closed