2

Closed

Taxonomy Field

description

The taxonomy field is only displaying when the autocomplete is enabled. It never display when it's a radio button list or checkbox list. This happens when the field is used on a custom form.

file attachments

Closed Feb 4 at 7:56 PM by sebastienros

comments

BertrandLeRoy wrote Sep 20, 2013 at 1:24 AM

That's quite puzzling: I'm looking at it right now. I'm running 1.7.1 and my taxonomies show just fine both on the back and front-ends, with checkboxes and radios.

BertrandLeRoy wrote Sep 20, 2013 at 1:25 AM

Custom form seems to be the key here. Can you check on a regular content type in the admin?

Skrypt wrote Sep 20, 2013 at 2:08 AM

I've added Taxonomy Field on the Page Content Type without creating any Terms and I went in the "Welcome to Orchard" page and I got this error
Erreur du serveur dans l'application '/'.

La référence d'objet n'est pas définie à une instance d'un objet.

Description : Une exception non gérée s'est produite au moment de l'exécution de la requête Web actuelle. Contrôlez la trace de la pile pour plus d'informations sur l'erreur et son origine dans le code. 

Détails de l'exception: System.NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet.

Erreur source: 


Ligne 3 :  @{
Ligne 4 :      Style.Include("admin-taxonomy.css");
Ligne 5 :      Layout.Title = T("Manage terms for {0}", Model.Taxonomy.Name).ToString();
Ligne 6 :  
Ligne 7 :      var termIndex = 0;

Fichier source : d:\-= Plasmasoft =-\Work\Orchard\src\Orchard.Web\Modules\Orchard.Taxonomies\Views\TermAdmin\Index.cshtml    Ligne : 5 

Trace de la pile: 


[NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet.]
   ASP._Page_Modules_Orchard_Taxonomies_Views_TermAdmin_Index_cshtml.Execute() in d:\-= Plasmasoft =-\Work\Orchard\src\Orchard.Web\Modules\Orchard.Taxonomies\Views\TermAdmin\Index.cshtml:5
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +197
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +97
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +88
   System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +260
   System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +115
   Orchard.Mvc.ViewEngines.ThemeAwareness.<>c__DisplayClass7.<FindView>b__5(ViewContext viewContext, TextWriter writer, IViewDataContainer viewDataContainer) in d:\-= Plasmasoft =-\Work\Orchard\src\Orchard\Mvc\ViewEngines\ThemeAwareness\LayoutAwareViewEngine.cs:59
   Orchard.Mvc.ViewEngines.ThemeAwareness.LayoutView.Render(ViewContext viewContext, TextWriter writer) in d:\-= Plasmasoft =-\Work\Orchard\src\Orchard\Mvc\ViewEngines\ThemeAwareness\LayoutAwareViewEngine.cs:90
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +295
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +13
   System.Web.Mvc.<>c__DisplayClass1a.<InvokeActionResultWithFilters>b__17() +23
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +242
   System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +21
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +242
   System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +21
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +242
   System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +21
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +242
   System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +21
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +242
   System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +21
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +242
   System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +21
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +242
   System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +21
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +242
   System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +21
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +242
   System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +21
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +242
   System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +21
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +242
   System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +21
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +242
   System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +21
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +242
   System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +21
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +242
   System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +21
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +242
   System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +21
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +177
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +324
   System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__19() +23
   System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +19
   System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +10
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +57
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +47
   System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
   System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +25
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +23
   System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +47
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
   Orchard.Mvc.Routes.HttpAsyncHandler.EndProcessRequest(IAsyncResult result) in d:\-= Plasmasoft =-\Work\Orchard\src\Orchard\Mvc\Routes\ShellRoute.cs:159
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9628700
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155

Informations sur la version : Version Microsoft .NET Framework :4.0.30319; Version ASP.NET :4.0.30319.18045

Skrypt wrote Sep 20, 2013 at 2:09 AM

The error happened when I clicked on the button "Create some terms"

Skrypt wrote Sep 20, 2013 at 2:10 AM

The error happens because I did'nt selected any Taxonomy on the content field

Skrypt wrote Sep 20, 2013 at 2:13 AM

Same problem happens with Page content type with the a custom form. I only get the Label Taxonomy without seeing any controls.

Skrypt wrote Sep 20, 2013 at 2:27 AM

I've also set my theme to the theme machine to see if it was not a CSS bug but it's not.

Skrypt wrote Sep 20, 2013 at 3:25 AM

Here is the result on the Page content type. See attached file.

Skrypt wrote Sep 20, 2013 at 3:27 AM

I've tried editing the anonymous and administrator roles permissions but it did'nt help either. I've also pulled the last commit from the repository.

sebastienros wrote Feb 4 at 7:56 PM

Can you please provide a step by step repro ?

Thanks

Skrypt wrote Feb 4 at 9:20 PM

1- Enable Custom Forms Module
2- Go to content definition
3- Edit Page content type
4- Add a Field, name = Taxonomy, technical name = Taxonomy, Field type = Taxonomy Field
5- Go to Custom Forms menu and create a custom form. Title = test, Content type = Page
6- Now we need to assign a Taxonomy to the Taxonomy Field. So we go to Content Defition and edit Page content type. On the Taxonomy field we just added before we need to select a taxonomy "if you have none create one".
7-Go to your custom form page http://localhost/test and if you look at the Taxonomy Field it's just showing the title without any controls to select a choice.

(Just tried with latest source) 1.7