[CoursePress Pro] Unable to save units in Coursepress Pro

When trying to edit units in an existing and published course, I'm getting error messages, and units will not save. I have tried many times over many days.

The following messages appear when I click the [Save whole units] button: "Unit is saving now."

Then about 30 seconds later at the top of the page I see:

"Connection lost. Saving has been disabled until you’re reconnected."

"We’re backing up this post in your browser, just in case."

Then back down near the button about a minute later, I get:

"Something went wrong. Unit was not saved!"

I have debug set to TRUE since June 12 and see various errors in the log. Today have enabled support access, but please be aware this is my PRODUCTION ENVIRONMENT with many students active. Please advise the best way to send a txt file of the log.

  • viobru
    • Recruit

    Hi, Wendy!

    Hope you’re doing great :slight_smile:

    I’m sorry to hear that you’re having issues with our plugin.

    Please note that this issue might be caused by various reasons; it uses to be related to having too strict WP memory limit, but it can be also caused for some unexpected theme/plugin conflict or for some issues with server configuration.

    I checked it and on your site, the memory is set to 40 and max memory to 512. Please edit the wp-config.php file and add the following lines on it (please make sure that you have a COMPLETE and UPDATED BACKUP of the site before applying any change):

    define('WP_MEMORY_LIMIT', '2000M');
    define(‘WP_MAX_MEMORY_LIMIT’, ‘3000M’);

    If these rules are already added, please change the values so they match the above. Keep in mind to insert these lines above the /* That’s all, stop editing! Happy blogging. */ line.

    Regarding the debug log file, you can share it by attaching the .txt file of it directly to this ticket.

    Apart from that, this error could also be related to a general WordPress error which happens when you lost internet connection or when WordPress is having troubles with saving posts/pages/custom post types. Usually, tweaking AutoSave Interval helps to solve this issue. In order to increase autosave interval, try to add the following code to your wp-config.php file:

    define( 'AUTOSAVE_INTERVAL', 160 );

    Please let us know if the issue is still there after applying these changes.

    If none of these suggestions solves the issue, you may need to run a plugin/theme conflict test on the site to discard this to be caused by a conflict, but running it will cause some features of the site to stop working while running it, so you might prefer to create a staging site to test this on it instead. You can find information about how to run a conflict test here (please, make sure you have an updated backup of your site before running the conflict test): https://premium.wpmudev.org/docs/getting-started/getting-support/#chapter-2

    Kind regards,

    Violeta

  • Wendy
    • Design Lord, Child of Thor

    Hi there, Violeta,

    Thank you for your response. I’m trying the fixes suggested, one by one, and see if the problems are fixed.

    Increasing the memory size allowed me to save changes to the order of the units, which was giving me the same errors. It hasn’t allowed me to save changes to the bigger units – one unit in particular has 5 pages. Trying to Save Whole Units in that unit gives me the same errors.

    I’ll now edit the autosave interval you mentioned, and report back.

    Your help is much appreciated.

  • Wendy
    • Design Lord, Child of Thor

    Hi again,

    I’ve now also set the Autosave interval to 160 in wp-config.php as suggested, and still have some of the errors mentioned above, when saving any units, large or small in any of our courses.

    “Unit is saving now.” message always appears

    Then about 2 minutes later at the top of the page sometimes I get:

    “Connection lost. Saving has been disabled until you’re reconnected.”

    “We’re backing up this post in your browser, just in case.” and sometimes not.

    Then back down near the button about a minute later, I get:

    “Something went wrong. Unit was not saved!”

    I’ve also noticed that in the ‘Course Setup’ section, under Course Details – Course Structure, the list of units includes many, many ‘Untitled module’ lines. I can’t find any untitled modules in the course, and the ones UN-checked as ‘ Show title in unit view’ don’t match the locations of untitled modules in the list.

    I have no idea if this is related to the other errors, but thought I should add it here in case you are aware of the two being connected.

    Meanwhile I’ll go to staging and see if I can duplicate these errors, and if so, I’ll check for plugin conflicts.

    Thanks.

  • Wendy
    • Design Lord, Child of Thor

    Hi Kasia,

    Sorry, I got sidetracked doing more testing on three of my courses. It seems I can save my smaller course, (Mental Wellbeing) but not the two larger courses (Prof. Boundaries, and Ethical Decision Making) Here is the very latest debug.log file.

    I have opened access to the site today. Please keep in mind that it’s a production site.

    Thanks,

    Nikki

  • Kasia Swiderska
    • Support nomad

    Hello Wendy,

    In debug.log there are only notices that should not be preventing units from saving – but I have asked developer for his opinion and he is checking your debug.log.

    Does this issue shows also on staging site? If possible can we get access to staging to troubleshoot it more?

    kind regards,

    Kasia

  • Wendy
    • Design Lord, Child of Thor

    Hi Kasia.

    I have granted support access to our staging site, since the problems are happening there also.

    It’s not happening every time with both sites, but works in the Prof Boundaries course on the Unit 1 sometimes on each site, but never on other units in both sites. I have tried withdrawing 2 test students, since that course has over 50 students, but even with 48 the same errors are occurring.

    Staging: http://davaarprofess.staging.wpengine.com/

    Thank you.

  • Kasia Swiderska
    • Support nomad

    Hello Wendy,

    It looks like a memory limit issue, however limits on your site are more than enough.

    I have disabled all the other plugins and then I was able to save problematic units without any errors. Then after enabling plugins errors started occurring again as soon there was more the 4 plugins enabled at once. But I enabled different plugins and made more tests and it is not depending on one plugin, but their amount.

    I have tested also your course on my site and there was no issues of this type at all.

    I will need to show this to developer, so they can take a closer look on this.

    Can you send us your details using our contact form https://premium.wpmudev.org/contact/#i-have-a-different-question and the template below:

    Subject: “Attn: Kasia Swiderska

    – Site login URL

    – WordPress admin username

    – WordPress admin password

    – FTP credentials (host/username/password)

    – Folder path to site in question

    – Link back to this thread for reference

    – Any other relevant urls/info

    Note: Don’t leave your login details in this ticket.

    IMPORTANT: Please make sure you select “I have a different question” for your topic, so it doesn’t go back to the forums – this and the subject line ensure that it gets assigned to me.

    Please confirm here that you send those credentials

    kind regards,

    Kasia

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.