Unable to edit/save CoursePress units.

In CoursePress admin, when I try to edit any course Units, or add new ones, they will not save at all. It says it has saved, but on refreshing the page, the units are no longer there.

Error log throws up the following:

PHP Warning: Invalid argument supplied for foreach() in /hermes/bosnacweb01/bosnacweb01af/b2531/ipw.pestnetw/public_html/stage/wp-content/plugins/coursepress/2.0/admin/controller/class-unit.php on line 383

  • Adam Czajczyk
    • Support Gorilla

    Hi Joseph

    I hope you're well today and thank you for your question!

    I checked your site and I can see the issue here and judging by the error message it's because the code in the lines indicated by error messages is getting empty variables (from the code executed earlier) where it should get arrays. This is a rare case and it might need deeper investigation but I'd like to ask you to start with one thing that might be related here.

    Could you please ask your host if you can (and if so how to do this? or maybe they could do this for you) change the

    allow_url_fopen

    PHP config value from current Off to On?

    Usually, adding a php.ini file or a line in .htaccess file helps but I tried that and it was only causing 500 error on server so it's possible that it requires help form the host (especially that I don't see any PHP configuration options in the hosting panel).

    Would you give it a go please? If that doesn't help, let me know and I'll include our developers in the case so we could investigate it further.

    Kind regards,
    Adam

  • Adam Czajczyk
    • Support Gorilla

    Hi Joseph

    Thank you for help with this and letting me know.

    I actually tried to changed that via php.ini but to no luck, that's why I asked you to ask host to do this. but maybe it was a matter of just waiting a bit more (sometimes it takes a couple of minutes to get changes applied).

    Anyway, it didn't help so while it seemed like related issue (by looking at the error and the plugin code) there needs to be something else into it. I've checked the site again but I admit I'm a bit stuck.

    That said, I've included our developers in the case and asked them to help us with the issue. I've passed all the information to them and they'll investigate it and I believe they'll be able to identify the problem and find a solution.

    Please keep track of this ticket and we'll update you here as soon as we get to know more.

    Kind regards,
    Adam

  • Adam Czajczyk
    • Support Gorilla

    Hi Joseph

    No, no, they did. The allow_url_fopen is set to On now. What I meant is only that I tried to set it that way via php.ini file and it didn't work for me - that is why I asked you to ask host. I'm sorry if I wasn't clear enough on this.

    To recap: unfortunately, tweaking this didn't help and even though I did some more tests on site and check couple more things, I wasn't able to find the culprit so I asked our developers for consultation and I'm awaiting their response. We'll be updating you here as we only find out more about the reason for the issue.

    Best regards,
    Adam

  • Panos
    • SLS

    Hi Joseph !

    It seems that your server doesn't support PUT method. You could ask your host if it is possible to allow PUT requests, if it is not possible you can replace file
    coursepress/2.0/asset/js/coursepress-unitsbuilder.js
    with the one attached here.

    The patch file uses :
    Backbone.emulateHTTP
    which will fake PUT (also DELETE and PATCH) with POST request.
    However I am not sure that this is going to be included in future versions, as it is something that hosts usually support, this is why I recommend asking your host about this.

    I have applied this patch on your staging site and seems to be saving units now. Could you check there and let us know f it works on your side too?

    Kind regards!

  • Joseph
    • Site Builder, Child of Zeus

    Here is what host said ...

    Thank you for being on hold. I checked with the specialists, they have given the confirmation that we don't support HTTP PUT (also DELETE and PATCH) with POST requests. If you wish to use this service, we would recommend you to upgrade your account to VPS.

  • Joseph
    • Site Builder, Child of Zeus

    I have purchased upgrade server so that it would accept PUT requests. I need to allow you access to server so you can make changes. The host says they cannot make these PUT changes for me. Where can i send you login info ?

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.