Illegal String Offset Error in Events+

When creating an event, I see the following errors in the right hand column. So far, it does not appear to have any effect on creating events, but users will be very confused by this. The errors are:

Warning: Illegal string offset 'sel' in /Path to site/wp-content/plugins/events-and-bookings/lib/plugins/eab-events-membership-integration.php on line 166

Warning: Illegal string offset 'sel' in /Path to site/wp-content/plugins/events-and-bookings/lib/plugins/eab-events-membership-integration.php on line 167

Warning: Illegal string offset 'sel' in /Path to site/wp-content/plugins/events-and-bookings/lib/plugins/eab-events-membership-integration.php on line 168

Warning: Illegal string offset 'level' in /Path to site/wp-content/plugins/events-and-bookings/lib/plugins/eab-events-membership-integration.php on line 179

  • Vinod Dalvi

    Hi @Phil,

    Greetings and thanks for posting on the forums.

    I could reproduce the same issue on my test site using latest version of Events plugin so i have notified the developer to fix it in the plugin.

    In the meanwhile you can fix it in the plugin by editing the following Events + plugin file and making the below changes.

    Plugin File:
    plugins/events-and-bookings/lib/plugins/eab-events-membership-integration.php

    Changes to be made on line number 166, 167 & 168 respectively.

    Before Editing:

    $content .= '<option value="1" ' . ($meta["sel"] == 1 ? 'selected="selected"' : '') . '>'.__('Free for all members', Eab_EventsHub::TEXT_DOMAIN).' </option>';
    $content .= '<option value="0" ' . ($meta["sel"] == 0 ? 'selected="selected"' : '') . '>'.__('Event price', Eab_EventsHub::TEXT_DOMAIN).' </option>';
    $content .= '<option value="2" ' . ($meta["sel"] == 2 ? 'selected="selected"' : '') . '>'.__('Member price', Eab_EventsHub::TEXT_DOMAIN).' </option>';

    After Editing:

    $content .= '<option value="1" ' . ( isset($meta["sel"]) && $meta["sel"] == 1 ? 'selected="selected"' : '') . '>'.__('Free for all members', Eab_EventsHub::TEXT_DOMAIN).' </option>';
    $content .= '<option value="0" ' . ( isset($meta["sel"]) && $meta["sel"] == 0 ? 'selected="selected"' : '') . '>'.__('Event price', Eab_EventsHub::TEXT_DOMAIN).' </option>';
    $content .= '<option value="2" ' . ( isset($meta["sel"]) && $meta["sel"] == 2 ? 'selected="selected"' : '') . '>'.__('Member price', Eab_EventsHub::TEXT_DOMAIN).' </option>';

    Changes to be made on line number 179

    Before Editing:
    if ( is_array( $meta["level"] ) AND in_array( $level->id, $meta["level"] ) )

    After Editing:

    if ( isset($meta["level"]) && is_array( $meta["level"] ) AND in_array( $level->id, $meta["level"] ) )

    This is a simple PHP warning and not errors.
    Do you have WP_DEBUG set to true in your wp-config.php file?
    If you do then please set it to false.
    This will hide the warning messages and you will be able to use your site normally.

    Cheers,
    Vinod Dalvi

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.