Page 1 of 2

Empty Form's list in new nuBuilder-4.8

Posted: Sun Jun 08, 2025 6:55 am
by miasoft
I have test new version (nuBuilder-4.8) - my Form's list is empty.
08.06.png

Re: Empty Form's list in new nuBuilder-4.8

Posted: Sun Jun 08, 2025 9:06 am
by kev1n
Hi,

1. Check that your forms are present in the database table zzzzsys_form.

2. Check nuDebug and the browser developer console for errors.

3. Inspect the generated SQL:
You can also add nuDebug($sql); before the line
nuCreateTableFromSelect('#TABLE_ID#', $sql);.

4. Which version did you upgrade from?

Re: Empty Form's list in new nuBuilder-4.8

Posted: Sun Jun 08, 2025 10:23 am
by miasoft
kev1n wrote: Sun Jun 08, 2025 9:06 am Hi,

1. Check that your forms are present in the database table zzzzsys_form.
All present
nuDebug message
08.06_1.png
3. Inspect the generated SQL:
You can also add nuDebug($sql); before the line
nuCreateTableFromSelect('#TABLE_ID#', $sql);.
4. Which version did you upgrade from?
nuBuilder Forte 4.7
DB Version: V.4.6-2025.05.09.00
Files Version: V.4.7-2025.05.09.00
(V.MajorVersion-CurrentDate.BuildNumber)

Re: Empty Form's list in new nuBuilder-4.8

Posted: Sun Jun 08, 2025 10:41 am
by kev1n
This error appears when using SELECT DISTINCT … ORDER BY X where X isn’t in the SELECT list: in newer MySQL versions (5.7+, 8.0+) with ONLY_FULL_GROUP_BY enabled, this is disallowed because ordering by a column not included in the result set alongside DISTINCT can yield unpredictable results, so the server throws error 3065—older versions or installations with that SQL mode disabled may not show it.

Try this fix:

Code: Select all

REPLACE INTO `zzzzsys_php` (`zzzzsys_php_id`, `sph_code`, `sph_description`, `sph_group`, `sph_php`, `sph_run`, `sph_zzzzsys_form_id`, `sph_system`, `sph_global`, `sph_demo`, `sph_template`, `sph_hide`, `sph_json`) VALUES ('nuform_BB', 'nuform_BB', 'System PHP', 'nubuilder', '// Temp table\r\n\r\n$denied = $GLOBALS[\'nuSetup\']->set_denied == 1;\r\n\r\n$condition = $denied\r\n ? \"(zzzzsys_form_id NOT LIKE \'nu%\' OR zzzzsys_form_id = \'nuuserhome\')\"\r\n : \"1=1\";\r\n\r\n$sql = \"\r\n SELECT *\r\n FROM zzzzsys_form\r\n WHERE $condition\r\n ORDER BY sfo_code\r\n\";\r\n\r\nnuCreateTableFromSelect(\'#TABLE_ID#\', $sql);\r\n\r\n\r\n// Group Filter\r\n\r\n\r\n$getDistinctGroupColumnQuery = function($column, $condition) {\r\n return \"\r\n SELECT \r\n DISTINCT TRIM(`$column`) AS trimmed_group\r\n FROM \r\n zzzzsys_form\r\n WHERE \r\n $condition AND (\r\n IFNULL(`$column`, \'\') <> \'\') \r\n ORDER BY \r\n trimmed_group\r\n \";\r\n};\r\n\r\n$sqlGroup = function($condition) use ($getDistinctGroupColumnQuery) {\r\n return $getDistinctGroupColumnQuery(\'sfo_group\', $condition);\r\n};\r\n\r\n$group = nuEncodeQueryRowResults($sqlGroup($condition), [], [\'\']);\r\n\r\n$filterJS = \"\r\n function getData(data) {\r\n return JSON.parse(atob(data));\r\n }\r\n function getGroup() {\r\n return getData(\'$group\');\r\n }\r\n\";\r\n\r\nnuAddJavaScript($filterJS);\r\n', '', '', '1', '0', '1', '0', '', NULL)

Re: Empty Form's list in new nuBuilder-4.8

Posted: Sun Jun 08, 2025 10:53 am
by miasoft
kev1n wrote: Sun Jun 08, 2025 10:41 am This error appears when using SELECT DISTINCT … ORDER BY X where X isn’t in the SELECT list: in newer MySQL versions (5.7+, 8.0+) with ONLY_FULL_GROUP_BY enabled, this is disallowed because ordering by a column not included in the result set alongside DISTINCT can yield unpredictable results, so the server throws error 3065—older versions or installations with that SQL mode disabled may not show it.

Try this fix:
thanks a lot, kev1n! Everything is working fine now!

Re: Empty Form's list in new nuBuilder-4.8

Posted: Mon Jun 09, 2025 9:06 am
by miasoft
I continued testing the new version and found a similar error in Objects->Input->InputType. The selection list is empty. I changed my.ini for my MySql- server :

Code: Select all

# mia sql-mode="ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"
sql-mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"
But it is unlikely to do this for an external host.:(

Re: Empty Form's list in new nuBuilder-4.8

Posted: Mon Jun 09, 2025 10:30 am
by kev1n
Hmm, the SQL under Objects → Input → InputType looks like this, which could be causing the issue:

Code: Select all

SELECT itm_value, itm_description 
FROM zzzzsys_item 
WHERE itm_object_id = '#OBJECT_ID#' AND itm_active = '1'
ORDER BY itm_description
Could you share the exact error message you're seeing?

Re: Empty Form's list in new nuBuilder-4.8

Posted: Mon Jun 09, 2025 11:12 am
by miasoft
kev1n wrote: Mon Jun 09, 2025 10:30 am Hmm, the SQL under Objects → Input → InputType looks like this, which could be causing the issue:

Code: Select all

SELECT itm_value, itm_description 
FROM zzzzsys_item 
WHERE itm_object_id = '#OBJECT_ID#' AND itm_active = '1'
ORDER BY itm_description
Could you share the exact error message you're seeing?
09.06.png
Error:

Re: Empty Form's list in new nuBuilder-4.8

Posted: Tue Jun 10, 2025 3:14 am
by kev1n
Run this update query:

Code: Select all

UPDATE `zzzzsys_php` SET `sph_php` = '// Temp table\n\n$denied = $GLOBALS[\'nuSetup\']->set_denied == 1;\n\n$condition = $denied\n    ? \"(zzzzsys_form_id NOT LIKE \'nu%\' OR zzzzsys_form_id = \'nuuserhome\')\"\n    : \"1=1\";\n\n$sql = \"\n    SELECT *\n    FROM zzzzsys_form\n    WHERE $condition\n    ORDER BY sfo_code\n\";\n\nnuCreateTableFromSelect(\'#TABLE_ID#\', $sql);\n\n\n// Group Filter\n\n\n$getDistinctGroupColumnQuery = function($column, $condition) {\n    return \"\n        SELECT \n          DISTINCT TRIM(`$column`)  AS trimmed_group\n        FROM \n          zzzzsys_form\n        WHERE \n          $condition AND (\n            IFNULL(`$column`, \'\') <> \'\') \n        ORDER BY \n          trimmed_group\n    \";\n};\n\n$sqlGroup = function($condition) use ($getDistinctGroupColumnQuery) {\n    return $getDistinctGroupColumnQuery(\'sfo_group\', $condition);\n};\n\n$group = nuEncodeQueryRowResults($sqlGroup($condition), [], [\'\']);\n\n$filterJS = \"\n    function getData(data) {\n        return JSON.parse(atob(data));\n    }\n    function getGroup() {\n        return getData(\'$group\');\n    }\n\";\n\nnuAddJavaScript($filterJS);' WHERE `zzzzsys_php`.`zzzzsys_php_id` = 'nuform_BB';

Re: Empty Form's list in new nuBuilder-4.8

Posted: Tue Jun 10, 2025 7:30 am
by miasoft
kev1n wrote: Tue Jun 10, 2025 3:14 am Run this update query:

Code: Select all

UPDATE `zzzzsys_php` SET `sph_php` = '// Temp table\n\n$denied = $GLOBALS[\'nuSetup\']->set_denied == 1;\n\n$condition = $denied\n    ? \"(zzzzsys_form_id NOT LIKE \'nu%\' OR zzzzsys_form_id = \'nuuserhome\')\"\n    : \"1=1\";\n\n$sql = \"\n    SELECT *\n    FROM zzzzsys_form\n    WHERE $condition\n    ORDER BY sfo_code\n\";\n\nnuCreateTableFromSelect(\'#TABLE_ID#\', $sql);\n\n\n// Group Filter\n\n\n$getDistinctGroupColumnQuery = function($column, $condition) {\n    return \"\n        SELECT \n          DISTINCT TRIM(`$column`)  AS trimmed_group\n        FROM \n          zzzzsys_form\n        WHERE \n          $condition AND (\n            IFNULL(`$column`, \'\') <> \'\') \n        ORDER BY \n          trimmed_group\n    \";\n};\n\n$sqlGroup = function($condition) use ($getDistinctGroupColumnQuery) {\n    return $getDistinctGroupColumnQuery(\'sfo_group\', $condition);\n};\n\n$group = nuEncodeQueryRowResults($sqlGroup($condition), [], [\'\']);\n\n$filterJS = \"\n    function getData(data) {\n        return JSON.parse(atob(data));\n    }\n    function getGroup() {\n        return getData(\'$group\');\n    }\n\";\n\nnuAddJavaScript($filterJS);' WHERE `zzzzsys_php`.`zzzzsys_php_id` = 'nuform_BB';
I tried it. There is no effect. I will continue to work with MySQL version 5.7.