• Resolved Alexander Guskov

    (@forcesail)


    Hello.
    v.10.1.1
    PHP Warning: foreach() argument must be of type array|object, string given in /…/plugins/quiz-master-next/php/classes/class-qmn-quiz-manager.php on line 1757

    And really, unserialized array in $contact_form comes to function qsm_validate_contact_fields:

    $contact_form not an array, but:
    a:3:{i:0;a:4:{s:5:”label”;s:9:”Your name”;s:3:”use”;s:4:”name”;s:4:”type”;s:4:”text”;s:8:”required”;s:4:”true”;}i:1;a:4:{s:5:”label”;s:10:”Your email”;s:3:”use”;s:5:”email”;s:4:”type”;s:5:”email”;s:8:”required”;s:4:”true”;}i:2;a:4:{s:5:”label”;s:7:”Confirm”;s:3:”use”;s:4:”none”;s:4:”type”;s:8:”checkbox”;s:8:”required”;s:4:”true”;}}

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi @forcesail ,

    I hope you’re doing well, and thank you for reaching out to us.

    We appreciate you sharing the PHP warning message. I’ve taken note of the details you provided, and I will be discussing this issue with our development team to ensure it is resolved as soon as possible.

    Please allow us some time to investigate the matter thoroughly. I will follow up with you shortly with a solution. If we require any further information during the process, I’ll be sure to let you know.

    Thank you for your cooperation and understanding. I look forward to hearing back from you if you have any additional concerns or updates.

    Best regards,
    Dhanush

    Dear @forcesail ,

    I hope this message finds you well.

    I’m pleased to inform you that we have implemented a fix for the issue you reported. This fix will be included in our upcoming release. In the meantime, you can manually apply the following workaround to resolve the issue:

    Please add the lines below to the qsm_validate_contact_fields function in the class-qmn-quiz-manager.php file, immediately after the $errors variable declaration:

    if ( ! is_array( $contact_form ) ) {
    return 1;
    }

    This should help temporarily address the issue until the official update is available.

    Please feel free to reach out if you encounter any difficulties or need further assistance.

    Thank you for your time and continued cooperation.

    Best regards,
    Dhanush

    Thread Starter Alexander Guskov

    (@forcesail)

    You are great as always, Dhanush!

    You’re most welcome @forcesail ,— and thank you for your kind words!

    Please don’t hesitate to reach out if you need any assistance or further information. I’m always here to support you and ensure everything works as expected.

    I truly appreciate your proactive approach in identifying and helping us resolve the issue. Your collaboration made the process smooth and effective.

    Thank you once again for your time and active participation.

    Best regards,
    Dhanush

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘PHP Warning: foreach() argument must be of type array|object, string given’ is closed to new replies.