Update OS Service Booking for PHP 8

  • Ronny Proft
  • Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 7 months ago - 1 year 6 months ago #153704 by Ronny Proft
Update OS Service Booking for PHP 8 was created by Ronny Proft
Dear Mr. Dam,

I tried the current version of OS Service Booking 2.19.0 with PHP 8.1.10, but once I tried to enter service order manually in OS Service Booking backend I get this error.

Fatal Error at line 67 of /libraries/osgcalendar/src/Google/Utils.php

Code:
[color=var(--highlight-keyword)]public static function [/color][color=var(--highlight-default)]getStrLen[/color][color=var(--highlight-keyword)]([/color][color=var(--highlight-default)]$str[/color][color=var(--highlight-keyword)])[/color]
Code:
[color=var(--highlight-keyword)]  {[/color]
Code:
[color=var(--highlight-keyword)]    [/color][color=var(--highlight-default)]$strlenVar [/color][color=var(--highlight-keyword)]= [/color][color=var(--highlight-default)]strlen[/color][color=var(--highlight-keyword)]([/color][color=var(--highlight-default)]$str[/color][color=var(--highlight-keyword)]);[/color]
Code:
[color=var(--highlight-keyword)]    [/color][color=var(--highlight-default)]$d [/color][color=var(--highlight-keyword)]= [/color][color=var(--highlight-default)]$ret [/color][color=var(--highlight-keyword)]= [/color][color=var(--highlight-default)]0[/color][color=var(--highlight-keyword)];[/color]
Code:
[color=var(--highlight-keyword)]    for ([/color][color=var(--highlight-default)]$count [/color][color=var(--highlight-keyword)]= [/color][color=var(--highlight-default)]0[/color][color=var(--highlight-keyword)]; [/color][color=var(--highlight-default)]$count [/color][color=var(--highlight-keyword)]< [/color][color=var(--highlight-default)]$strlenVar[/color][color=var(--highlight-keyword)]; ++ [/color][color=var(--highlight-default)]$count[/color][color=var(--highlight-keyword)]) {[/color]
Code:
[color=var(--highlight-keyword)]    [b]  [/b][/color][b][color=var(--highlight-default)]$ordinalValue [/color][color=var(--highlight-keyword)]= [/color][color=var(--highlight-default)]ord[/color][color=var(--highlight-keyword)]([/color][color=var(--highlight-default)]$str[/color][color=var(--highlight-keyword)]{[/color][color=var(--highlight-default)]$ret[/color][color=var(--highlight-keyword)]});[/color][/b]

Please provide some information about next steps to make OS Service Booking ready for PHP 8. Thank you so much.

Best regards,
Ronny
Last edit: 1 year 6 months ago by Ronny Proft.

Please Log in or Create an account to join the conversation.

More
1 year 7 months ago #153707 by Mr. Dam
Replied by Mr. Dam on topic Update OS Service Booking for PHP 8
Hi Ronny,
This issue will be fixed in next OS Services Booking version (Released soon)
Thanks
Dam

Please Log in or Create an account to join the conversation.

  • Facundo Esteban Palermo
  • Offline
  • New Member
  • New Member
More
1 year 6 months ago - 1 year 6 months ago #154047 by Facundo Esteban Palermo
Replied by Facundo Esteban Palermo on topic Update OS Service Booking for PHP 8
Hi Dam.
I am in the process of moving to php, 8.1
I found a types problem. must add (int)

components/com_osservicesbooking/helpers/calendar.php
lines 718 and 722if((int) $configClass > 0)
{
$disable_time_after = $realtime + (int)$configClass*24*3600;
}
if((int) $configClass > 0)
{
$disable_time_after = $realtime + (int)$configClass*24*3600;
}
Attachments:
Last edit: 1 year 6 months ago by Facundo Esteban Palermo.

Please Log in or Create an account to join the conversation.

More
1 year 6 months ago #154048 by Mr. Dam
Replied by Mr. Dam on topic Update OS Service Booking for PHP 8
Hi Facundo,
it should be:
if((int) $configClass > 0)
{
$disable_time_after = $realtime + (int)$configClass*24*3600;
}
if((int) $configClass > 0)
{
$disable_time_after = $realtime + (int)$configClass*24*3600;
}

Thanks
Dam

Please Log in or Create an account to join the conversation.

More
1 year 6 months ago #154049 by Mr. Dam
Replied by Mr. Dam on topic Update OS Service Booking for PHP 8
That issue is fixed, it will be included in next OS Services Booking version.
Thanks
Dam

Please Log in or Create an account to join the conversation.

  • Facundo Esteban Palermo
  • Offline
  • New Member
  • New Member
More
1 year 5 months ago #154433 by Facundo Esteban Palermo
Replied by Facundo Esteban Palermo on topic Update OS Service Booking for PHP 8
Hi Dam.
admin/classes/service.php line 705 requiere (int) in
Code:
$row->service_total = (int)$row->service_length + (int)$row->service_before + (int)$row->service_after;

or it will throw error 'string + int' exception when saving a new created service.

osservicesbooking 2.19.2
php 8.1.6

Please Log in or Create an account to join the conversation.

More
1 year 5 months ago #154436 by Mr. Dam
Replied by Mr. Dam on topic Update OS Service Booking for PHP 8
Hi Facundo,
OK, i will update it for future releases, but actually, the service time-length is required field.
Thanks
Dam

Please Log in or Create an account to join the conversation.

  • Facundo Esteban Palermo
  • Offline
  • New Member
  • New Member
More
1 year 5 months ago #154437 by Facundo Esteban Palermo
Replied by Facundo Esteban Palermo on topic Update OS Service Booking for PHP 8
but it does not validate that it is required (neither by js or php). If you hit save, the exception is thrown.

Please Log in or Create an account to join the conversation.

Moderators: Mr. Dam