Custom Fields
Re-Envisioned
Support Meta Box Conditional Logic TypeError: logics is undefined

  • Creator
    Topic
  • #18497
    Austin Passy
    Participant

    TypeError: logics is undefinedconditional-logic.js:221:18

    You should check for the logics object before sub checks, like:

    var relation = typeof logics !== 'undefined' && typeof logics.relation !== 'undefined' ? logics.relation.toLowerCase() : 'and',
                success = relation === 'and';
Viewing 7 replies - 1 through 7 (of 7 total)
  • Author
    Replies
  • #18512
    Anh Tran
    Keymaster

    Hi Austin,

    Thanks for your feedback. I guess, it’s a sign that there’s a problem with the logic syntax. Can you please check it first? And if possible, please send me the code for meta boxes, so I can double check.

    Thanks

    #18570
    woorise
    Participant

    I get the same error “TypeError: logics is undefined” when I use conditional logic in a field which is part of a group field.

    #18576
    Anh Tran
    Keymaster

    Can you please post the code of your meta box?

    #18577
    woorise
    Participant

    Thanks for the quick respond Anh. In my case I found that the issue occurs when I include the following characters as a placeholder in the field I want to hide: “ ”

    Here is the part of the code:

    [
    ‘name’ => esc_html__( ‘Field’, ‘test’ ),
    ‘id’ => ‘field’,
    ‘type’ => ‘textarea’,
    ‘visible’ => [ ‘test_field’, ‘!=’, ” ],
    ‘placeholder’ => ‘ ’,
    ],

    #18578
    woorise
    Participant

    *forgot to include it between code tags:

    'placeholder' => ' ',

    #18579
    woorise
    Participant

    again it strips out the characters. I will use spaces this time:

    & # 1 0 ;

    #18597
    Anh Tran
    Keymaster

    Can you post the code on pastebin.com? The forum auto strips all unwanted characters.

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.
grid gear info copy caret-up caret-down trash