Migrated Projects 10.1.2

Issues with Migrated Projects

I am experiencing several problems with projects migrated to Scriptcase.

The main issues are:

  • In Project Properties, I cannot load or select the themes.
  • In Grid applications, the option to automatically create a grid based on the existing Foreign Key (FK) relationships is not enabled.
  • The database tables and their FK relationships are correctly defined. The same functionality works correctly when creating a new project.
  • When creating a Form application, Scriptcase does not enable the automatic generation of the other related forms based on the existing FK relationships.

In summary, the database structure and FK relationships are correct. These features work correctly in a new project, but they do not work correctly in migrated projects.

Has anyone experienced the same issue with migrated projects? Is there a known solution or workaround?

This is becoming a significant problem because recreating the projects from scratch is not a practical solution.

My environment:

  • Database: SQL Server
  • Operating System: Windows 11
  • Scriptcase: 10.1.2
  • PHP: 8.2

@Chmolina , Looks much more like a migration problem in Scriptcase than a problem with your database or FK definitions.
If you check recent forum topics users who imported projects from Scriptcase 9.x into Scriptcase 10 reported that Project → Properties → Themes could remain stuck loading, with the existing project themes unavailable.

What you could try, make a backup of the migrated project first. Then, as a diagnostic, create a completely new project using exactly the same database connection.
If the new project can:

  • display the themes,
  • detect the FK relationships,
  • generate the related Grid/Form applications,

that gives you a very strong A/B test confirming that the database is not the problem.

Wish you all success.

@deepvyas @Chmolina,

The team responsible is currently investigating the issue where themes fail to load in the project properties. We will provide an update in this thread as soon as the fix is ​​released.

Regarding the other issues with the new grid and form options: did they occur after importing the project into v10, or simply after upgrading the existing environment from v9 to v10?

We look forward to your reply so we can proceed.

Best regards!

Technical Bug Report

ScriptCase 10.1.002 — Theme selector (multicombo) breaks on projects migrated from v9

JSON.parse receives HTML (“Unexpected token ‘<’”) due to Undefined array key “css_text_decoration”

Reported by: Cesar
Date: September 18, 2026
Component: Development IDE — Project Properties / Themes (Advanced Mode)
Severity: High — IDE functionality blocked (project themes cannot be managed)
Reproducibility: 100% (consistent) on projects migrated from SC 9.13

1. Executive summary

On projects migrated from ScriptCase 9.13 to 10.1.002, the project theme selector (multicombo) becomes unusable: when opened, the list appears empty with a permanent spinner. The cause is an AJAX response that returns HTTP 200 but with an HTML body instead of JSON, because the server emits Undefined array key "css_text_decoration" errors in the nmPageAppSchemaAdvanced.class.php class. ScriptCase’s own error handler injects <script>window.open('errorhandler.php')</script> blocks into the response, and the client runs JSON.parse() without any guard, throwing SyntaxError: Unexpected token '<'.

The error is consistent (12 occurrences per load) and independent of the theme content: re-saving a theme in the advanced editor does not change the result, which indicates it is a key read without a default value in the class code, not corrupt theme data.

2. Environment

Product ScriptCase 10.1.002 (build v10.01.0002)
Web server Apache (components\apache)
PHP PHP 8.2 (components\php)
Operating system Windows
Installation C:\Program Files\NetMake\v10.1
Relevant php.ini display_errors=Off · log_errors=On · error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
Project origin Migrated from ScriptCase 9.13 to 10.1.002
Sample project Acopio360 (legacy themes Sc9_SoftCloud, Sc9_SoftCloud_sm, Sc9_SoftCloud_sm_xxxxxx; default sys__NM__scriptcase)

3. Observed symptom

In the IDE, when opening Project → Properties → THEMES tab (or Design → Themes → Advanced Mode) and expanding the “Project Themes” combo:

  • The theme list appears empty (only the search box).
  • The loading spinner (.sc-theme-multicombo-loading) spins indefinitely.
  • The browser console shows the following error:
Uncaught SyntaxError: Unexpected token '<', "<script> w"... is not valid JSON
    at JSON.parse (<anonymous>)
    at Object.success (_sc_cache_sc_theme_multicombo_10.1.002.js?v=10.01.0002:489:40)
    at c (jquery.js:2:28447)
    at Object.fireWith [as resolveWith] (jquery.js:2:29192)
    at l (jquery.js:2:80176)
    at XMLHttpRequest.<anonymous> (jquery.js:2:82630)

4. Steps to reproduce

  1. Migrate a project from ScriptCase 9.13 to 10.1.002 (which carries over Sc9_* themes).
  2. Open the project in the development IDE.
  3. Menu → Project → Properties → THEMES tab.
  4. Click the “Project Themes” combo.
  5. Result: the list stays empty + infinite spinner; the console shows the SyntaxError.

5. Root cause analysis

5.1 Failure point on the client

The multicombo (generated file _sc_cache_sc_theme_multicombo_10.1.002.js), in the loadAjaxThemes function, processes the theme catalog response as follows (success callback, line 489):

javascript

success: function (retorno) {
    var arr_schemas = JSON.parse(retorno);   // <-- throws SyntaxError
    mergeThemeCatalog(arr_schemas);
},

There is no try/catch: any response that is not strict JSON breaks the load and leaves the combo empty with the spinner active.

5.2 The server response is not JSON

The endpoint POST /scriptcase/devel/iface/app_schema_advanced.php (the multicombo’s config.ajaxUrl) responds HTTP 200, but the body is HTML. Literal content captured from the response (summarized):

html

<script> window.open('/scriptcase/devel/iface/errorhandler.php', 'ERROR', ...); </script>
   ... (the <script> block repeats 12 times) ...
OK<img src="/scriptcase/devel/conf/scriptcase/img/" .../>&nbsp;&nbsp;
   ... (6 <img> with empty src) ...

The 12 <script> blocks correspond to 12 errors captured by ScriptCase’s error handler (errorhandler.php). Because this HTML is prepended, JSON.parse fails on the very first '<' character.

5.3 Actual error logged by ScriptCase

The file generated by the handler (wwwroot/scriptcase/tmp/error_<hash>.html) contains the underlying error:

ERROR
Undefined array key "css_text_decoration"
Script: C:\Program Files\NetMake\v10.1\wwwroot\scriptcase\devel\class\page\
        nmPageAppSchemaAdvanced.class.php  linha: 0

In PHP 8, accessing a nonexistent array key is an E_WARNING (“Undefined array key”). The nmPageAppSchemaAdvanced.class.php class reads the css_text_decoration key without checking for its existence or providing a default value. This project’s themes (a legacy set from v9) do not contain that key, so the warning fires repeatedly (12 times, once per style context processed).

5.4 Why this is a code bug and not corrupt data

  • The result is identical and consistent: always 12 <script> blocks + 6 <img>, on every load.
  • Re-saving a project theme in the Advanced CSS Editor (Advanced Mode → Save) did not change the error count. If it depended on theme data, the count would vary.
  • The GET endpoint for a single native theme (app_schema_advanced.php?str_modo=view&str_schema=sys__NM__scriptcase) returns valid data; only the POST that builds the catalog fails. This narrows the failure down to that code path.

6. Ruled-out hypotheses

  • Not display_errors: php.ini already has display_errors=Off and log_errors=On. The <script> does not come from PHP’s standard output, but from ScriptCase’s own error handler (errorhandler.php).
  • Not session expiration: the keepalive top.php?ajax=nm returns 200 and the catalog POST returns 200 (no 302, no redirect to login).
  • Not an fcgid timeout issue: response times are immediate; the failure is content-related, not time-related.

7. Impact

The “Project Themes” combo is unusable in the IDE for every migrated project that carries over themes lacking the css_text_decoration key. It is not possible to select, deselect, or change the project theme from that interface, nor to use the advanced Themes Mode in that context. The read-only themes in the “ScriptCase” group (e.g., Sc9_SoftCloud, Sc9_SoftCloud_sm) are not editable from the UI, so the user has no way to “add” the missing key to them.

8. Suggested fixes

8.1 Primary fix (server)

In nmPageAppSchemaAdvanced.class.php, harden the key read (and the other schema style keys) with safe access, for compatibility with v9-migrated themes that don’t carry it:

php

// Instead of:
$valor = $arr_estilo['css_text_decoration'];

// Use:
$valor = $arr_estilo['css_text_decoration'] ?? '';

8.2 Client robustness (recommended)

In _sc_cache_sc_theme_multicombo_*.js, wrap the JSON.parse in the success callback with a try/catch and finish the load in the catch, so that a non-JSON response does not leave the IDE hung:

javascript

success: function (retorno) {
    var arr_schemas;
    try {
        arr_schemas = JSON.parse(retorno);
    } catch (e) {
        finishThemeLoading();
        return;
    }
    mergeThemeCatalog(arr_schemas);
},

8.3 Encoding of migrated schemas (secondary)

During reproduction, a jQuery selector error also appeared, caused by latin1 encoding in migrated schema keys:

Uncaught Error: Syntax error, unrecognized expression:
  #div_prop_header__NM__sys__NM__cabe%E7alho

cabe%E7alho = “cabeçalho” with ç in latin1 (%E7). Schema keys should be normalized to UTF-8 when migrating from v9, to avoid invalid selectors.

9. Temporary workaround

Until the official fix exists, excluding E_WARNING (and E_NOTICE) from error_reporting in php.ini prevents ScriptCase’s handler from firing the <script> blocks over the undefined key, allowing the catalog to serialize and the combo to load. Requires restarting Apache. Downside: it silences warnings across the entire IDE, so it is a palliative, not a solution.

ini

error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_WARNING & ~E_NOTICE

10. Appendix — Evidence artifacts

  • Console stack trace with the SyntaxError (section 3).
  • Body of the app_schema_advanced.php POST response showing the 12 <script> + 6 <img> (section 5.2).
  • error_<hash>.html file generated in wwwroot/scriptcase/tmp/ with the Undefined array key "css_text_decoration" (section 5.3).
  • Path of the implicated script: devel/class/page/nmPageAppSchemaAdvanced.class.php.
  • Implicated client file: devel/lib/js/_sc_cache_sc_theme_multicombo_10.1.002.js (loadAjaxThemes function, line 489).

Title: FK auto-recognition on Grids requires the connection’s “Use schema before table name” = Yes (SC 10.1.002, SQL Server)

Environment: ScriptCase 10.1.002 · PHP 8.2 (Windows) · SQL Server (MS SQL NATIVE SRV / ODBC)

Sharing a finding in case it helps someone, and to confirm whether this is intended behavior.

What happens

Since SC 10.0.000 the Grid/Chart/Filter wizard has the new option “Create SELECT recognizing foreign keys and building JOINs automatically” (plus “Create applications related to the selected table”). On one project the checkbox works perfectly (detects relations, shows “New options available”, builds JOINs). On another project the checkbox does nothing, even though the tables clearly have foreign keys.

The actual cause — it’s not missing FKs and not a data cache issue. It’s the connection setting Edit Connection → Advanced → “Use schema before table name”:

Connection setting How tables look FK recognition
Use schema = Yes dbo.Customers, sales.Orders Works – FKs resolve, JOINs built
Use schema = No Customers, Orders Does not engage

In SQL Server, FKs in sys.foreign_keys are always schema-qualified. With “Use schema = No”, ScriptCase can’t map the schema-qualified referenced table to its unqualified table list, so it never builds the relationship.

Verify it yourself (Tools → SQL Console):

sql

SELECT COUNT(*) AS fks_db FROM sys.foreign_keys;
SELECT COUNT(*) AS fks_table FROM sys.foreign_keys
WHERE OBJECT_NAME(parent_object_id) = 'YourTable';

In my case: 58 FKs in the DB, 4 on the table, yet the checkbox stayed inert because that connection had Use schema = No. The other connection (Use schema = Yes) recognized everything.

Workaround: set Advanced → “Use schema before table name” = Yes, save, reopen the Grid wizard. :warning: It changes table references across the whole connection (dbo.Table); apps already generated with unqualified names may need regeneration — test in dev first.

Two extra notes: (1) duplicate column names from different referenced tables hang the wizard on “Analyzing SELECT command” with “Could not retrieve the fields” — give each lookup column a unique alias. (2) “Create related applications” on a hub table generates a Grid+Form for every relation (can be hundreds) — use selectively.

@Chmolina

The fix for the theme loading freeze was released in version 10.1.003, which is already available for download/update.

Best regards!