Select_tree with attribute required true not works

Support General Select_tree with attribute required true not worksResolved

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #12429
    JeffersonJefferson
    Participant

    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,
    ),
    
    #12441
    Anh TranAnh Tran
    Keymaster

    Hi Jefferson,

    Does the code work when you remove that attribute completely? Setting it false actually doesn't do anything.

    #12454
    JeffersonJefferson
    Participant

    Without the parameter attributes -> required, the code works, but I need that this field be required. Can you help me?

    #12468
    yomisimieyomisimie
    Participant

    Your code might be incomplete. You're missing the closing bracket on the attributes array

    #12469
    JeffersonJefferson
    Participant

    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.

    #45628
    AlexAlex
    Participant

    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.

    #45631
    PeterPeter
    Moderator

    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.

    #45681
    AlexAlex
    Participant

    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!

    #45920
    AlexAlex
    Participant

    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!

    #46208
    AlexAlex
    Participant

    An update of the plugin Metabox to version 5.10.0 was recently released, but the bug is still not fixed in the new version.

    #46395
    AlexAlex
    Participant

    An update of the plugin Metabox to version 5.10.1 was recently released, but the bug is still not fixed in the new version.

    #46399
    PeterPeter
    Moderator

    Hello 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.

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.