tombenner / wp-mvc

An MVC framework for WordPress
http://wpmvc.org
MIT License
623 stars 172 forks source link

Fix bug with belong_to_dropdown form element name #256

Closed amaneshi closed 3 years ago

amaneshi commented 3 years ago

After last code merge in helpers was added wrap function "input_name" for "name" attribute to "select_tag" of MvcFormHelper class. And now method "belongs_to_dropdown" of same helper class wrap field name with "data['model name']['field name']" and in "select_tag" it wrapped twice - as result field have wrong name and not save its value in DB. So I removed wrap in first method and now its work as expected.

Or alternatively was proposed other fix in comment to problematic commit https://github.com/tombenner/wp-mvc/commit/68c2504b0f47fed6f23f9365fd5c7f25de51bdcb#commitcomment-47203595

cyberscribe commented 3 years ago

Thanks!