• Resolved ekndev

    (@ekndev)


    There are PHP 8.1 compatibility issues. Whenever I make a save to the Dynamic QR setting, there will be a warning given, as follows:

    Warning: Undefined array key "sos-dynamic-qr-code-mb_post-content-12" in /home/httpd/vhosts/_/httpdocs/wordpress/wp-content/plugins/dynamic-qr-code/sos/wp/metabox.php on line 188 Warning: Cannot modify header information - headers already sent by (output started at /home/httpd/vhosts/_/httpdocs/wordpress/wp-content/plugins/dynamic-qr-code/sos/wp/metabox.php:188) in /home/httpd/vhosts/_/httpdocs/wordpress/wp-includes/pluggable.php on line 1435 Warning: Cannot modify header information - headers already sent by (output started at /home/httpd/vhosts/_/httpdocs/wordpress/wp-content/plugins/dynamic-qr-code/sos/wp/metabox.php:188) in /home/httpd/vhosts/_/httpdocs/wordpress/wp-includes/pluggable.php on line 1438
    fyi: domain has been substituted by _

    This is also triggering when I do any other request to wp-options.php or post.php.
    Please fix it.
    Let me know if you need any more info.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author sosidee

    (@sosidee)

    Hi,
    I can’t figure out the true reason why this happens without a deeper analysis of your configuration, but I believe we can rapidly fix the effect of the problem, which is to avoid the warnings.
    The issue will be definitely fixed in the next update, but if you wish to resolve it now the quickest way is to edit a file from the WordPress dashboard just to comment a line (that can be removed without compromising the functioning of the plugin).
    I can give you the info to edit the file or, if you prefer, I can do it for you if you create a temporary administrator account and send the login data to [email protected]

    Thread Starter ekndev

    (@ekndev)

    It is a very basic PHP 8.1 fix:

    In file dynamic-qr-code/sos/wp/data/field.php
    Replace line 400 with:
    $ret = array_values($result)[0] ?? null;

    This fixes the issue.

    Plugin Author sosidee

    (@sosidee)

    Very well, thank you for the hint.

    But, I must admit, I can’t see the link between the line 400 of field.php with the line 188 of metabox.php, where $_POST[$nonce_name] is called.

    Thread Starter ekndev

    (@ekndev)

    True, the link is not obvious. So the problem is if you have empty values for settings as “Redirect URL for inactive keys”, etc. then you will get above error message.

    When you set a value there (all 3 input fields), it will output this error:

    Warning: Undefined array key 0 in /home/httpd/vhosts//httpdocs/wordpress/wp-content/plugins/dynamic-qr-code/sos/wp/data/field.php on line 400 Warning: Cannot modify header information - headers already sent by (output started at /home/httpd/vhosts//httpdocs/wordpress/wp-content/plugins/dynamic-qr-code/sos/wp/data/field.php:400) in /home/httpd/vhosts//httpdocs/wordpress/wp-includes/pluggable.php on line 1435 Warning: Cannot modify header information - headers already sent by (output started at /home/httpd/vhosts//httpdocs/wordpress/wp-content/plugins/dynamic-qr-code/sos/wp/data/field.php:400) in /home/httpd/vhosts/_/httpdocs/wordpress/wp-includes/pluggable.php on line 1438

    Which led me to the solution above.

    Hope it helps.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[PHP 8.1] Warning: Undefined array key’ is closed to new replies.