Skip Navigation

[Resolved] Views 2.8.4: PHP Warning: array_key_exists() expects parameter 2 to be array

This support ticket is created 5 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Our next available supporter will start replying to tickets in about 5.54 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 5 replies, has 2 voices.

Last updated by Nigel 5 years, 4 months ago.

Assisted by: Nigel.

Author
Posts
#1292609

I am trying to: edit a page in block editor

Link to a page where the issue can be seen: private site

I expected to see: no AJAX errors

Instead, I got:

{
"type": "warning",
"message": "array_key_exists() expects parameter 2 to be array, bool given",
"file": "wp-content/plugins/wp-views.git/embedded/inc/wpv-shortcodes.php",
"line": 3225,
"stack": [
"array_key_exists()",
"wpv_attribute()",
"do_shortcode_tag()",
"preg_replace_callback()",
"do_shortcode()",
"wpv_parse_content_shortcodes()",
"wpv_resolve_internal_shortcodes()",
"WPV_Frontend_Render_Filters::pre_process_shortcodes()",
"apply_filters('the_content')",
"WP_REST_Posts_Controller->prepare_item_for_response()",
"WP_REST_Posts_Controller->get_item()",
"WP_REST_Server->dispatch()",
"WP_REST_Server->serve_request()",
"rest_api_loaded()",
"do_action_ref_array('parse_request')",
"WP->parse_request()",
"WP->main()",
"wp()"
],
"component": "Plugin: wp-views.git"
}

Page content:

<!-- wp:heading {"level":3,"className":"no-anchor"} -->
<h3 class="no-anchor">Personal All-Access</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p><strong><strong>[add_to_cart_price sku="PERSONAL-ALL-ACCESS-1MO"]</strong></strong><strong><strong style="font-weight: bold;"></strong></strong><br><small> </small></p>
<!-- /wp:paragraph -->

<!-- wp:list {"className":"benefits"} -->
<ul class="benefits"><li>Includes <strong>all 4 minidegrees</strong>.</li><li>Access to <strong>50+ expert courses</strong>.</li><li>Learning roadmapping and progress tracking.</li><li>Single user only.</li><li>Save <strong>$198 / yr</strong> with <a style="cursor: pointer;" onclick="javascript:jQuery('.gform_checkout .gfield_billing_plans input[value=annual] + label').click();">Annual</a>.</li></ul>
<!-- /wp:list -->
#1292731

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

The blocks you've added to the page, one contains a non-Toolset shortcode, one contains inline JS.

Are you able to confirm exactly which block is required to trigger the error you report?

And can you confirm whether it happens when you disable non-Toolset plugins and switch theme to twentynineteen? Seems like there may be a conflict with 3rd-party code, and disabling then re-activating plugins or changing theme may enable you to identify where.

#1292745

I'm able to do some additional quick diagnosis on another fresh staging site today.

But if you look at the traceback, nothing else is involved.

Something goes wrong with `$view_atts = $WP_Views->get_view_shortcodes_attributes();`

#1292775

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

True, but it's not an error I see myself or have other reports of, so it looks like something specific to this page on your site in the context of the plugins and theme you are using.

Your plugin folder name is wp-views.git, so it looks like you are using a non-standard installation method, so I would also double-check simply installing the plugin manually using the latest version from toolset.com/account/downloads to make sure there is no issue arising from your site build process.

#1295543

Indeed, I also can't reproduce on a clean site.

Will look to do a quick debug session during weekend.

#1295791

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

OK, let me know what you find.