Page 1 of 1

[Fixed] Subform broken in v4.5

Posted: Mon Jan 18, 2021 4:21 am
by apmuthu
Tested with PHP v5.4 after all long array and compound php statement fixes. Others can test with later versions of PHP too.
SubForm_Broken_in_v4.5_C285.gif
The object of investigation is the JS code of the nuobject record in the zzzzsys_form table.
A comparison between the v4.5 Commit 285 and the v4.5 released in Sourceforge on 2021-01-16 shows no difference.
A comparison between v4.0 with all fixes that works and the v4.5 shows a lot of differences even after suppressing all whitespace and blank line differences.

To study and rectify the non functionality, the attachments are provided. Comparison in a tool like WinMerge would aid in the study of differences.
form_nuobject.zip
The use of the !== operator in JS is acceptable.

Re: Subform broken in v4.5

Posted: Mon Jan 18, 2021 5:48 am
by kev1n
The title is misleading, it's just the Scroll List that is broken.
Check Discord, this was fixed after you had reported there.

Re: Subform broken in v4.5

Posted: Mon Jan 18, 2021 8:29 am
by apmuthu
Since the last commit to v4.5 was #285 and the fix was not there, I thought you missed it. Will check dev/discord, test and revert.

Re: Subform broken in v4.5

Posted: Mon Jan 18, 2021 12:40 pm
by apmuthu
After #285 commit, the following will need to be executed in the DB:

Code: Select all

INSERT 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_hide`) VALUES
('nu5bad6cb32dcbcb4_AB', 'nu5bad6cb32dcbcb4_AB', 'System PHP', 'nubuilder', '\n$s  = \"\n        SELECT * \n        FROM zzzzsys_form\n        WHERE zzzzsys_form_id = \'#LOOKUP_RECORD_ID#\'\n        \n        \";\n\n$t  = nuRunQuery($s);\n$r  = db_fetch_object($t);\n\nnuSetFormValue(\'sob_lookup_table\', $r->sfo_table);\n', NULL, NULL, '1', '0', NULL),
('nu5bad6cb32c9102c_AB', 'nu5bad6cb32c9102c_AB', 'System PHP', 'nubuilder', '$s  = \"\n        SELECT * \n        FROM zzzzsys_form\n        WHERE zzzzsys_form_id = \'#LOOKUP_RECORD_ID#\'\n        \n        \";\n\n$t  = nuRunQuery($s);\n$c = db_num_rows($t);\nif ($c == 1) {$r  = db_fetch_object($t); }\n\n\nnuSetFormValue(\'sob_subform_table\', $c == 1 ? $r->sfo_table: \'\');', '', '', '1', '0', '');
and the nubuilder4.sql populated accordingly.
nubuilder4.zip
Direct lookup seems to work now.

Make sure that the following present:
sob_lookup_AB.png

Re: [Fixed] Subform broken in v4.5

Posted: Mon Jan 18, 2021 1:16 pm
by apmuthu
It now stands fixed and works for subform lookups too.

Re: [Fixed] Subform broken in v4.5

Posted: Thu Jan 21, 2021 10:46 am
by apmuthu
For those who have downloaded and used v4.5 released on 2021-01-16, the SQL stated in this post should be run and for new installations using it, the said sql should be appended to / included in nubuilder4.sql.

Re: [Fixed] Subform broken in v4.5

Posted: Thu Jan 21, 2021 11:52 pm
by admin
Sourceforge is up-to-date and includes all fixes.