Moving Text modules moves the Section Breaks after upgrade to Version 2

After upgrading Courspress from version 1 to 2 the Section Break module is not in the backend, however, the modules are still showing on the front. Changing positions of text modules on the course is changing the position of the Section Breaks also on the front. And the positions are changing differently. Sometimes it moves to the top of one module and sometimes it moves to another.

  • Katya Tsihotska
    • Support & QA

    Hi Genevieve

    Hope you had a great day!

    Since this is a bit advanced query, I’m going to need to ping our SLS team (code experts ) and get their valuable feedback on this.

    But for the investigation, they will require FTP credentials and WordPress admin login details. You can send us your details through our contact form https://premium.wpmudev.org/contact/#i-have-a-different-question using this template:

    Subject: “Attn: Katya Tsihotska”

    -WordPress admin username

    -WordPress admin password

    -login URL

    -FTP credentials (host/username/password)

    -link back to this thread for reference

    -any other relevant URLs

    Please use this subject line to ensure that it gets assigned to me :slight_smile:

    Take care and have a nice weekend!

    Cheers, Katya

  • Ivan
    • Developer

    Hi Genevieve !

    It seems grant access to your site was expired.

    If you provide me with additional login credentials, I can look into it more.

    https://premium.wpmudev.org/contact/#i-have-a-different-question

    Please visit our private Contact page and complete the form with the following information:

    Subject: “Attn: Ivan Svyrskyi”

    In the Message box, please provide the following:

    link back to this thread for reference

    any other relevant urls

    Admin login:

    Admin username

    Admin password

    Login url

    Note: Don’t send any credentials via this forum because it’s public forum.

    Best,

    Ivan.

  • Ivan
    • Developer

    Hi Genevieve !

    I could replicate this issue on my side. So, it seems CoursePress 2.x doesn’t provide the Break Sections.

    You could try adding the following snippet in a MU plugin for deleting all Break Sections from Units ( more info about MU plugins is here )

    <?php
    function wpmu_coursepress_delete_section_breaks() {
    global $wpdb;
    $ids = $wpdb->get_col( "SELECT DISTINCT post_id FROM {$wpdb->postmeta} WHERE meta_key='module_type' AND meta_value='section_break_module'" );
    foreach ( $ids as $id ) {
    wp_delete_post( $id, true );
    }
    }
    add_action( 'init', 'wpmu_coursepress_delete_section_breaks' );

    After adding this MU plugin – update any page on your site and remove this MU plugin – it should delete all Break Sections.

    If you need a similar view instead of old Break Sections – you can customize it via CSS-styles.

    Best,

    Ivan.

  • Katya Tsihotska
    • Support & QA

    Hi Genevieve

    Hope you don’t mind if I’ll jump in.

    To create mu-plugin you will need to do the following:

    1. Connect to your site via FTP

    2. Go to /wp-content/mu-plugins folder. If the mu-plugins folder doesn’t exist, then you’d need to create it.

    3. Create a .php file inside of that folder, you can name it says remove-break-sections.php

    4. Paste there the code provided by Ivan and then follow the instructions from the previous reply

    After adding this MU plugin – update any page on your site and remove this MU plugin – it should delete all Break Sections.

    If you need a similar view instead of old Break Sections – you can customize it via CSS-styles.

    Kind regards,

    Katya

  • Ivan
    • Developer

    Hi Genevieve !

    Could you explain it more how it didn’t work? Do you still see these Break Sections or something else?

    It seems grant access to your site was expired.

    If you provide me with additional login credentials, I can look into it more.

    https://premium.wpmudev.org/contact/#i-have-a-different-question

    Please visit our private Contact page and complete the form with the following information:

    Subject: “Attn: Ivan Svyrskyi”

    In the Message box, please provide the following:

    – link back to this thread for reference

    – any other relevant urls

    – Admin login:

    Admin username

    Admin password

    Login url

    Note: Don’t send any credentials via this forum because it’s public forum.

    Best,

    Ivan.

  • Ivan
    • Developer

    Hi Genevieve !

    Could you tell me where can I see the Break Section on your courses? You have a lot of ones with many units, I can’t check each of them. Please, tell me the name of the course and names of the Units between which you see the Break Section.

    Best,

    Ivan.

  • Ivan
    • Developer

    Hi Genevieve !

    I removed the Break Sections on your site. If you have the same issue on another site – you can use my previous MU plugin but please, change the fourth line there to

    $ids = $wpdb->get_col( "SELECT DISTINCT post_id FROM {$wpdb->postmeta} WHERE meta_key='module_type' AND meta_value='section'" );

    Best,

    Ivan.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.