Save Grid not working (Giving a modal error on 'apply')

I’ve just come back to this feature, having switched it of (as unusable) a few years ago.

When I add a saved grid to my toolbar and press ‘save’ it works as expected. However, when you try and apply said saved grid I just get a modal window popping up showing a lot of (unrendered) HTML that is effectively giving the helpful error message ‘Error’.

Any idea what I’m missing here?

PS… it also happens if I use the persistent state option, but this time on the save!sve_error

I’ve also noticed that when this error occurs, it effectively screws up the sort buttons at the tops of the columns. Giving the same error.

I can simulate the fault by simply clicking on apply to any save. It gives the error and then the sorts don’t work, with the same error. If I logout and in again then the sorts work OK so it is definately the apply save causing the problem.

It is true on previous V9 versions as well… I’d just switched ‘save’ off on the older version and am testing it in the latest release

Dear @ibatey,

When we carried out some tests applying the “Save grid” feature, the grid state went to what had previously been saved normally. Tests were performed on the latest version of Scriptcase (9.10.018(5)).

I noticed that the charset you use in the application is ISO-8859-1. We carried out tests both on it and on UTF-8.

Is there any other detail that you can share with us, so that we can try to simulate the possible error?

Best regards!

Cant really tell you much, but here is what I can:

  • It happens on all grids I’ve tried it on, so not related to a specific grid
  • I’m using PHP8.1 with the latest Scriptcase (Installed 2 days ago and upgraded since)
  • The fact it also screws up the column sorts must be indicative of something
  • I don’t recall this specific problem previously, when I did some testing on an earlier version but I don’t have a workable copy of that version to test it. Though I did replicate the fault on an old version when I upgraded the PHP to 8.1 (Without recompiling/generating)
  • It happens on the development environment AND the deployed version.
  • The save persistent state gives a similar problem (Save, not apply)
  • I can create a fresh grid in the new version (With no WHERE clauses) and the save grid functionality seems to work OK. Its the imported grids (Which all have slightly complex sql) that have a problem

Regards

Been performing some further digging to try and find the error.
I managed to get an error message by right clicking the Apply button and open in new window. This gives the following message:


It looks like the SQL is truncated.
It should be:
SELECT
Actions_Key,
Ref,
Project,
Workstream,
ActionHeader,
Assigned,
Due,
Status,
Date_Closed,
Cat1,
Comments,
Notes,
dateRaised,
event_color
FROM
Actions
WHERE [SQLPrep] AND ([GridfilterAct])
Order by Due
For the record, the SQL_Prep variable is 'Project=‘TEST1234567890123456’ANDWorkstream IN (‘default’,‘xxxxxx’)’ (taken from the data in session functionality)

Using debug mode, the sql on normal operation shows:

(pdo-mysql): select count(*) from Actions where (Project='TEST1234567890123456' AND Workstream IN ('default','xxxxxx') AND (1=1))

Final bit of info…
I also get an array error when opening ‘apply’ in a new window… the grid appears with incorrect contents so it might be the array error messing up the SQL:
Warning: Undefined array key 1 in C:\Program Files\NetMake\v9-php81\wwwroot\scriptcase\app\IDMB_Project_System\grid_actions1\grid_actions1_save_grid.php on line 479 Warning: Undefined array key 1 in C:\Program Files\NetMake\v9-php81\wwwroot\scriptcase\app\IDMB_Project_System\grid_actions1\grid_actions1_save_grid.php on line 488 Warning: Undefined array key 2 in C:\Program Files\NetMake\v9-php81\wwwroot\scriptcase\app\IDMB_Project_System\grid_actions1\grid_actions1_save_grid.php on line 488 Warning: Undefined array key 2 in C:\Program Files\NetMake\v9-php81\wwwroot\scriptcase\app\IDMB_Project_System\grid_actions1\grid_actions1_save_grid.php on line 488

I’ve performed lots of tests on a new grid created using the latest version and using the same sql table with the same SQL select statements. This seems to work fine.
HOWEVER, this is NOT a valid resolution for my problem as I have dozens of grids that would take me weeks to rebuild and test from scratch.

Further to these tests, using a grid that previously failed… if I remove the filter option from the save grid, then I do not get an error any more. However, if I use the refined search, then the error reappears

It looks like the parsing of the filter is causing the problem somewhere.