Page-type table deleted in DB, Page-type still listed

brandon rogers asked on March 5, 2018 20:54

I am getting the following error

Caused exception: Invalid object name 'Custom-PAGE-Type'.

Looking at the database the page-type table is completely gone, (which is why the error is getting thrown) the front end UI portion of the page type still appears with one child item. The child page does not exist and I can not add a dummy item with the same information to fulfill the requirement to delete the page-type.

How do I delete this corrupted page-type.

Thanks

Correct Answer

brandon rogers answered on March 6, 2018 22:30

I created the table based on Trevor's recommendation and then I exported the page-type from a working environment and then imported into my dev environment the page-type errors disappeared. Thank you everyone.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Peter Mogilnitski answered on March 5, 2018 22:13 (last edited on March 5, 2018 22:22)

There is no "Page type table" in Kentico, at least it is not created by Kentico. All page types are stored in cms_class. To get all existing document types you can try: select * from CMS_class where ClassIsDocumentType = 1. You can also check if you have any node/documents in the tree for the given class:

select nodeid, * from cms_tree where nodeclassid = 123
select * from CMS_Document where DocumentNodeID = 456

You should use API if you want to delete something, not direct SQL statements.

0 votesVote for this answer Mark as a Correct answer

brandon rogers answered on March 5, 2018 22:20

The page-type is a custom "page-type". I edited to add the word "custom".

In my production instance I see the table in the correct location with all the data. In my dev instance there is no table.

0 votesVote for this answer Mark as a Correct answer

brandon rogers answered on March 5, 2018 22:25

I ran that query the the page-type is not in my dev instance. However it is correctly in my production instance.

0 votesVote for this answer Mark as a Correct answer

Peter Mogilnitski answered on March 5, 2018 22:31 (last edited on March 5, 2018 22:56)

Then try this select ClassTableName,* from CMS_class where classname = 'custom.page-type'. ClassTableName contains data for your class. Page type is listed i.e. there is a record in CMS_Class. Probably you cannot delete this page type because the table defined in ClassTableName field does not exists.

P.S. Take a look at Page database structure

0 votesVote for this answer Mark as a Correct answer

Trevor Fayas answered on March 6, 2018 17:33

Brandon,

I assume by the custom table you mean the content table that contains extra fields for your custom page type.

If it's there in one instance, but not in the other, the only thing i can think of is someone or somehow the table was deleted. You may need to recreate the table manually (you can go to your production database, right click on the table and generate the create script table), then once that table exists, try a full sync from your production environment of those pages, hopefully that will re-populate them.

If you are looking to delete that page type completely, and for some reason only the database table deleted and not actual page type, you can look to manually delete it from the CMS_Class table, although manual processes like this wont' be caught by staging.

1 votesVote for this answer Mark as a Correct answer

brandon rogers answered on March 6, 2018 19:06

Trevor I don't have write access to the prod DB, I will try this as soon as I can track down someone from our DB team. Thank you

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.