• Resolved Dealer Solutions

    (@dealersolutions)


    Hello, I get this error in the support tab and I think I know why…

    Error: {#each} only iterates over array-like objects.

    it’s because my WordPress user and the “Support Access” list of email addresses both contain the same email address.

    Can you please change the line

    array_unique( array_merge( $email, $result['support_contacts'] ) )

    to

    array_values( array_unique( array_merge( $email, $result['support_contacts'] ) ) )

    so that the array indexes are reset, and the JSON that is generated for the support tab doesn’t contain the indexes 0,2,3 etc and fail the validate_each_argument validation? because the array indexes don’t go 0,1,2 it can’t iterate over the object.

    The error is generated here

    let each_value = /*$licence*/ ctx[6].support_email_addresses;
    validate_each_argument(each_value);

    For now I will remove my duplicate email address from the “Support Access” list

    With thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Delicious Brains

    (@deliciousbrains)

    Hi Dealer Solutions,

    Thank you for reporting this issue. It’s added to our todo-list and we plan to fix it in an upcoming release of the plugin.

    Sorry for the inconvenience.

    -et

    Thread Starter Dealer Solutions

    (@dealersolutions)

    Thanks, really interesting and simple bug since JSON encoding will jump between array notation and brace notation given the index key structure.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Support Tab – {#each} only iterates over array-like objects.’ is closed to new replies.