Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

[Fixed] Subform broken in v4.5

Questions related to using nuBuilder Forte.
Post Reply
apmuthu
Posts: 249
Joined: Sun Dec 06, 2020 6:50 am
Location: Chennai, India, Singapore

[Fixed] Subform broken in v4.5

Unread post 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.
You do not have the required permissions to view the files attached to this post.
Last edited by apmuthu on Mon Jan 18, 2021 1:14 pm, edited 1 time in total.
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 447 times
Contact:

Re: Subform broken in v4.5

Unread post 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.
apmuthu
Posts: 249
Joined: Sun Dec 06, 2020 6:50 am
Location: Chennai, India, Singapore

Re: Subform broken in v4.5

Unread post 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.
apmuthu
Posts: 249
Joined: Sun Dec 06, 2020 6:50 am
Location: Chennai, India, Singapore

Re: Subform broken in v4.5

Unread post 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
You do not have the required permissions to view the files attached to this post.
apmuthu
Posts: 249
Joined: Sun Dec 06, 2020 6:50 am
Location: Chennai, India, Singapore

Re: [Fixed] Subform broken in v4.5

Unread post by apmuthu »

It now stands fixed and works for subform lookups too.
You do not have the required permissions to view the files attached to this post.
apmuthu
Posts: 249
Joined: Sun Dec 06, 2020 6:50 am
Location: Chennai, India, Singapore

Re: [Fixed] Subform broken in v4.5

Unread post 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.
admin
Site Admin
Posts: 2815
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: [Fixed] Subform broken in v4.5

Unread post by admin »

Sourceforge is up-to-date and includes all fixes.
Post Reply