Viewing 4 reply threads
  • Author
    Posts
    • #11389
      thor
      Member

      Hello Steve

      Can you help with this?
      I get this PHP error when clicking “Add Shortcode” on a clients website – and no shortcodes are showing up:

      E_COMPILE_ERROR: Unparenthesizeda ? b : c ? d : eis not supported. Use either(a ? b : c) ? d : eora ? b : (c ? d : e)`
      in Piklist::render called at /home/681932.cloudwaysapps.com/bsemvvdszz/public_html/wp-content/plugins/piklist/parts/fields/form.php (16) in include called at
      /home/681932.cloudwaysapps.com/bsemvvdszz/public_html/wp-content/plugins/piklist/includes/class-piklist.php (523) in Piklist::render called at
      /home/681932.cloudwaysapps.com/bsemvvdszz/public_html/wp-content/plugins/piklist/includes/class-piklist-form.php (3093) in Piklist_Form::render_form called at
      /home/681932.cloudwaysapps.com/bsemvvdszz/public_html/wp-content/plugins/piklist/includes/class-piklist.php (2981) in piklist called at
      /home/681932.cloudwaysapps.com/bsemvvdszz/public_html/wp-content/plugins/piklist/parts/shortcodes/form.php (7) in include called at
      /home/681932.cloudwaysapps.com/bsemvvdszz/public_html/wp-content/plugins/piklist/includes/class-piklist.php (523) in Piklist::render called at
      /home/681932.cloudwaysapps.com/bsemvvdszz/public_html/wp-content/plugins/piklist/includes/class-piklist-shortcode.php (272) in Piklist_Shortcode::shortcode called at
      /home/681932.cloudwaysapps.com/bsemvvdszz/public_html/wp-includes/shortcodes.php (356) in do_shortcode_tag called at ? (?) in preg_replace_callback called at
      /home/681932.cloudwaysapps.com/bsemvvdszz/public_html/wp-includes/shortcodes.php (228) in do_shortcode called at
      /home/681932.cloudwaysapps.com/bsemvvdszz/public_html/wp-content/plugins/piklist/parts/admin-pages/shortcode-editor.php (6) in include called at
      /home/681932.cloudwaysapps.com/bsemvvdszz/public_html/wp-content/plugins/piklist/includes/class-piklist.php (523) in Piklist::render called at
      /home/681932.cloudwaysapps.com/bsemvvdszz/public_html/wp-content/plugins/piklist/includes/class-piklist.php (3136) in piklist called at
      /home/681932.cloudwaysapps.com/bsemvvdszz/public_html/wp-content/plugins/piklist/parts/shared/admin-page.php (12) in include called at
      /home/681932.cloudwaysapps.com/bsemvvdszz/public_html/wp-content/plugins/piklist/includes/class-piklist.php (523) in Piklist::render called at
      /home/681932.cloudwaysapps.com/bsemvvdszz/public_html/wp-content/plugins/piklist/includes/class-piklist-admin.php (447) in Piklist_Admin::admin_page called at
      /home/681932.cloudwaysapps.com/bsemvvdszz/public_html/wp-includes/class-wp-hook.php (303) in WP_Hook::apply_filters called at
      /home/681932.cloudwaysapps.com/bsemvvdszz/public_html/wp-includes/class-wp-hook.php (327) in WP_Hook::do_action called at
      /home/681932.cloudwaysapps.com/bsemvvdszz/public_html/wp-includes/plugin.php (470) in do_action called at
      /home/681932.cloudwaysapps.com/bsemvvdszz/public_html/wp-admin/admin.php (259)
      `

    • #11391
      Steve
      Keymaster

      @thor– I haven’t been able to reproduce. Did you do any upgrades on the site recently?

    • #11393
      thor
      Member

      Hi Steve,

      I have PHP version 8.0.14 – that is the only change besides updated WordPress and plugins.

    • #11394
      thor
      Member

      Since PHP 7.4 the unparenthesized usage has been deprecated.
      So in /piklist/parts/forms/shortcode.php changing:

      $index = empty($shortcode_data) ? -1 : array_key_exists('index', $shortcode_data) ? $shortcode_data['index'] : -1;

      to:

      $index = empty($shortcode_data) ? -1 : ( array_key_exists('index', $shortcode_data) ? $shortcode_data['index'] : -1 );

      makes the plugin work again with PHP 8. Perhaps there are other places Piklist will produce an error?

    • #11400
      maksromanov2020
      Participant

      good

Viewing 4 reply threads
  • You must be logged in to reply to this topic.