verbb / wishlist

A Craft CMS plugin for wishlists for your users to save things to
Other
11 stars 12 forks source link

Exception thrown when adding custom field #99

Closed russback closed 2 years ago

russback commented 2 years ago

Description When adding an item to a list, and error is thrown when adding custom field data:

Unknown Property – yii\base\UnknownPropertyException
Setting unknown property: craft\behaviors\CustomFieldBehavior::myField

Steps to reproduce This is just using the standard custom field markup (in this case for a Commerce product variant):

<form method="post">
  <input type="hidden" name="action" value="wishlist/items/add">
  <input type="hidden" name="elementId" value="{{ variant.id }}">
  {{ successMessageInput('Added '~ product.title ~' to your wishlist.') }}
  {{ csrfInput() }}
  <input type="text" name="fields[myField]" value="My Value">
  <input type="submit" value="Add to wishlist">
</form>

Additional info

engram-design commented 2 years ago

The only way I can reproduce this is if you use a handle for the field that doesn't exist for the list type you're trying to add a list item to. Can you verify the default list type has the field (in this example with handle myField)?

russback commented 2 years ago

Can you verify the default list type has the field (in this example with handle myField)?

Well that was dumb. Sorry!