Coursepress Pro Broken Custom Functions

Since upgrading to Coursepress 2 our custom functions are broken. We have a child theme with which we provide a very customised course interface. The first two errors I have struck are these (in our custom functions.php for the child theme):

Call to a member function get_units_slug() on null in /home/[..]/themes/cpp-child/functions.php on line 47

When I removed that function call I then got:

PHP Fatal error: Class 'Course' not found in /home/[..]/themes/cpp-c
hild/functions.php on line 49

Were some functions and classes removed and/or changed between v1.x and 2.x? Our paid course is down right now as none of our custom pages are working any more.

Gary

  • Majid
    • Syntax Hero

    Hello Teckyhead,

    Sorry for the issues you were having. sometimes functions and classes names change after update. I will need your ftp credentials to debug the issue.
    You can send that privately through our contact form: https://premium.wpmudev.org/contact/#i-have-a-different-question

    Send in:

    Subject: "Attn: Majid Hamdani"
    -WordPress admin username
    -WordPress admin password
    -login url
    -FTP credentials (host/username/password)
    -link back to this thread for reference
    -any other relevant urls

    **If you keep support access active then no need to send in wp-admin

    Cheers,
    Majid

  • teckyhead
    • Design Lord, Child of Thor

    Hi Majid,

    I've done some work myself and fixed the issue with units not saving. That was actually a server issue where it was triggering a mod_security rule. I've also copied some of the templates over from the v2 theme and that allowed some more info to appear. I spent a couple of hours searching through v1.x classes and comparing to v2.x classes and fixed most of those errors. What I see now is an issue with the login page. The error that is coming up relates to line 71 in the child theme's student-dashboard.php:

    PHP Fatal error: Call to undefined method CoursePress::instance() in [..]/cpp-child/student-dashboard.php on line 71

    I also see a lot of undefined notices in the debug log:

    PHP Notice: Undefined index: mandatory
    PHP Notice: Undefined index: assessable

    Now that I can see the course units list there is another issue. Most of the units are locked and displaying:

    Opens Jun 02, 2015

    I have been through all units and changed them to 'available immediately' but this hasn't fixed it (besides that fact that Jun 2015 was nearly 2 years ago).

    Gary

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.