Error in updating a CPT

Posted in: Newspaper
Post count: 11

When seeking help with this issue, you may be asked for some of the following information:
WordPress version 6.8.1
Active theme: Newspaper Child theme (version 9.0c)
Current plugin: tagDiv Opt-In Builder (version 1.7.1 | built on 29.04.2025 10:50)
PHP version 8.3.6

Error Details
=============
An error of type E_ERROR was caused in line 3276 of the file /wp-content/plugins/td-subscription/includes/td_subscription.php. Error message: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, null given in /wp-content/plugins/td-subscription/includes/td_subscription.php:3276
Stack trace:
#0 /wp-includes/class-wp-hook.php(324): td_subscription::td_post_theme_settings_mb_save_filter()
#1 /wp-includes/plugin.php(205): WP_Hook->apply_filters()
#2 /wp-content/plugins/td-composer/legacy/common/wp_booster/wp-admin/external/wpalchemy/MetaBox.php(880): apply_filters()
#3 /wp-content/plugins/td-composer/legacy/common/wp_booster/wp-admin/external/wpalchemy/MetaBox.php(2081): WPAlchemy_MetaBox->apply_filters()
#4 /wp-includes/class-wp-hook.php(326): WPAlchemy_MetaBox->_save()
#5 /wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#6 /wp-includes/plugin.php(517): WP_Hook->do_action()
#7 /wp-includes/post.php(5110): do_action()
#8 /wp-includes/post.php(5212): wp_insert_post()
#9 /wp-admin/includes/post.php(453): wp_update_post()
#10 /wp-admin/post.php(227): edit_post()
#11 {main}
thrown

Post count: 4

A function is trying to use array_key_exists() on a variable that is null instead of an array.

**How to fix:**
– The plugin author should ensure that the second argument to array_key_exists() is always an array.
– As a quick fix, you can wrap the call with an is_array() check.

**Example fix:**
`php
if (is_array($array) && array_key_exists($key, $array)) {
// ...existing code...
}
`

Post count: 35449

Hi,
The error seems to be related to an external post type and the subscription plugin, mainly the lockers that are provided by this plugin. Lockers aren’t however active for the external posts – https://prnt.sc/rBCQaBb382dN so the option to set a locker doesn’t even appear in the post edit screen, but seems to resolve the problem – https://i.imgur.com/odOozKU.png
Thank you!

Viewing 3 posts - 1 through 3 (of 3 total)
The forum ‘Newspaper’ is closed to new topics and replies.