[SOLVED] Calendar SC 9.9.015 (188)

The calendar only works with the month view.
As soon as you go to the week view or day view and want to enter a new appointment, the following error message appears


Fatal error: Uncaught TypeError: mktime(): Argument #3 ($second) must be of type ?int, string given in D:\Programme\NetMake\v9-php81\wwwroot\scriptcase\app\BlueOrganizer_9_9_015\calendar_CalendarData\calendar_CalendarData_apl.php:16046 Stack trace: #0 D:\Programme\NetMake\v9-php81\wwwroot\scriptcase\app\BlueOrganizer_9_9_015\calendar_CalendarData\calendar_CalendarData_apl.php(16046): mktime(‘08’, ‘30’, ‘00 02’, ‘07’, ‘19’, ‘2023’) #1 D:\Programme\NetMake\v9-php81\wwwroot\scriptcase\app\BlueOrganizer_9_9_015\calendar_CalendarData\calendar_CalendarData_apl.php(11264): calendar_CalendarData_apl->calendarInitTimestamp() #2 D:\Programme\NetMake\v9-php81\wwwroot\scriptcase\app\BlueOrganizer_9_9_015\calendar_CalendarData\calendar_CalendarData_apl.php(2663): calendar_CalendarData_apl->nm_acessa_banco() #3 D:\Programme\NetMake\v9-php81\wwwroot\scriptcase\app\BlueOrganizer_9_9_015\calendar_CalendarData\calendar_CalendarData.php(3814): calendar_CalendarData_apl->controle() #4 {main} thrown in D:\Programme\NetMake\v9-php81\wwwroot\scriptcase\app\BlueOrganizer_9_9_015\calendar_CalendarData\calendar_CalendarData_apl.php on line 16046

Dear @salvatore,

After performing some initial tests in different PHP environments and versions, the issue did not appear when inserting events from “Week” and “Day” modes.

Could you give us more details of your calendar application, please? Time format being used, if it contains codes in the application’s events, if the application was created from a new table in the creation interface itself, etc.

So that we can narrow down the problem, could you perform a test by creating a new calendar application with a new table, please?

We are waiting for your feedback so that we can continue.

Best regards!

It worked in the last version of 9.9.014.

This is the table


–Table: CalendarData

–DROP TABLE IF EXISTS CalendarData;

CREATE TABLE CalendarData (
CalendarDataID int AUTO_INCREMENT NOT NULL,
CompanyID int,
CreatedBy varchar(255),
ChangedBy varchar(255),
CalendarDataGroupID int,
CalendarDataCategoryID int,
CalendarDataCategoryColorID int,
EmployeeProfileID int,
ContactID int,
DrivingStudentLicenseID int,
InvoiceID int,
DrivingLessonStartLocationID int,
start date date,
StartTime time,
AutoEnd int,
end date,
EndTime time,
quantity decimal(10,2),
Lunch break decimal(10,2),
text,
VehicleID int,
Title varchar(255),
Description varchar(255),
ID_API varchar(255),
ID_Event_Google varchar(255),
Event_Color varchar(255),
Reminder varchar(255),
Period varchar(20),
Recurrence varchar(20),
Recurrence_Info varchar(255),
Creator varchar(255),
CalendarDataEventStateID int,
SignatureImage longblob,
/* Key */
PRIMARY KEY (CalendarDataID)
) ENGINE = InnoDB;


On top of this table I created a new untouched Calendar ap. Without any events or anything else. The error can easily be reproduced by switching from the monthly view (default) to the weekly view after starting the app. If I then click on the calendar to enter a new appointment, the error appears, if I do this in the month view, then the error not appears. I also access this table via a form app, which is configured 1 to 1 like the calendar app. but since it’s a form, I don’t get an error message. I don’t think they can’t reproduce the bug. Send me your test table and test app and I’ll run it on my system to see if it works.

By the way, even with your examples, if I install them, the error occurs!

Fatal error: Uncaught TypeError: mktime(): Argument #3 ($second) must be of type ?int, string given in D:\Programme\NetMake\v9-php81\wwwroot\scriptcase\app\samples\calendar01\calendar01_apl.php:6726 Stack trace: #0 D:\Programme\NetMake\v9-php81\wwwroot\scriptcase\app\samples\calendar01\calendar01_apl.php(6726): mktime(‘11’, ‘20’, ‘00 02’, ‘07’, ‘18’, ‘2023’) #1 D:\Programme\NetMake\v9-php81\wwwroot\scriptcase\app\samples\calendar01\calendar01_apl.php(4228): calendar01_apl->calendarInitTimestamp() #2 D:\Programme\NetMake\v9-php81\wwwroot\scriptcase\app*samples\calendar01\calendar01_apl.php*(1339): calendar01_apl->nm_acessa_banco() #3 D:\Programme\NetMake\v9-php81\wwwroot\scriptcase\app*samples\calendar01\index.php(2562):* calendar01_apl->controle() #4 D:\Programme\NetMake\v9-php81\wwwroot\scriptcase\app\samples\calendar01\calendar01.php(2): include_once(‘D:\Programme\Ne…’) #5 {main} thrown in D:\Programme\NetMake\v9-php81\wwwroot\scriptcase\app\samples\calendar01\calendar01_apl.php on line 6726

If I open an existing event, then it works!

By the way, even with your examples, if I install them, the error occurs!

Thank you for submitting more information.

It is possible that this error is a particularity that occurs in your environment, because even performing tests using the table you sent and also in the “Samples” project, no error occurs. Attached is a short video simulating the insertion of events using day and week mode in the calendar01 application of the “Samples” project.
calendar_samples

The table that we initially tested was a table created from the “Create table” option that is in the “Table” field when creating the Calendar application.

If possible, perform a parallel installation of scriptcase, and in this new installation, import Samples again or create a new blank project to create a new Calendar application.

Also, when you can give us feedback again, please send a screenshot of the event inclusion form before the error pops.

Thanks again for your collaboration and we are here to try to find a solution.

1 Like

Hello Danilo,

I have now reinstalled the system with Windows 11.
Installed ScriptCase 9.9.013 and installed the calendar apps from the “Samples” and it works.

Then I reinstalled the system again with Windows 11.
Installed ScriptCase 9.9.014 and installed the calendar apps from the “Samples” and it works.

Then I installed the system a third time with Windows 11. Installed ScriptCase 9.9.015 and installed the calendar apps from the “Samples” and it doesn’t work. The error reoccurs.

So the quintessence of this is that it is due to version 9.9.015, so nobody can fool me!

1 Like

Dear @salvatore,

Indeed, it is a strange behavior that occurs in your environment.

We would like to ask that, if possible, you contact us at bugs@scriptcase.net, requesting an appointment for remote access, so that our support can further investigate this issue. In the body of the email, you can mention the discussion that is already open here in the forum, so that our team is aware of what has already been done to try to solve the problem.

We are here to help you find a solution and thank you for your cooperation.

We will be waiting for your feedback.

Best regards!

2 Likes

I too have this exact same problem and behaviour after upgrading a project to 9.9.015.

Has anyone got a solution to this problem yet?

From Salvatore’s error dump the mktime function is attempting to build a time and date field. The problem is arising because the third element, which represents seconds, is showing as ‘00 02’ and is determined as a string because of the space and not the integer it requires. I’m working my way through the PHP file on my system, which also throws errors for new events on Day and Week views but not on Month view, to attempt to find where the variable sc_cal_click_time is being created.

Dear @chrysalisbsl,

Just as I passed the instruction to salvatore, I also ask that you follow the same and contact our support so that this error is analyzed.

We are here to find a solution, regardless of whether the problem is general or particular to some environments.

Best regards!

1 Like

Hello,
I was on vacation and I was very happy that there were already 2 updates regarding my calendar problem. Unfortunately, the disappointment was also very big when I tested it and there was no change in relation to it, too bad.

I was asked which PHP version I have installed. It is currently version 8.1.6

Dear @salvatore,

Were you able to schedule a remote access with Scriptcase support so that the problem could be analyzed?

If not, please contact us, and if this is not possible, send your application so that we can analyze its behavior.

Best regards!

How can I contact you?

@chrysalisbsl,

Have you already received or worked out a solution, or is the problem still open for you?

I’m still stuck on version 9.9.014

I still have the problem I’m afraid.

I went as far as doing a complete reinstall of my MacBook Pro, clean installation of the latest version of Scriptcase and I still get the problem when trying to create a new event from week view.

Support said that if I remove the Category field, which I need, it would work. Not on my installation it doesn’t.

i have the same problem but its seems that support doint care or dont know how to fix it
i have a new fresh instalation on a shared server where there are supose to works but exacly the same proble is. And i want to say i have la latest version 9.9.019

I have the same problem and the same answer for tecnichal support, We works in the problem or We don’t have reply the problem.

The best option is manual modify el error, seek the folder of calendar and open the name of app calendar with _apl

Seek:

$iInit = mktime($aTime[0], $aTime[1], $aTime[2], $aDate[1], $aDate[2], $aDate[0]);

and replace:

$iInit = mktime($aTime[0], $aTime[1], 0, $aDate[1], $aDate[2], $aDate[0]);

The problem are de seconds, replace the real value for 0 and work

Hello everybody!

The problem has been reported to the development team, who will be analyzing it and correcting it as soon as possible.

We appreciate everyone’s understanding and are committed to correcting the issue as quickly as possible.

Best regards!

1 Like

Hello,

Version 9.9.020 does not solve the problem yet!
The error still exists