php warning "Illegal string offset" when using "My Exceptional Working Days"

I have just about finished setting up this plugin for use but have found one problem.

Whenever a user adds a date to "My Exceptional Working Days" 2 php messages pop up in the top of the page where the appointment calendar is in the front-end:

Warning: Illegal string offset 'start' in /path_to_website/public/wp-content/plugins/appointments/appointments.php on line 2959

Warning: Illegal string offset 'end' in /path_to_website/public/wp-content/plugins/appointments/appointments.php on line 2960

This does not appear when I use the "My Holidays" .

I tried adding the same date in "My Exceptional Working Days" and "My Holidays" and now this same warning message appears 22 times. Even After i remove the date from "My Holidays" the message still appears 22 times for that User.

When i remove the date from "My Holidays" the message disappears and this behavior is seen with every staff account.

I tried disabling all plugins, and removed my simple jquery script which disables the payment button until a user clicks on a checkbox but the error still appears.

I am using wordpress 4.3.1
appointments+ is 1.5.2
php 5.6

Is this a serious issue or is it safe to just hide this warning message?

  • ttaku

    Mm going to include a lot of information because were in different time zones.

    i re-createed the situation again and i will leave it like this.
    I will leave all plugins enabled and coded intact.

    every staffs time slot is closed (we want to use exceptional days only).
    I selected a staff and added 25-nov-2015 in his "exceptional working days".
    In the front end i chose the service, and this staff, and the error message appears at the top again.
    The service is: custom fitting (japanese), service provider: staff $200

    The service providers name are nicknames in wp's profile pages, This is not custom coded, we intentionally used these generic names.

    I have not touched any code outside wordpress's child theme folder, although i have added some code in functions.php to prevent some backend access to staffs.

    The user roles for these staff were set to "subscriber" but they were not able to manage/edit appointments so i had to use the "User Role Editor" plugin and grant them "manage_options" capability. It seems this capability is required to manage this plugin.

    This enables them to edit "Settings" in the backend (which is bad!) so i had to add some code to hide these menus from them and redirect them to other pages in case they accidentally went there.

    I used the "Adminimize" plugin to hide these menus which uses css and this code i found online to re-direct access:

    function themeblvd_disable_admin_bar() {
    if ( ! current_user_can('edit_posts') ) {
    global $pagenow;
    if($pagenow == 'options-general.php'){
    wp_redirect(admin_url('/admin.php?page=appointments', 'http'), 301);
    exit;
    }
    if($pagenow == 'options-writing.php'){
    wp_redirect(admin_url('/admin.php?page=appointments', 'http'), 301);
    exit;
    }
    if($pagenow == 'options-reading.php'){
    wp_redirect(admin_url('/admin.php?page=appointments', 'http'), 301);
    exit;
    }
    if($pagenow == 'options-discussion.php'){
    wp_redirect(admin_url('/admin.php?page=appointments', 'http'), 301);
    exit;
    }
    if($pagenow == 'options-media.php'){
    wp_redirect(admin_url('/admin.php?page=appointments', 'http'), 301);
    exit;
    }
    if($pagenow == 'options-permalink.php'){
    wp_redirect(admin_url('/admin.php?page=appointments', 'http'), 301);
    exit;
    }
    if($pagenow == 'options-general.php?page=adminimize%2Fadminimize.php'){
    wp_redirect(admin_url('/admin.php?page=appointments', 'http'), 301);
    exit;
    }
    if($pagenow == 'options-general.php?page=sendgrid-settings'){
    wp_redirect(admin_url('/admin.php?page=appointments', 'http'), 301);
    exit;
    }
    if($pagenow == 'admin.php?page=app_settings'){
    wp_redirect(admin_url('/admin.php?page=appointments', 'http'), 301);
    exit;
    }
    if($pagenow == 'admin.php?page=app_shortcodes'){
    wp_redirect(admin_url('/admin.php?page=appointments', 'http'), 301);
    exit;
    }
    if($pagenow == 'admin.php?page=app_faq'){
    wp_redirect(admin_url('/admin.php?page=appointments', 'http'), 301);
    exit;
    }
    }
    }

    Other than that i have a block of code in page.php that hides a staff from the service dropdown unless a certain staff is logged in:

    <?php
    #display mark for only mark
    $user_id = get_current_user_id();
    if ( ( is_user_logged_in() ) && ( $user_id == 8 ) ) { ?>
    <style>
    .app_select_workers option[value="8"]{
    display: block;
    }
    </style>
    <?php } else{ ?>
    <style>
    .app_select_workers option[value="8"]{
    display: none;
    }
    </style>
    <?php }
    ?>

    I also added a checkbox and a simple script that disables the payment button unless it is clicked:

    jQuery( document ).ready(function() {
    jQuery('.app_submit_btn').addClass('disbtn');
    jQuery('.app_submit_btn').prop("disabled", true);

    jQuery('#checkscaa').click(function (e) {
    if (this.checked) {
    jQuery('.app_submit_btn').prop("disabled", false);
    jQuery('.app_submit_btn').removeClass('disbtn');
    }else{
    jQuery('.app_submit_btn').prop("disabled", true);
    jQuery('.app_submit_btn').addClass('disbtn');
    }
    });
    jQuery('.appointments-confirmation-button').click(function (e) {
    jQuery('.scaachecktr').removeClass('hide');
    });
    });

    Please let me know if you require additional information or whether this message can just be hidden and ignored.

    Kind Regards,
    ttaku

  • ttaku

    Thank you for the information.
    Yes going to admin settings and updating through there removes the error messages.

    This is not a fix though as the errors will keep popping up as long as the staff uses their
    profile page to manage their schedules.

    I will restrict access to the profile pages for now and have everyone use the plugins interface to manage the appointments in the time being.

    Thank you

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.