Closed Sandrokkan closed 1 year ago
This has probably something to do with the customform condition or with subbookings.
Could you try the following: First update to Booking 8.0.33 (https://github.com/Wunderbyte-GmbH/moodle-mod_booking/releases/tag/v8.0.33) - go to the option where the problem occurs and click "Edit booking option" => Under "Availability conditions" check if there is a custom form condition. If so: Remove the checkbox. Also under "Subbookings" remove any subbookings if there are any. Now save the booking option. => Does the problem still occur?
One more thing, please also remove any "Booking policy" in your Booking instance settings for testing.
I followed all your instructions but the problem persists
This is how it should behave: https://github.com/Wunderbyte-GmbH/moodle-mod_booking/assets/78346453/3509149a-63ff-4b72-b3a1-65fdfb3de3b3
Does the problem occur with other booking options too?
By clicking on the buttons, the warnings do not disappear. Yes, I also encountered the problem with other booking options
What do you mean by warnings?
The button that says "do you really want to book " and the button "Do you really want to be removed from this booking option?"
Could you provide the following information:
I use Chrome I cleared the cache I entered the boost mail theme the problem persists
@georgmaisser Could you please have a look at this?
One more thing: Which version of local_wunderbyte_table do you use?
1.6.9 2023081100
I just tried the exact same setup (booking 2023083000 & wunderbyte_table 2023081100) and normal booking works fine.
Do you have any settings in the booking option which could lead to this error?
Do you try booking with a student, a teacher or an admin user?
I didn't set any particular settings
when you know the Chrome dev tools, you can look at the network panel. Once you click on the "do you really want to book"-button, you will see that there is a call going out like this: http://10.111.0.2:8000/lib/ajax/service.php?sesskey=y69JrJFl2M&info=mod_booking_bookit
When you look at the response, there might be an error. You might need to turn on the debug messages on your system, to really get a meaningful message. Can you send this error message?
Can you turn on debug information? and execute this request?
website administration -> development -> debugging Please set the first select to "Developer" and check "show debug messages"
I see no errors
The error message says "Invalid json in request" => so what we need to find out is what about the JSON is invalid. Could you post it here?
After the second click (the one which doesn't work) go to DevTools > Network > click on the mod_booking_bookit webservice call > go to "Payload" > Request payload > Right click on the top node > Copy value
Please also copy the full response JSON (under the "response" tab).
Unfortunately I'm not a developer and don't know where to go. Could you make me some screenshots?
[ { "error": false, "data": { "status": 0, "message": "notallowedtobook", "template": "mod_booking\/bookit_button", "json": "[{\"data\":{\"itemid\":10,\"area\":\"option\",\"userid\":2,\"dataaction\":\"\",\"nojs\":false,\"main\":{\"label\":\"Click again to confirm booking\",\"class\":\"btn btn-warning w-100 text-center\",\"role\":\"button\"},\"fullwidth\":true,\"componentname\":\"mod_booking\"}}]" } } ]
I hope I copied the information you need
This is the correct respons after the first click. As "error" is false, we see that it worked correctly. Now we need to see the response after the second click.
[ { "error": true, "exception": { "message": "Eccezione - str_replace(): Argument #2 ($replace) must be of type string when argument #1 ($search) is a string", "errorcode": "generalexceptionmessage", "link": "https:\/\/seclabstaging.sec-lab.com\/moodle\/mod\/booking\/view.php?id=157", "moreinfourl": "https:\/\/docs.moodle.org\/402\/it_wp\/error\/moodle\/generalexceptionmessage" } } ]
I added a fix in wunderbyte table which might be responsible for this error. Could you install wunderbyte table 1.7.0 and test it?
https://github.com/Wunderbyte-GmbH/moodle-local_wunderbyte_table/releases/tag
Unfortunately the problem persists
Please go to https://seclabstaging.sec-lab.com/moodle/admin/environment.php
Is your Moodle version really 4.1? Which PHP version do you use?
Sorry I was wrong the version is 4.2 PHP 8
The problem is most probably PHP 8 which produces the exception with str_replace. If in any way possible please use PHP 7.4 until we have fixed that.
Moodle 4.2 might also be problematic. So if it's possible for you, please use the newest version of 4.1 currently.
I confirm that with Moodle 4.1 everything works correctly. Sorry for my inaccuracy
We'll try to fix it for 4.2 soon. I'll close this for now.
By clicking on the booking confirmation or cancellation confirmation buttons, the button does not update automatically but only after updating the page
Moodle 4.1 Theme Moove Booking 8.0.32 2023083000