[CoursePress Pro] CoursePress upgrade from version 1->2

Hello, I need to upgrade CoursePress from version 1 to 2. When going through the process, I get the message \"An error occur while updating. Please contact your administrator to fix the problem.\" as soon as the upgrade reached the point of updating the student data.
I am the administrator, and I am not getting any errors in my logs. This is on a development domain, so whatever needs to be done to get this working is OK. Thanks!

  • Predrag Dubajic

    Hi Dean,

    Hope you're doing well.

    I don't think we had this report before, we had some issues with updates on certain installations but those were addressed months ago, I must say I'm a bit baffled :slight_smile:

    Could you provide us with FTP or cPanel to your dev site so we can investigate this further?
    You can send us your details using our contact form https://premium.wpmudev.org/contact/#i-have-a-different-question and the template below:

    Subject: "Attn: Predrag Dubajic"
    - Site login url
    - WordPress admin username
    - WordPress admin password
    - FTP credentials (host/username/password)
    - cPanel credentials (host/username/password)
    - Link back to this thread for reference
    - Any other relevant urls/info

    Best regards,
    Predrag

  • Predrag Dubajic

    Hi Dean,

    I tried responding to your the email you sent via contact form but the email provided there seems to be incorrect as it returned failed report.

    Anyways, I was able to access your files however I couldn't edit any of them, not sure if it's due to permissions assigned to the account you've sent?

    Can you try applying below patch on your own:
    #1 Go to /wp-content/plugins/coursepress/upgrade/class-upgrade.php file and edit line 171, replace this code:
    wp_enqueue_script( 'coursepress_admin_upgrade_js', $script, array( 'jquery', 'backbone', 'underscore' ), self::$version, true );
    With this one:
    wp_enqueue_script( 'coursepress_admin_upgrade_js', $script, array( 'jquery', 'backbone', 'underscore' ), 1111, true );

    #2 Go to /wp-content/plugins/coursepress/upgrade/js/ folder and replace the existing admin-upgrade.js with the one attached below.

    #3 Probably not related, but edit your wp-config.php file and move define( 'WP_MEMORY_LIMIT', '256M' ); line so it's above /* That's all, stop editing! Happy blogging. */.
    There shouldn't be any custom code below /* That's all, stop editing! Happy blogging. */ line, except for the default WP ones.

    Now try to update your courses again and see if it works.

    Let us know how it goes.

    Best regards,
    Predrag

  • Ivan

    Hi Dean !

    It seems it happened because Background image for certificates is unavailable ( WP Dashboard -> CoursePress PRO -> Settings -> Basic Certificate -> Background image ) . I added the following code to {wordpress_folder}/wp-content/plugins/coursepress/2.0/include/coursepress/helper/class-pdf.php file via FTP

    if ( file_exists( $args['image'] ) ) {
    	$pdf->Image( $args['image'], 0, 0, 0, 0, '', '', '', true, 300, '', false, false, 0, false, false, true );
    }

    instead of this line (approximately 341st one)
    $pdf->Image( $args['image'], 0, 0, 0, 0, '', '', '', true, 300, '', false, false, 0, false, false, true );
    Then I could upgrade the CoursePress.

    But anyway please, change that image to real one.

    Best,
    Ivan.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.