[SOLVED] ERROR Scriptcase PHP 8.1

Create a new grid without modifying any of the code and when confirming the search the same thing happens:

Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array

Dear, @afpsistemas , @Kleyber_Derick , @Nico

the errors below have already been fixed.
The fix will be available in version 9.8.001.

  1. Fatal error: TypeError not caught: in_array(): Argument #2 ($haystack) must be of type array

  2. A non-numeric value found
    E:\NetMake\v1\wwwroot\scriptcase\devel\generator\nm_gp_consulta_prep.php 668

1 Like

Thank you very much for the information.
I have version 9.8.000 (69) and it tells me that it is updated, how do I get version 9.8.01?

We will be incrementing the version. It will update normally by scriptcase update, when it displays the message to update the version.

Version: 9.8.001

1 Like

Download and install 9.8 for php 7.3 to a new folder.
Ran scriptcase update to version 9.8.000 (69)
Created backup from current version 9.7.23 and tried import. This failed with message invalid not from sc9
I then exported 1 project and imported to new version. Import went well and I am able to edit applications.
When generating sources code the system generates about half way and then just stays on generating without increasing and no timeout.
I tried to compile separate applications and found that Calendar and forms don’t want to compile.
I am sure that they are working on the problems and this is just for feedback

I found error with a simple grid with no custom code.
When I add a condition on a field I get a fatal error

I try on other tables and it appears the SQL builder has bugs
I report on the free support but this is a thankless task - please show logs, screenshot everything etc etc just a delay whilst bug fixes are sorted.

Updated to latest version:
Still error on SQL Builder

Fatal error: Uncaught Error: Call to undefined function get_magic_quotes_gpc() in C:\Program Files\NetMake\v9-php81\wwwroot\scriptcase\devel\compat\base.php:216 Stack trace: #0 C:\Program Files\NetMake\v9-php81\wwwroot\scriptcase\devel\compat\nm_isql.php(566): nm_escape_string(‘Viv L’) #1 C:\Program Files\NetMake\v9-php81\wwwroot\scriptcase\devel\compat\nm_isql.php(2): sg_load(‘68ABBE04C7C5024…’) #2 {main} thrown in C:\Program Files\NetMake\v9-php81\wwwroot\scriptcase\devel\compat\base.php on line 216

1 Like

there we go,
thanks guys for testing, i think i will migratie to 9.8 in 1-2 years , while paying for the updates :slight_smile:

Can you afford that? We can’t. I simply NEED to go to 8.x after 7.4 is end-of-life. Many companies will simply not accept eol PHP. The university I work for certainly will not accept.

But this behavior is not uncommon to SC, as I always have had issues for months after a new big release came out. I hope they will be able to fix the issues in that period of time. Personally, I have no issues with SC as I’m not using it anymore. But my university has a lot of code and needs to decide what will come next…

I have been using SC since version 5, and it has always been the same. Pfff, when will they learn?

Paying for updates that don’t work for two years :stuck_out_tongue:

1 Like

Hi @aducom ,
I agree with the problems with SC.
But why the need to go to a version, in this case PHP 8.x, just because eol is near. Should’nt the criteria be… the system(SC or something else) is stable before one jumps on it.
My clients were on PHP 5.6 until dec last year. Only this year I switched to PHP 7.4.
Don’t get me wrong… eventually I do want to get to 8.x, but not until I am absolutely sure everything is fine with the SC version.
I will be just asking for a boatload of pain if I convert to SC 9.8 rightaway. I do not want it to be my loss if their PHP 8.x version is not stable. I will just stick with SC 9.7 for now.
It will be SC’s loss if I or many folks don’t switch to SC 9.8 as new customers will be skeptical if the existing user base is not happy with it.
But I do want SC to succeed with this release(PHP 8.x) eventually. It is a fine PHP tool. The sooner they stabilize it and take care of the problems the better for everyone.

2 Likes

the problem with php versions i found is that your dev should be also on the same version as production, otherwise you get all kinds of surprises. SC does not support that , you cannot set a php version in the dev, and basically we need a new dev installation for php8, next to the current php7. other dev products (eg phpstorm) do support multiple versions of php in one dev. i wonder why sc never thought of it? it seems it was always a bumpy road with php versions for decades. basically any big tech started on php and they all are gone.

I think the best approach is to stay with SC9.8 php7.3 on dev and deploy to php8.1 in production.
This works.
The issues are not with generated code but with SC compiler which does not work well with PHP8 yet.
Generated code runs on PHP8 with no problem.

Interesting option. Are there requirements to stay on dev 7.3 while upgrading? Because if you don’t then the applications will not run on 8.1 at all.

Dear,

@afpsistemas, @Nico

Version 9.8.001 released. Available for download or update.

Corrections reported in the changelog

Acabo de probarlo y ya no tenemos el error, gracias !

Thank you kind Sir. Will update, test and give feedback

Did the upgrade and working much better now. There is a speed increase in generation as well.
The version number does not show 9.8.001
image

1 Like

Dear, @Nico

There was an issue with one of our update servers, but the issue has now been resolved.

You can run the scriptcase update and the version will be incremented to version 9.8.001.

NOTE: The error only occurred in the PHP 8.1 environment

I tried this (deploy from 9.8/ 7.3 dev to 8.1 prod) and my startup app immediately gives the error:

Fatal error: During inheritance of Iterator: Uncaught ArgumentCountError: Too few arguments to function scriptcase_error_handler(), 4 passed in /var/www/html/_lib/prod/third/adodb/adodb-iterator.inc.php on line 24 and exactly 5 expected in /var/www/html/startup/startup_erro.php:6 Stack trace: #0 /var/www/html/_lib/prod/third/adodb/adodb-iterator.inc.php(24): scriptcase_error_handler(8192, 'Return type of ...', '/var/www/html/_...', 47) #1 /var/www/html/_lib/prod/third/adodb/adodb.inc.php(2905): include_once('/var/www/html/_...') #2 /var/www/html/startup/startup.php(682): include_once('/var/www/html/_...') #3 /var/www/html/startup/startup.php(1598): startup_ini->init() #4 /var/www/html/startup/startup.php(2399): startup_apl->controle() #5 /var/www/html/startup/index.php(2): include_once('/var/www/html/s...') #6 {main} in /var/www/html/_lib/prod/third/adodb/adodb-iterator.inc.php on line 24

Totally discouraging and looks like a compatibility problem right at generated code which cannot be altered.

I just converted to php v8. while testing my application i received - Fatal error : Uncaught TypeError: Unsupported operand types: float - string in /opt/NetMake/v9-php81/wwwroot/scriptcase/app/anthony_carson_marbethdist/form_standard_order/form_standard_order_apl.php:7430. it looks like it was while performing a calculation using fields in my from from my table. it looks like the code is {order_amt} = ({price}*{order_qty} - {product_discount}); the fields in {} are form fields from my order details table. i tried googling but have not found a solution. if it is the {} being used to reference the form fields - what is the workaround to reference form fields from a table? Can any one assist?