I have a main form with a subform.
The subform has two lookup fields.
The first lookup field is already populated and no problems there.
When I click on the magnifying glass of the second lookup field, my aim is to filter the list of possible entries presented to the user based on what is filled in, in the first lookup field.
To do so, when the magnifying glass of the second lookup field is clicked, the onclick code sets a hash cookie 'prodIdOnThisSfRow' as follows:-
Code: Select all
var prodIdOnThisSfRow = nuSubformRowObject(event.target.parentElement.id, 'first_lookup_id').val();
nuSetProperty('prodIdOnThisSfRow', prodIdOnThisSfRow);
console.log('prodIdOnThisSfRow: ', prodIdOnThisSfRow);
I say "my aim", but I previously had (and still have!) this working perfectly in an older code base (of nuBuilder 4.5).
The odd problem I am seeing is with a newer (Jan 2023) version of the codebase.
I don't know whether it has anything to do with the code base, but I cannot think of what else it could be.
With the working version, the onclick code is run when the magnifying glass of the second lookup field is clicked.
With the non-working version, nothing happens when the magnifying glass of the second lookup field is clicked. However, if I click on the *text* of the lookup field - the value that is populated from the database already - the onclick code is run (and fails - quite likely "event.target.parentElement.id" is not set up - but I am guessing).
FWIW, when the code runs, the following appears in the console (BTW, if I add a console.log() line before the other code, that output will appear before the error below) :-
nuform.js?ts=20230306020428:2172 Uncaught TypeError: Cannot read properties of undefined (reading 'slice')
at nuSubformRowNumber (nuform.js?ts=20230306020428
at nuSubformRowObject (nuform.js?ts=20230306020428
at HTMLInputElement.onclick (index.php:1:25)
I don't think that the above error info helps - the key question is: Why is the onclick code triggered by a different user action between the two systems?
The version I am having the issue with is this one:-
$ cat /var/www/html/80/version.txt
nuBuilder Forte 4.5
DB Version: V.4.5-2023.01.22.00
Files Version: V.4.5-2023.01.22.00
I guess I could move all my work to a newer version to see whether it helps, but I would like to eliminate all other possible causes of this issue before I start down that road. If I *have* to do that, I suppose I just back up the database to a single file using phpMyAdmin/mysqldump, git clone a new nuBuilder codebase in a new place using the latest from github, delete the database and restore it from the backup file, and then run the Database Upgrade tool in nuBuilder - is that correct?
Are there any known regressions that could cause this?
Or is there something I might have done myself, somehow...?
Thanks in advance for any help!