Support Forum
When 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,
),
Hi Jefferson,
Does the code work when you remove that attribute completely? Setting it false
actually doesn't do anything.
Without the parameter attributes -> required, the code works, but I need that this field be required. Can you help me?
Your code might be incomplete. You're missing the closing bracket on the attributes
array
The 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.
Hello, 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.
Hello Alex,
You are right. There is an issue with the field type select_tree
and required
attribute. I've escalated this issue to the development team to fix it soon.
Thank you.
An 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!
An 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!