Content with Widget throws null reference exception

Topics: Core, General, Troubleshooting
May 15, 2014 at 11:38 PM
I am using out of box 1.7.3 code.
Brand new site, and no custom code
Steps to reproduce.
  1. Created new content type :"MyWidget"
  2. Added Parts "Widget" and "Body"
  3. Opened List Items of "MyWidget" on Content Definitions
  4. Clicked on "Create new MyWidget"
    Image
Object reference not set to an instance of an object.
Line 7: <fieldset>
Line 8: @Html.LabelFor(widget => widget.LayerId, T("Layer"))
Line 9: @Html.DropDownListFor(widget => widget.LayerId, new SelectList(Model.AvailableLayers, "Id", "Name"))
Line 10: <span class="hint">@T("The Layer where the Widget will be rendered.")</span>
Line 11: </fieldset>

I had same issue on 1.7.2.
Aug 1, 2014 at 6:54 AM
Did you get anywhere with this? I have the same error.

Can't create new widgets!
Developer
Aug 2, 2014 at 11:56 PM
This is by design - you should not make your widget type "Creatable". Instead, uncheck "Creatable" and create instances of your widget through the "Widgets" section.
Aug 10, 2014 at 3:44 AM
Yeah sorry I was going to post this, 10 minutes after my first post I realised what I had done wrong!
May 22, 2015 at 4:09 PM
I get this issue when my Widget isn't set to creatable.