Last week I updated my nuBuilder4-database from the version of may 2019 to newest version.
In this new version a nuProcedure started in BeforeBrowse-routine of a browse-form doesn't run.
Because af that, I created a very small php-procedure with only a nuDebug()-line. I tested with this one and I don't see anything in the logging.
Conclusion: I seems a problem with nuProcedure
Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
Problem with nuProcedure in new version
-
- Posts: 35
- Joined: Sat Jun 09, 2018 4:36 pm
- Location: Netherlands
- Has thanked: 5 times
- Been thanked: 1 time
- Contact:
Problem with nuProcedure in new version
You do not have the required permissions to view the files attached to this post.
-
- nuBuilder Team
- Posts: 4416
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 74 times
- Been thanked: 472 times
- Contact:
Re: Problem with nuProcedure in new version
The function was changed with that commit
https://github.com/steven-copley/nubuil ... daaaee6043
but the function no longer works as described here:
https://wiki.nubuilder.cloud/ ... uProcedure
Fix: Undo that change in nucommon.php:
Replace this function
wtih this
https://github.com/steven-copley/nubuil ... daaaee6043
but the function no longer works as described here:
https://wiki.nubuilder.cloud/ ... uProcedure
Fix: Undo that change in nucommon.php:
Replace this function
Code: Select all
function nuProcedure($c){
$s = "SELECT * FROM zzzzsys_php WHERE sph_code = ? ";
$t = nuRunQuery($s, [$c]);
$r = db_fetch_object($t);
$php = nuReplaceHashVariables($r->sph_php);
$php = "$php \n\n//--Added by nuProcedure()\n\n$"."_POST['nuProcedureEval'] = '';";
$_POST['nuProcedureEval'] = "Procedure <b>$r->sph_code</b> - run inside ";
return '';//$php;
}
Code: Select all
function nuProcedure($c){
$s = "SELECT * FROM zzzzsys_php WHERE sph_code = ? ";
$t = nuRunQuery($s, [$c]);
$r = db_fetch_object($t);
$php = nuReplaceHashVariables($r->sph_php);
$php = "$php \n\n//--Added by nuProcedure()\n\n$"."_POST['nuProcedureEval'] = '';";
$_POST['nuProcedureEval'] = "Procedure <b>$r->sph_code</b> - run inside ";
return $php;
}
-
- nuBuilder Team
- Posts: 4416
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 74 times
- Been thanked: 472 times
- Contact:
Re: Problem with nuProcedure in new version
Background information for admin: It was changed after I had posted this: https://forums.nubuilder.cloud/viewtopic. ... ure#p19620
But now the function always returns an empty string. It should only return an empty string if the Procedure does not exist.
I think nuProcedure() should look like this:
But now the function always returns an empty string. It should only return an empty string if the Procedure does not exist.
I think nuProcedure() should look like this:
Code: Select all
function nuProcedure($c){
$s = "SELECT * FROM zzzzsys_php WHERE sph_code = ? ";
$t = nuRunQuery($s, [$c]);
if (db_num_rows($t) > 0) { // procedure exists
$r = db_fetch_object($t);
$php = nuReplaceHashVariables($r->sph_php);
$php = "$php \n\n//--Added by nuProcedure()\n\n$"."_POST['nuProcedureEval'] = '';";
$_POST['nuProcedureEval'] = "Procedure <b>$r->sph_code</b> - run inside ";
return $php;
} else
{
return '';
}
}
Last edited by kev1n on Thu Feb 06, 2020 9:08 pm, edited 1 time in total.
-
- Posts: 35
- Joined: Sat Jun 09, 2018 4:36 pm
- Location: Netherlands
- Has thanked: 5 times
- Been thanked: 1 time
- Contact:
Re: Problem with nuProcedure in new version
Thank you for reply!
I tested with old code -> result is OK
I also tested your advice admin -> result is OK.
I tested with old code -> result is OK

I also tested your advice admin -> result is OK.

-
- nuBuilder Team
- Posts: 4416
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 74 times
- Been thanked: 472 times
- Contact:
Re: Problem with nuProcedure in new version
Thanks for testing. Added this issue to my bug list:Jannie wrote:Thank you for reply!
I tested with old code -> result is OK![]()
I also tested your advice admin -> result is OK.
https://github.com/smalos/nuBuilder4-Bu ... ocedure.md
Re: Problem with nuProcedure in new version
kev1n,
I have added your changes to Github, thanks.
Please test it.
Steven
I have added your changes to Github, thanks.
Please test it.
Steven
-
- nuBuilder Team
- Posts: 4416
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 74 times
- Been thanked: 472 times
- Contact: