Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Templates deleted #292

Closed
ech01 opened this issue Jul 23, 2015 · 14 comments
Closed

Templates deleted #292

ech01 opened this issue Jul 23, 2015 · 14 comments
Assignees

Comments

@ech01
Copy link

ech01 commented Jul 23, 2015

See: https://sexycontent.codeplex.com/workitem/1877

@iJungleboy
Copy link
Contributor

Seems to be an upgrade issue. Probably fixed by Friday.

@ech01
Copy link
Author

ech01 commented Jul 28, 2015

Let me know if I can help test on my install.

@iJungleboy
Copy link
Contributor

Note that after looking into your issue again, it's not the upgrade issue I thought it was, it's simply invalid data. Just remove the template-definition and create a now one - and you should be good to go in about 60 seconds.

Will close this now.

@ech01
Copy link
Author

ech01 commented Jul 31, 2015

Remove the template definition? Going to the templates section is what generates the error.

Let me fully explain:

Imported default 2sxc apps/content
Created a few new content types and a new app
Deleted some demo content types
Cannot get to the template manager.

http://screencast.com/t/hzhUeco2yek1

So do I need to go through the database and remove these definitions?

@iJungleboy
Copy link
Contributor

No, not in the DB.
Sorry for being unclear, I thought you could still access the list. In this case - since the template is an entity - to delete it you can go to the "secret" view of content-types which are usually hidden from the user. Go to the content-types page, and open the iframe in your browser. The address will be something like:
http://2sxc.org/en/Apps/ctl/eavmanagement/mid/1199/AppId/12?popUp=true

Now just add a &scope=2SexyContent-System, so it will be something like
http://2sxc.org/en/Apps/ctl/eavmanagement/mid/1199/AppId/12?popUp=true&scope=2SexyContent-System

here you should be able to clean up your entity.

@ech01
Copy link
Author

ech01 commented Aug 5, 2015

Could not find a secret view and the only iframe i see is the dumb one in the getting started tab (whole other issue in itself that I don't quite understand). I'm going to try to export/ uninstall/ reinstall and see if this will work.

@ech01
Copy link
Author

ech01 commented Aug 5, 2015

I was able to track down the URL to go to the entities for the templates/views. The iframe through me off and I just modified the URL from the tab.

So going forward, if I delete a view in the admin, I should go to this secret page and delete the associated entity?

@iJungleboy
Copy link
Contributor

@ech01 that's correct. Deleting that entity in the entity-admin is the same as deleting a view/template in the normal admin.

@TheDeadlyBulb
Copy link

Ran into this issue with 7.22 and was able to solve the issue thanks to this thread. However I made the same bonehead mistake and we are now in 8.1.2. That requires a different method I believe so I used the one here: http://2sxc.org/en/Blog/post/advanced-dynamic-data-content-understanding-content-type-scopes. That is the correct method, right?

That does get me to what appears to be the Entity Admin, but when I click 2SexyContent-Template I get back 'Had an error talking to the server status 500'. Looking at the Console from Chrome I can see that it's trying to reach: http://www.cui.edu/desktopmodules/2sxc/api/eav/entities/GetAllOfTypeForAdmin?appId=2&contentType=2SexyContent-Template

I appreciate any direction here. We are stuck and I am trying to rollout some new features for our client.

@iJungleboy
Copy link
Contributor

I believe it has to do with Null-Values which were officially not allowed, but internally necessary for special stuff like templates & content-groups. I think we actually implemented a fix for this is 08.01.03. So I think you're in luck - update to 08.01.03 and it should work :)

@TheDeadlyBulb
Copy link

Thanks for writing.

Well I tried out 8.1.3 on the staging server but I am still getting the same error messages. Are there any stored procs or other tools in the 2sxc kit that I can use to delete the renegade View/Template? I am willing to dig in but I don't want to make it worse.

Trying to get more detailed error messages. Firefox gives me these message but it appears the first part (contentTypeListController/vm.changeScope) appears before I even click on 2SexyContent-Template:

creating sxc service for id: 5664 2sxc4ng.min.js:3:2367
ocLazyLoad.fileLoaded ../lib/ag-grid/ag-grid.min.css set.min.js:107:50
ocLazyLoad.fileLoaded ../lib/ag-grid/ag-grid.min.js set.min.js:107:50
ocLazyLoad.componentLoaded Array [ "agGrid", "directive", "agGrid" ] set.min.js:107:50
ocLazyLoad.moduleLoaded agGrid set.min.js:107:50

Error: [$rootScope:inprog] http://errors.angularjs.org/1.4.4/$rootScope/inprog?p0=%24digest
 set.min.js:6:416
"Error: [$rootScope:inprog] http://errors.angularjs.org/1.4.4/$rootScope/inprog?p0=%24digest
L/<@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:6:416
q@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:125:271
kf/this.$get</n.prototype.$apply@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:133:241
e/p.$$intervalId<@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:96:437
contentTypeListController/vm.changeScope/<@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/admin/eav-admin.min.js?sxcver=08.01.00:3:18147
f/<@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:118:217
kf/this.$get</n.prototype.$eval@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:133:35
kf/this.$get</n.prototype.$digest@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:130:52
kf/this.$get</n.prototype.$apply@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:133:328
Ic[c]</<.compile/</<@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:252:468
Hf/c@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:35:124
" set.min.js:107:50

"Error: [$rootScope:inprog] http://errors.angularjs.org/1.4.4/$rootScope/inprog?p0=%24digest
L/<@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:6:416
q@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:125:271
kf/this.$get</n.prototype.$digest@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:129:423
kf/this.$get</n.prototype.$apply@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:133:328
e/p.$$intervalId<@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:96:437
contentTypeListController/vm.changeScope/<@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/admin/eav-admin.min.js?sxcver=08.01.00:3:18147
f/<@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:118:217
kf/this.$get</n.prototype.$eval@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:133:35
kf/this.$get</n.prototype.$digest@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:130:52
kf/this.$get</n.prototype.$apply@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:133:328
Ic[c]</<.compile/</<@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:252:468
Hf/c@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:35:124
" set.min.js:107:50

Object { data: Object, status: 500, headers: dd/<(), config: Object, statusText: "Internal Server Error" } 2sxc.api.min.js:3:2855
"Error: [$rootScope:inprog] http://errors.angularjs.org/1.4.4/$rootScope/inprog?p0=%24digest
L/<@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:6:416
q@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:125:271
kf/this.$get</n.prototype.$apply@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:133:241
f/m<@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:146:128
e@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:42:486
Kf/l.defer/c<@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:45:369
window.$2sxc/$2sxc._controllers[a].showDetailedHttpError@http://www.cui.edu/desktopmodules/tosic_sexycontent/js/2sxc.api.min.js:3:3890
.responseError@http://www.cui.edu/desktopmodules/tosic_sexycontent/js/angularjs/2sxc4ng.min.js?sxcver=08.01.00:3:2127
f/<@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:118:217
kf/this.$get</n.prototype.$eval@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:133:35
kf/this.$get</n.prototype.$digest@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:130:52
kf/this.$get</n.prototype.$apply@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:133:328
g@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:87:338
K@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:91:406
Sf/</A.onload@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:92:437
" set.min.js:107:50

"Error: [$rootScope:inprog] http://errors.angularjs.org/1.4.4/$rootScope/inprog?p0=%24digest
L/<@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:6:416
q@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:125:271
kf/this.$get</n.prototype.$digest@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:129:423
kf/this.$get</n.prototype.$apply@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:133:328
f/m<@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:146:128
e@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:42:486
Kf/l.defer/c<@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:45:369
window.$2sxc/$2sxc._controllers[a].showDetailedHttpError@http://www.cui.edu/desktopmodules/tosic_sexycontent/js/2sxc.api.min.js:3:3890
.responseError@http://www.cui.edu/desktopmodules/tosic_sexycontent/js/angularjs/2sxc4ng.min.js?sxcver=08.01.00:3:2127
f/<@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:118:217
kf/this.$get</n.prototype.$eval@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:133:35
kf/this.$get</n.prototype.$digest@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:130:52
kf/this.$get</n.prototype.$apply@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:133:328
g@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:87:338
K@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:91:406
Sf/</A.onload@http://www.cui.edu/desktopmodules/tosic_sexycontent/dist/lib/angular/set.min.js?sxcver=08.01.00:92:437
" set.min.js:107:50

Error: [$rootScope:inprog] http://errors.angularjs.org/1.4.4/$rootScope/inprog?p0=%24digest
 set.min.js:6:416

@iJungleboy
Copy link
Contributor

Note: I've created a new issue to include pdb-files in the future which will help in giving line-numbers in error messages - #649

It must be a data-delivery problem. Basically you see the

Object { data: Object, status: 500, headers: dd/<(), config: Object, statusText: "Internal Server Error" } 2sxc.api.min.js:3:2855

which obviously means, the server wasn't able to deliver the data properly. It usually means that there is a serialization problem - the server tried to make a JSON out of the data but ran into a problem - often an unexpected "object doesn't exist" or similar.

There are a few ways to continue, but a simple one would be to just go into the DB and mark this item as deleted. Steps should be:

Find out which template-ID you are talking about, by going into admin > views > click on the template. Even though you see an error, you should see the template id (which is also the entityid) in the url, like this

http://2sxc.org/en/blog/mid/3002/ctl/edittemplate/appid/78/templateid/**6881**?popUp=true

Then you should go into sql and find this entity, something like this

SELECT        TOP (200) EntityID, EntityGUID, AttributeSetID, ConfigurationSet, AssignmentObjectTypeID, 9eyNumber, KeyGuid, KeyString, SortOrder, ChangeLogCreated, ChangeLogDeleted, IsPublished, PublishedEntityId, 
                         ChangeLogModified
FROM            ToSIC_EAV_Entities
WHERE        (EntityID = 6881)

Then set the ChangeLogDeleted to the same number as ChangeLogModified. Don't use a random number, please use this changelogmodified. In the eyes of 2sxc / eav, this item is now deleted.

Basically the entity is now deleted. You'll need to reload your cache.

@TheDeadlyBulb
Copy link

Thanks for your help Jungleboy. You guys Rock!

I wasn't able to see the View tab to get the EntityID because this null value issue causes that whole View tab to blow up. So I reversed engineered your table structure and built an SQL to find cases where a ContentType was deleted while a referencing View/Template still lives. Then using your instructions I copied the ChangeLogModified value to the ChangeLogDeleted for that naughty Entity.

That worked! We're back in black.

Here is my SQL:

/*
Find all cases where a View exists that has a deleted ContentType
When this situation occurs then 2sxc's View Tab in the Admin tends to blow up

AttributeSetID = 42 means it's a View/Template
AttributeID = 267 means that attribute holds the ContentType GUID and that matching value will be in the AttributeSets table 
Join Entity to Values to AttributeSets to find ContentTypes that were deleted before associated View/Template was deleted

*/

SELECT e.[EntityID], v.[AttributeID], v.[Value], a.[Name], a.[Scope], a.[AttributeSetID],
e.[ChangeLogCreated] As EntityChangeLogCreated, e.[ChangeLogDeleted] As EntityChangeLogDeleted, e.[ChangeLogModified] As EntityChangeLogModified,
a.[ChangeLogCreated] As AttributeEntityChangeLogCreated, a.[ChangeLogDeleted] As AttributeChangeLogDeleted
FROM [dbo].[ToSIC_EAV_Entities] e
JOIN [dbo].[ToSIC_EAV_Values] v
ON e.[EntityID] = v.[EntityID]
JOIN [dbo].[ToSIC_EAV_AttributeSets] a
ON v.[Value] = a.[StaticName]
WHERE
e.[AttributeSetID] = 42
AND v.[AttributeID] = 267
AND ISNULL(a.[ChangeLogDeleted],0) > 0
AND ISNULL(e.[ChangeLogDeleted],0) = 0

@iJungleboy
Copy link
Contributor

Great - love to help :)

A word of warning to anybody copy/pasting the code above - don't just copy-paste, use your brains :). Your ID-Numbers will be different :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants