• Resolved doornekamph

    (@doornekamph)


    today i updated moowoodle plugin to version 3.3.0 and the site broke with a fatal error.

    i fixed it by altering the installer.php (where the error occurs)

    open file:
    /wp-content/plugins/moowoodle/classes/Installer.php

    around rule 260 you see an array. thats where the error occurs.

    Uncomment that whole block and replace it with this code:


    $course_data = array(
    'moodle_course_id' => is_array($all_meta['moodle_course_id'] ?? null) ? reset($all_meta['moodle_course_id']) : 0,
    'shortname' => is_array($all_meta['_course_short_name'] ?? null) ? reset($all_meta['_course_short_name']) : '',
    'category_id' => is_array($all_meta['_category_id'] ?? null) ? reset($all_meta['_category_id']) : 0,
    'fullname' => sanitize_text_field($course->post_title),
    'product_id' => is_array($all_meta['linked_product_id'] ?? null) ? reset($all_meta['linked_product_id']) : 0,
    'startdate' => is_array($all_meta['_course_startdate'] ?? null) ? reset($all_meta['_course_startdate']) : 0,
    'enddate' => is_array($all_meta['_course_enddate'] ?? null) ? reset($all_meta['_course_enddate']) : 0,
    );
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Purnendu Dash

    (@purnendu)

    Hello @doornekamph,

    Thank you for sharing the fix with the community – we truly appreciate your input.

    Could you please let us know under what conditions you encountered this issue? From our understanding, it typically occurs when a different plugin has been used to create a course with the post type “course”. Otherwise, the data should generally be available as expected.

    Apologies for the inconvenience caused – this was an edge case we hadn’t anticipated. We’ll be including your suggested fix in our upcoming update today.

    Thanks again for your valuable contribution!

    Thread Starter doornekamph

    (@doornekamph)

    Hi Purnendu,

    Thnx for your fast follow up! I’m not sure what the conditions are; i’m the developer who makes their site run. I can ask if my customer contact you for more details / followup.

    Have a nice day Purnendu,

    Greetings from The Netherlands 🙂

    Plugin Author Purnendu Dash

    (@purnendu)

    Sure @doornekamph ,

    Have a nice day ahead.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘fatal error’ is closed to new replies.