Coursepress 'Hide related videos' flag option doesn't save

Using coursepress and editing modules. Changes to title save OK, but on the video module we want to set the 'Hide related videos' flag. It seems to change to ticked OK and save looks ok, but a refresh shows that it's still unticked. Our embedded youtube videos still have related videos at end.

We have a test site where we were grappling with this 'edits not saving issue' which seemed to apply to other changes, and then ALL the modules in that unit just disappeared. On recreating they now seem to be fully editable and behave as expected. Creating a new module in the live site unit however still doesn't save so can't just delete and recreate the modules. puzzled

Course in question is Conflict theory and practice, Series 1. Unit 1, section 1, two video modules, one has flag unset the other is set. Neither work as expected on front end as flag seems to be ignored and related videos are shown. On test site we've been able to set the flag and the same videos there behave as expected. When they're finished they don't show related video but the start screen.

Support access granted on site: https://www.communityresolve.com/

Intercom: https://app.intercom.io/a/apps/ug7di4vl/respond/inbox/unassigned/conversations/9371184621

  • Dimitris

    Hey there Eric Booth,

    hope you're doing good and thanks for reaching us! :slight_smile:

    I just tried to replicate this in a test environment with no avail, so this should be site/server specific.

    I noticed the following error in console while on edit units pages:
    POST https://rapi.getjaco.com/api/3.4/recording/init 429 (Too Many Requests)
    Could you please disable this integration and check if this continues?

    If so, please try to clear/purge all caches involving, like from plugins and server-side mechanisms, deactivate all other plugins apart from CoursePress, use a default theme like TwentySeventeen and try to edit again your units.
    If the issue resolves, activate them back one-by-one, checking each time if the edit units page saves successfully, until you get the conflicted combination once more. Here's a nice flow chart diagram that can help you with this conflict test: https://premium.wpmudev.org/wp-content/uploads/2015/09/Support-Process-Support-Process.gif

    If this still continues (or even prior to all previous steps), try to increase the default memory limit that WP uses (40M) by editing wp-config.php file and inserting the following line just above the /* That's all, stop editing! Happy blogging. */ comment
    define('WP_MEMORY_LIMIT', '128M');

    Hope that's some help, let us know here about your results!
    Take care,
    Dimitris

  • Eric Booth

    I don't think the getjaco error is relevant to this issue. That seems to be something to do with the GoDaddy hosting and I've opened an issue with them, but we also have the problem on our SiteGround hosted test site.

    I think there's an issue with how the data is saved to the underlying database. I've managed to sort things for now by manually changing the values of the 'hide_related_media' meta_key in the postmeta table for all the relevant post id modules. All videos are now playing normally and ending with the start screen rather than the tiles of YouTube suggestions.

    There seem to be three formats of values for this meta_key:
    - yes/no - which looks like it's used on old entries
    - 1 or blank - which is what works, and is on some but not all of more recent entries
    - a compound format of 'a:1:{i:0;i:1;}' or 'a:2:{i:0;i:0;i:1;i:1;}' which doesn't work.

    Setting all the 'hide_related_media' meta_key values to 1 has fixed problem. However new video modules will not maintain the 'Hide related media' tick box values entered.

    Needs further investigation by developer.

  • Adam Czajczyk

    Hello, Eric!

    You're finding of "different formats of values" made me think about that a bit more. I suppose that might require developer's intervention but before I get it to them I'd like to test it more on my end. Can you please tell me if you were using any "pre-2.x" version of CoursePress previously? I mean: did you upgrade at some point from CoursePress 1.x to CoursePress 2.x or didn't you use 1.x version ever?

    If you did use it, was the course in question created back then or was it created only after you updated to 2.x?

    Let me know please.

    Best regards,
    Adam

  • Eric Booth

    Just tested with a new course, new section, new video module, and all works as expected. Can tick and uptick the related video box with no problems.

    This leaves us with a course where adding video modules do not work as expected. We have students enrolled and progressing. We can bodge the flag directly in the database but it won't 'stick' if someone in the future tries to change.

    Steps to recreate (on established course)
    - create video module in either a new or existing unit, in either a new or existing section.
    - ensure 'Hide related video' is ticked
    - 'Save whole units' button. If you refresh whole page all is still OK
    - test at front end and all works as expected with no related video.
    - Change 'hide related video' to unticked, then save units.
    - test at front end and related videos are shown
    - Change 'hide related video' to ticked again, then save units.
    - All appears OK, but related videos are still shown on front end, AND when refreshing the browser page the related video is unticked.
    - Open WP database. Find _posts table and get number of the post with the name of the video module. Open the _postmeta table and list the meta_key 'hide_related_media' to show the one with the relevant post_id. This has value of something like a:2:{i:0;i:0;i:1:i:1;}. Change value to 1
    - test front end. no related video shown

    For now I'm happy with my work around but there's something going on here for these courses.

  • Predrag Dubajic

    Hi Eric,

    Thanks a lot for the details you provided, at first I was unable to replicate the issue on my installation but with your course imported to my installation I could see the issue.
    So I checked the difference between our courses and tried with two video modules added and then I was able to replicate the issue with my course as well.

    I have gathered all the information about this and created a bug report for our developers.

    We really appreciate the time you took to help with debugging this so I'm sending some thankyou points your way :slight_smile:

    Best regards,
    Predrag

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.