Can't create new reservation through api call ERROR $requiresApproval is deprecated
victoria-pr opened this issue · comments
I'm trying to make a POST request with this JSON:
{
"accessories": [
{
"accessoryId": 1,
"quantityRequested": 2
}
],
"customAttributes": [
{
"attributeId": 2,
"attributeValue": "some value"
}
],
"description": "reservation description",
"endDateTime": "2023-10-04T09:56:04+0000",
"invitees": [
1,
2,
3
],
"participants": [
1,
2
],
"participatingGuests": [
"participating.guest@email.com"
],
"invitedGuests": [
"invited.guest@email.com"
],
"recurrenceRule": {
"type": "none",
"interval": 3,
"monthlyType": "null",
"weekdays": [
0
],
"repeatTerminationDate": "2023-10-10T09:56:04+0000"
},
"resourceId": 1,
"resources": [
2,
3
],
"startDateTime": "2023-10-10T08:56:04+0000",
"title": "pruebaAPIreserva",
"userId": 1,
"startReminder": {
"value": 15,
"interval": "minutes"
},
"endReminder": null,
"allowParticipation": false,
"retryParameters": [
{
"name": "name",
"value": "value"
}
],
"termsAccepted": true,
}
AND this is the response:
Slim Application Error
The application could not run because of the following error:
Details
Code: 8192
Message: Creation of dynamic property ReservationControllerResult::$requiresApproval is deprecated
File: /var/www/html/WebServices/Controllers/ReservationSaveController.php
Line: 296
Trace
#0 /var/www/html/WebServices/Controllers/ReservationSaveController.php(296): Slim\Slim::handleErrors()
#1 /var/www/html/WebServices/Controllers/ReservationSaveController.php(80): ReservationControllerResult->__construct()
#2 /var/www/html/WebServices/ReservationWriteWebService.php(46): ReservationSaveController->Create()
#3 [internal function]: ReservationWriteWebService->Create()
#4 /var/www/html/lib/external/Slim/Router.php(200): call_user_func_array()
#5 /var/www/html/lib/external/Slim/Slim.php(1218): Slim\Router->dispatch()
#6 /var/www/html/lib/external/Slim/Middleware/Flash.php(86): Slim\Slim->call()
#7 /var/www/html/lib/external/Slim/Middleware/MethodOverride.php(94): Slim\Middleware\Flash->call()
#8 /var/www/html/lib/external/Slim/Middleware/PrettyExceptions.php(67): Slim\Middleware\MethodOverride->call()
#9 /var/www/html/lib/external/Slim/Slim.php(1167): Slim\Middleware\PrettyExceptions->call()
#10 /var/www/html/Web/Services/index.php(69): Slim\Slim->run()
#11 {main}
I have the same issue, im using php 8.2 and im using the image librebooking/librebooking:2.8.6.1
The attached patch is a hack only. It allowed me to use the API to add reservations. I'm using version 2.8.6
The attached patch is a hack only. It allowed me to use the API to add reservations. I'm using version 2.8.6
Couldn't find the 2.8.6 version but the thing is I'm struggling with this error now (thanks for replying anyway):
The application could not run because of the following error:
Details
Code: 2
Message: Undefined array key 1
File: /var/www/html/lib/Application/Attributes/AttributeService.php
Line: 178
I got a similar error with the SignOut endpoint:
Slim Application Error
The application could not run because of the following error:
Details
Code: 8192
Message: Creation of dynamic property RestResponse::$signedOut is deprecated
File: /var/www/html/WebServices/AuthenticationWebService.php
Line: 75
Trace
#0 /var/www/html/WebServices/AuthenticationWebService.php(75): Slim\Slim::handleErrors()
#1 [internal function]: AuthenticationWebService->SignOut()
#2 /var/www/html/lib/external/Slim/Router.php(200): call_user_func_array()
#3 /var/www/html/lib/external/Slim/Slim.php(1218): Slim\Router->dispatch()
#4 /var/www/html/lib/external/Slim/Middleware/Flash.php(86): Slim\Slim->call()
#5 /var/www/html/lib/external/Slim/Middleware/MethodOverride.php(94): Slim\Middleware\Flash->call()
#6 /var/www/html/lib/external/Slim/Middleware/PrettyExceptions.php(67): Slim\Middleware\MethodOverride->call()
#7 /var/www/html/lib/external/Slim/Slim.php(1167): Slim\Middleware\PrettyExceptions->call()
#8 /var/www/html/Web/Services/index.php(69): Slim\Slim->run()
#9 {main}
And this is my compose file: docker-compose.yml.txt
I am running into a similar error.
fd4c4e261bd5 ErrorException: Creation of dynamic property ResourceRequest::$bufferTime is deprecated in /var/www/html/lib/WebService/JsonRequest.php:17
fd4c4e261bd5 Stack trace:
fd4c4e261bd5 #0 /var/www/html/lib/WebService/JsonRequest.php(17): Slim\Slim::handleErrors()
fd4c4e261bd5 #1 /var/www/html/lib/WebService/JsonRequest.php(7): JsonRequest->Hydrate()
fd4c4e261bd5 #2 /var/www/html/WebServices/ResourcesWriteWebService.php(75): JsonRequest->__construct()
fd4c4e261bd5 #3 [internal function]: ResourcesWriteWebService->Update()
fd4c4e261bd5 #4 /var/www/html/lib/external/Slim/Router.php(200): call_user_func_array()
fd4c4e261bd5 #5 /var/www/html/lib/external/Slim/Slim.php(1218): Slim\Router->dispatch()
fd4c4e261bd5 #6 /var/www/html/lib/external/Slim/Middleware/Flash.php(86): Slim\Slim->call()
fd4c4e261bd5 #7 /var/www/html/lib/external/Slim/Middleware/MethodOverride.php(94): Slim\Middleware\Flash->call()
fd4c4e261bd5 #8 /var/www/html/lib/external/Slim/Middleware/PrettyExceptions.php(67): Slim\Middleware\MethodOverride->call()
fd4c4e261bd5 #9 /var/www/html/lib/external/Slim/Slim.php(1167): Slim\Middleware\PrettyExceptions->call()
fd4c4e261bd5 #10 /var/www/html/Web/Services/index.php(69): Slim\Slim->run()
fd4c4e261bd5 #11 {main}
Has anyone figured out the correct fix for this?
So I think this is a PHP 8.2 issue: https://www.php.net/releases/8.2/en.php#deprecate_dynamic_properties
So one example of fixing this is: #350
My issue was using the API to update a Resource:
ErrorException: Creation of dynamic property ResourceRequest::$bufferTime is deprecated in /var/www/html/lib/WebService/JsonRequest.php:17
I assume something similar needs to be done for the other reported issues.
@victoria-pr @yaliv Hopefully my PR will solve those issues: #354