Select_tree with attribute required true not works
- This topic has 11 replies, 5 voices, and was last updated 7 months, 3 weeks ago by
Peter.
-
AuthorPosts
-
December 2, 2018 at 3:15 AM #12429
Jefferson
ParticipantWhen I apply the attribute required true in select_tree field_type, the post is not saved (action save is not fired when I click on button publish/update).
My code:
array( 'id' => 'category-and-types', 'type' => 'taxonomy', 'name' => esc_html__( 'Categoria, Tipo e Subtipo', 'webpesados' ), 'placeholder' => esc_html__( 'Selecione', 'webpesados' ), 'taxonomy' => 'category', 'field_type' => 'select_tree', 'class' => 'web_select_tree', 'columns' => 6, 'attributes' => array( 'required' => false, ),
December 2, 2018 at 12:54 PM #12441Anh Tran
KeymasterHi Jefferson,
Does the code work when you remove that attribute completely? Setting it
false
actually doesn't do anything.December 3, 2018 at 8:14 PM #12454Jefferson
ParticipantWithout the parameter attributes -> required, the code works, but I need that this field be required. Can you help me?
December 4, 2018 at 5:59 PM #12468yomisimie
ParticipantYour code might be incomplete. You're missing the closing bracket on the
attributes
arrayDecember 4, 2018 at 6:31 PM #12469Jefferson
ParticipantThe code that I paste in ticket really have a unclosed tag. Was a mistake when I try to format the code here after to paste. But in my project, the all bracket are closed and the post is not saved.
June 10, 2024 at 4:26 PM #45628Alex
ParticipantHello, colleagues!
I confirm the problem with field "taxonomy" with type "select_tree" and "required" attribute!
[ 'name' => 'Name', 'id' => 'dir', 'type' => 'taxonomy', 'taxonomy' => 'l14dir', 'field_type' => 'select_tree', 'remove_default' => true, 'required' => true, ],
Everything is fine when you save it for the first time, but when you change this field (re-save), errors appear and the post is not saved.
June 10, 2024 at 8:37 PM #45631Peter
ModeratorHello Alex,
You are right. There is an issue with the field type
select_tree
andrequired
attribute. I've escalated this issue to the development team to fix it soon.Thank you.
June 21, 2024 at 6:55 PM #45681Alex
ParticipantAn update of the plugin Metabox to version 5.9.9 was recently released, but the bug is still not fixed in the new version.
I ask you to remind the developers about this problem. Until it is resolved, we have to use this field in the project as optional, while it should be mandatory.
Thanks!
July 17, 2024 at 11:13 PM #45920Alex
ParticipantAn update of the plugin Metabox to version 5.9.11 was recently released, but the bug is still not fixed in the new version.
More than a month has passed since I contacted you about this error.
I ask you to remind the developers about this problem. Until it is resolved, we have to use this field in the project as optional, while it should be mandatory.
Thanks!
August 22, 2024 at 10:16 PM #46208Alex
ParticipantAn update of the plugin Metabox to version 5.10.0 was recently released, but the bug is still not fixed in the new version.
September 10, 2024 at 5:42 PM #46395Alex
ParticipantAn update of the plugin Metabox to version 5.10.1 was recently released, but the bug is still not fixed in the new version.
September 10, 2024 at 10:36 PM #46399Peter
ModeratorHello Alex,
This issue has been fixed in this commit https://github.com/wpmetabox/meta-box/commit/a12832ec2282cd854eb14d2bb25b98915118db07
and it will be included in the next update of Meta Box. -
AuthorPosts
- You must be logged in to reply to this topic.