Coursepress - Missing modules after saving unit

We are currently working on 3 courses. The course with the problem is the course with ID 23. The unit named 'Social Media' is only showing two pages. It should have the following:

Social Media Overview
Facebook
Pinterest
LinkedIn
Google+

I've looked in the WP database and I can see the 'missing' posts in there. They have the correct parent ID (36) and I can't see any other reason that they aren't displaying under the relevant unit.

We had this happen a few months ago and in that case the parent IDs had been set to '0'. This time it's obviously a different problem. I have granted support access via the WPMUDev dashboard.

Gary

  • Rupok

    Hi Gary

    I hope you had a wonderful day.

    Thanks for granting Support Access. I just went to the course and unit you mentioned and found 2 pages showing inside the dashboard but there should be 4, right? So I'm confirming the issue is there in your site.

    I just searched in our forums but didn't find anyone else complaining that unit pages are gone while having correct parent ID in database, and I tried to regenerate this issue in my live test site, I could not generate this either. So this is new and it could be your site specific issue but we will try to find the exact reason.

    However, as I don't have access to your database, I can't actually see the current scenario and can't say what's going on. Can you export related tables from your database and send to us so we can have a look, analyze, make some tests and fix the problem? I'm contacting our developer regarding this and I believe he can give us some valuable insight on this. I'll let you know as soon as I get anything back from him.

    Have a nice day. Cheers!
    Rupok

  • Rupok

    Hi teckyhead

    I talked with our developer and this is what I got from him:
    "Known workaround is to turn off the visual editor, but its not ideal… I’m working on this as a priority for CoursePress 2.0 at the moment, so will push to CP1.x as soon as its done".

    I believe, the update will come very soon. So either you can wait until the update comes, or you can upload the dump of related database tables in any common file sharing service like Dropbox, Copy etc and then share the link through our secure contact form here so that I can check : https://premium.wpmudev.org/contact/

    Select "I have a different question" for your topic. This and the subject line ensure that it gets assigned to me.

    Subject: "Attn: Rupok"
    - WordPress admin Username
    - WordPress admin Password
    - Login URL
    - Link back to this thread for reference
    - Any other relevant URLs

    Have a nice day. Cheers!
    Rupok

  • teckyhead

    Hi Rupok,

    Some additional info for the developer. The error that is being generated is this one:

    [20-Jan-2016 22:49:30 UTC] PHP Warning: preg_match(): Unknown modifier 'p' in /public_html/training/wp-content/plugins/coursepress/coursepress.php on line 5383

    I was seeing it on some of the coursepress admin pages. This type of error can be caused by issues with the regex delimiters so, as a test, I temporarily changed the delimiters in the regex string on line 5382 to '~' (regex delimiters can be any non-alph character other than space and backslash). After the change the error then changed to this, and only when selecting a course to edit:

    [20-Jan-2016 22:54:50 UTC] PHP Notice: Undefined index: 24_2 in /public_html/training/wp-content/plugins/coursepress/includes/admin-pages/courses-details-overview.php on line 658
    [20-Jan-2016 22:54:50 UTC] PHP Notice: Undefined index: 24_3 in /public_html/training/wp-content/plugins/coursepress/includes/admin-pages/courses-details-overview.php on line 658
    [20-Jan-2016 22:54:50 UTC] PHP Notice: Undefined index: 24_4 in /public_html/training/wp-content/plugins/coursepress/includes/admin-pages/courses-details-overview.php on line 658
    [20-Jan-2016 22:54:50 UTC] PHP Notice: Undefined index: 24_5 in /public_html/training/wp-content/plugins/coursepress/includes/admin-pages/courses-details-overview.php on line 658
    [20-Jan-2016 22:54:50 UTC] PHP Notice: Undefined index: 24_6 in /public_html/training/wp-content/plugins/coursepress/includes/admin-pages/courses-details-overview.php on line 658
    [20-Jan-2016 22:54:50 UTC] PHP Notice: Undefined index: 36_2 in /public_html/training/wp-content/plugins/coursepress/includes/admin-pages/courses-details-overview.php on line 658
    [20-Jan-2016 22:54:50 UTC] PHP Notice: Undefined index: 40_2 in /public_html/training/wp-content/plugins/coursepress/includes/admin-pages/courses-details-overview.php on line 658
    [20-Jan-2016 22:54:50 UTC] PHP Notice: Undefined index: 40_3 in /public_html/training/wp-content/plugins/coursepress/includes/admin-pages/courses-details-overview.php on line 658
    [20-Jan-2016 22:54:50 UTC] PHP Notice: Undefined index: 40_4 in /public_html/training/wp-content/plugins/coursepress/includes/admin-pages/courses-details-overview.php on line 658
    [20-Jan-2016 22:54:50 UTC] PHP Notice: Undefined index: 40_5 in /public_html/training/wp-content/plugins/coursepress/includes/admin-pages/courses-details-overview.php on line 658

    Gary

  • Rupok

    Hi teckyhead

    As our developer said "I’m working on this as a priority for CoursePress 2.0 at the moment", I believe he will release an update really soon. Our developers have to deal with lots of critical issues and other things, so it usually takes a bit longer but this time, our developers assured me that this is a priority so chances are really high that the fix will come soon. I can't provide any ETA though.

    Have a nice day. Cheers!
    Rupok

  • teckyhead

    Hi Rupok,

    I believe I found the cause of this issue. In coursepress/includes/functions.php there are two lines of code - lines 1007 and 1009. The second line is commented out:

    $pages_num = count( get_post_meta( $unit_id, 'page_title', true ) );

    // $pages_num = get_post_meta( $module_id, 'module_page', true );

    I uncommented that second line and my missing modules re-appeared. I could see from the code that the first line looks for unit pages based on a page title being present. I checked the titles on the missing pages and found that they had empty 'Page Label' fields. I filled in those titles and then re-commented out that second line... and my modules were still there.

    With this in mind the plugin needs to either validate the 'Page Label' field and require it to be present or a code change needs to be made so that the unit lookup isn't reliant on the page title ('Page Label' field) being present.

    Regards,

    Gary

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.