WordPress.org

Ready to get started?Download WordPress

Forums

Weekly Class Schedule
Getting Illegal string offset 'classroom' error (4 posts)

  1. Noumaan Yaqoob
    Member
    Posted 5 months ago #

    I am getting this error when I try to display the weekly classroom schedule in a page using the shortcode [wcs]

    Warning: Illegal string offset 'classroom' in C:\xampp\htdocs\test2\wp-content\plugins\weekly-class-schedule\controllers\WcsOutputController.php on line 11

    Using the plugin with WordPress 3.6.1 with Twenty Twelve theme. Any ideas how to resolve this?

    http://wordpress.org/plugins/weekly-class-schedule/

  2. jonbenwaa
    Member
    Posted 4 months ago #

    Here's my fix:

    Go into the code and file the file called WcsOutputController.php- it will be under wp-content/plugins/weekly-class-schedule/controllers/

    Next find this line of code (for me it's line 11):

    $classroom = $attr['classroom'];

    And add a line above it and below it so it's inside a condition loop that looks like this:

    if ( isset($attr['classroom']) && ! empty($attr['classroom']) ) {
            $classroom = $attr['classroom'];
    }

    Without digging too deep into the code on this plugin, I know this will work because it was basically trying to set a classroom value to a variable when there was no classroom value.

  3. jillc
    Member
    Posted 3 months ago #

    That not right jonbenwaa!
    You may have noticed on the instructions they suggested you could set layout attribute like this: [wcs layout=horizontal].
    Therefore, [wcs layout=vertical] forces it to use the default vertical layout and happily removes the error message.

  4. AthleteHI
    Member
    Posted 3 months ago #

    It is true that using [wcs layout=vertical] instead of just [wcs] removes the classroom error. However, it still leaves "holes" in the schedule. I have a black background on the page so it's really obvious that something is still wrong.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.