Custom Fields
Re-Envisioned
Support MB Relationships Notice: Undefined index: to in normalizer.php on line 84

  • Creator
    Topic
  • #26586
    RJ Laan
    Participant

    Hi!

    I got this PHP Notice error while using MB Relationship together with FacetWP.

    With FacetWP activated the normalize() method is getting called twice, resulting in this issue.

    On line 79 $direction is set from the $args['from']:

    $direction = isset( $args['from'] ) ? 'from' : 'to';

    Which is then used on line 84:

    $args['items'] = $this->get_ids( $args[ $direction ], $args['id_field'] );

    On line 87 the original parameter is cleared:

    unset( $args[ $direction ] );

    Then the second time around the original 'from' parameter does not exist anymore and the notice is triggered.

    Perhaps the normalize_args() method could check if it has already run?

    Thanks,
    Ruud

Viewing 5 replies - 1 through 5 (of 5 total)
  • Author
    Replies
  • #26593
    Long Nguyen
    Moderator

    Hi,

    Thank you for your feedback.

    Can you please let me know which version of Facet and MB Relationships you are using? And how can I reproduce the issue?

    #26609
    RJ Laan
    Participant

    Hi Long,

    Thanks for your reply.

    FacetWP: 3.8.1
    MB Relationship: 1.10.5
    Metabox: 5.3.9

    How to reproduce:

    • Create CPT 'word', with taxonomy Genre
    • Add 2x relationship, one for synonyms, one for related words, see pastebin snippet: https://pastebin.com/YPhCAWJ8 (let me know if you have trouble accessing this snippet)
    • Add facet filter on Genre
    • Add page with page template and add WP-Query to get all Words
    • Add facet filter to page template to filter by Genre
    • Use relationships to get related and synonym words for each word

    This in combination should likely have MB relationship and FacetWP touch the query and trigger the parse_query() twice, which then results in the error.

    Let me know if you need anything else.

    Thanks,
    Ruud

    #26620
    Long Nguyen
    Moderator

    Hi,

    Thank you for the additional information.

    I will inform the development team to check this case and get back to you if there is any information.

    #26622
    RJ Laan
    Participant

    Hi Long!

    Thanks for sending the information to the development team.
    Ruud

    #26806
    Alex Mansfield
    Participant

    I'm getting the same issue.

    FacetWP 3.7.4
    Metabox 5.3.9
    Metabox AIO 1.13.5

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