Page 1 of 1

Admin cannot edit forms

Posted: Sun May 18, 2025 11:58 am
by hf2094
Hello,
since V.4.7-2025.05.16.00 editing forms as globeadmin give the following debug-message.
Missing alias in FROM clause ?
Regard
Hf

Code: Select all

[0] : ===PDO MESSAGE===

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'f.zzzzsys_form_id' in 'WHERE'

===SQL===========

        SELECT 
          DISTINCT TRIM(`sfo_group`) 
        FROM 
          zzzzsys_form
        WHERE 
          (f.zzzzsys_form_id NOT LIKE 'nu%' OR f.zzzzsys_form_id = 'nuuserhome') AND (
            IFNULL(`sfo_group`, '') <> '') 
        ORDER BY 
          `sfo_group`
    
===BACK TRACE====
/srv/http/grodt4/core/nudatabase.php - line 473 (nuRunQuery)
/srv/http/grodt4/core/nucommon.php(1530) : eval()'d code - line 40 (nuEncodeQueryRowResults)
/srv/http/grodt4/core/nucommon.php - line 1530 (eval)
/srv/http/grodt4/core/nucommon.php - line 1579 (nuEvalSafe)
/srv/http/grodt4/core/nuform.php - line 26 (nuEval)
/srv/http/grodt4/core/nuform.php - line 1124 (nuBeforeBrowse)
/srv/http/grodt4/core/nuform.php - line 447 (nuBrowseColumns)
/srv/http/grodt4/core/nuform.php - line 165 (nuGetFormFinalize)
/srv/http/grodt4/core/nuapi.php - line 96 (nuGetFormObject)

Re: Admin cannot edit forms

Posted: Sun May 18, 2025 8:51 pm
by kev1n
Hi,

I'm not entirely sure why the error is occurring on your end — I haven't been able to reproduce it myself. You might want to try running the query below (e.g., in phpMyAdmin) to see if the issue persists.

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`) \r\n FROM \r\n zzzzsys_form\r\n WHERE \r\n $condition AND (\r\n IFNULL(`$column`, \'\') <> \'\') \r\n ORDER BY \r\n `$column`\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: Admin cannot edit forms

Posted: Thu May 22, 2025 3:47 pm
by hf2094
Thank you,
editing foms as Admin work now on my system.

Regards
Hf