themooserooster
themooserooster

Reputation: 69

How do I find every page where a form is used across a Kentico instance?

I'm have a Kentico site where there are dozens of old forms produced and managed by the Forms module (formerly BizForms). Many of them have various things wrong with them which will break my instance if I try to upgrade it. I need to be able to find everywhere a form is used on the instance so I can see if it's still in use and where to drop in its fixed replacement.

I'm currently on Kentico 8.2 and trying to upgrade all the way to Kentico 11, which is where the breakages occur.

Upvotes: 0

Views: 319

Answers (1)

Brenden Kehren
Brenden Kehren

Reputation: 6117

You first need to understand where a form can be added from within the Kentico UI. Second, you'd need to take into account none of this will work for any instances where there is a form name hardcoded in any custom code. This will only reference the Kentico UI updates.

Where can forms reside in the UI?

  • Inside a page template using a webpart
  • Inside page content using a widget

If you're doing a search within a template, you need to create a SQL query to run code similar to this:

select *
from CMS_PageTemplate
where (PageTemplateWebParts like '%formcodename%' -- replace "formcodename" with your form code name
and PageTemplateWebParts like '% type="BizForm" %')

If you're doing a search within the page's content, you need to create a SQL query to run code similar to this:

select DocumentContent, *
from CMS_Document
where DocumentContent like '%(name)BizForm|(BizFormName)formcodename|%' -- replace "formcodename" with your form code name

Either if these queries should get you close to what you're looking for keeping in mind there is nothing out of the box.

Upvotes: 3

Related Questions