Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TODO: Fix critical compatibility issue with PHP v7.4 and higher, due to deprecated behavior of array_key_exists function #18

Open
rizdaprasetya opened this issue Feb 12, 2024 · 0 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@rizdaprasetya
Copy link
Contributor

rizdaprasetya commented Feb 12, 2024

Summary of issue

as title

Sample PHP error

  • CRITICAL Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, stdClass given in /code/wp-content/plugins/edd-midtrans-gateway/lib/Midtrans/Notification.php:32
    • Thrown when receiving notif & likely breaks notif handling flow
PHP Error Log details
2023-12-06T08:54:52+00:00 CRITICAL Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, stdClass given in /code/wp-content/plugins/edd-midtrans-gateway/lib/Midtrans/Notification.php:32
Stack trace:
#0 /code/wp-content/plugins/edd-midtrans-gateway/lib/Midtrans/Notification.php(32): array_key_exists('transaction_sta...', Object(stdClass))
#1 /code/wp-content/plugins/edd-midtrans-gateway/midtrans-standard.php(62): Midtrans\Notification->__get('transaction_sta...')
#2 /code/wp-includes/class-wp-hook.php(324): edd_midtrans_notification('')
#3 /code/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
#4 /code/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#5 /code/wp-content/plugins/edd-midtrans-gateway/midtrans-standard.php(103): do_action('edd_midtrans_no...')
#6 /code/wp-includes/class-wp-hook.php(324): edd_listen_for_midtrans_notification('')
#7 /code/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#8 /code/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#9 /code/wp-settings.php(643): do_action('init')
#10 /code/wp-config.php(86): require_once('/code/wp-settin...')
#11 /code/wp-load.php(50): require_once('/code/wp-config...')
#12 /code/wp-blog-header.php(13): require_once('/code/wp-load.p...')
#13 /code/index.php(17): require('/code/wp-blog-h...')
#14 {main}
  thrown in /code/wp-content/plugins/edd-midtrans-gateway/lib/Midtrans/Notification.php on line 32

Reference of issue

Line of codes to fix

For example, search for any occurrence of array_key_exists function calls:

Reference of possible fix actions

Other

  • Current status: postponed with no ETA, waiting for the future maintainer's available bandwidth
@rizdaprasetya rizdaprasetya added bug Something isn't working enhancement New feature or request labels Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant