Missing content types from listing page

Topics: Customizing Orchard, General
Feb 25, 2014 at 8:10 PM
Hi guys,

I've created a custom content type ("CarouselContentType"), and have created several new items of this type, but none are listed when I go to the listing page in the Orchard dashboard (/Admin/Contents/List/CarouselContentType)....

Image

I know that the items have been successfully created, as I can use a query to pull them back, and I'm able to render them to the UI using a projection widget.

Is this a known bug, or have I overlooked something?

Thanks,
Nick
Feb 25, 2014 at 9:23 PM
May be missing CommonPart in your ContentType ?
Feb 25, 2014 at 11:44 PM
Nope - my ContentType doesn't have any custom parts.

However, I wonder if it is to do with permissions...? When I try to edit a user's roles, I get the following error:

An unhandled exception has occurred and the request was terminated. Please refresh the page. If the error persists, go back
No row with the given identifier exists[Orchard.ContentManagement.Records.ContentItemRecord#50]
NHibernate.ObjectNotFoundException: No row with the given identifier exists[Orchard.ContentManagement.Records.ContentItemRecord#50] at NHibernate.Impl.SessionFactoryImpl.DefaultEntityNotFoundDelegate.HandleEntityNotFound(String entityName, Object id) at NHibernate.Proxy.DefaultLazyInitializer.Intercept(InvocationInfo info) at ContentItemRecordProxy.get_ContentType() at Orchard.ContentManagement.DefaultContentManager.Get(Int32 id, VersionOptions options, QueryHints hints) in c:\Orchard\src\Orchard\ContentManagement\DefaultContentManager.cs:line 218 at System.Linq.Enumerable.WhereSelectListIterator2.MoveNext() at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at Orchard.ContentManagement.DefaultContentQuery.ContentQuery1.Orchard.ContentManagement.IContentQuery<T>.List() in c:\Orchard\src\Orchard\ContentManagement\DefaultContentQuery.cs:line 212 at Orchard.CustomForms.Permissions.<GetPermissions>d__2.MoveNext() at Orchard.Roles.Services.RoleService.GetInstalledPermissions() at Orchard.Roles.Controllers.AdminController.Edit(Int32 id) at lambda_method(Closure , ControllerBase , Object[] ) at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary2 parameters) at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass13.<InvokeActionMethodWithFilters>b__10() at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func1 continuation) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func1 continuation) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func1 continuation)


This could be because I've manually removed several rows from the DB (a long time ago, for custom modules that broke, etc). I had a look in the Orchard_Framework_ContentItemRecord table, and it is missing a row with ID 50, but I can't seem to insert into this table because the ID field is generated automatically.

Any ideas? Could this be the underlying problem?
Feb 26, 2014 at 10:08 PM
In case this helps someone in a similar situation, I ended up simply restoring an old copy of my SQLCE DB, and this issue went away, so it was clearly caused by my hacking and slashing of the DB directly (although I only ever removed obsolete module entries, so who knows what exactly was to blame!).
Feb 26, 2014 at 10:28 PM
Orchard Is very fragile regarding its db...
Mar 11, 2014 at 10:44 PM
Ok...so I'm re-opening this as I've just had the exact same thing happen to me...Only this time, I have steps to reproduce!

I created a new content type, and assigned it several content fields.
I then created several items of this new type.
But then I realised that I needed to remove some of the fields and/or add new ones.
I then created more items of this type - including the newly added/removed fields.

Now the problem - these items are NOT listed on the "Manage X Content" page. I am still able to run a query to see the newly added items, so they are obviously being added to the DB, but I'm unable to use the UI to manage them.

So once again, I'm left with this:

Image

PLEASE could someone explain what needs to be done to correct this? Do I need to look into migrations, or something similar?
Mar 12, 2014 at 11:09 PM
Fixed it! - Items of a custom content type MUST have the "common" content part in order to appear in the list (although I don't agree with this logic!). Hope this helps someone else in a similar situation.
Marked as answer by nick4501 on 3/12/2014 at 3:09 PM
Mar 12, 2014 at 11:11 PM
It was my original question :)