Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

nuDebug() secret output?

Post Reply
clinterman
Posts: 24
Joined: Thu Apr 05, 2012 7:53 am

nuDebug() secret output?

Unread post by clinterman »

I have a form which holds a table called store_review. It has 2 fields
- ID autoincrement
- STORE_ID implemented as a lookup to another table (STORE)

I left ID-field of the form because it will be pre-populated with dbGetUniqueID, which is not numeric. So my current form only holds the lookupfield. When I insert a new record and press save, the record doesn't get saved. Maybe because store_id doesn't hold a value or isn't marked as "dirty" / changed.

So I went to the Before and After save sections of the form properties and put in:
nuDebug("Before saving".$_POST['store_id']);

nuDebug("After saving".$_POST['store_id']);

Then moved to PHP Debug button but that form doesn't show zzsys_trap records that are of type $trap_sql. The nuDebug did write something to zzsys_trap based on the datetimestamp. But what did it write? Its a secret! How to decode the contents of zzsys_trap $trap_sql records?
admin
Site Admin
Posts: 2778
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5

Re: nuDebug() secret output?

Unread post by admin »

clinterman,

Records starting with $TRAP_sql are system generated and used by the Print Button to reproduce a html table that can be exported.

If you go to the Debug Button on the setup tabs, you should see the results you are looking for with $TRAP_sql records filtered out.

Steven
Fike
Posts: 79
Joined: Thu Oct 20, 2011 9:13 pm

Re: nuDebug() secret output?

Unread post by Fike »

I've just found out why sometimes I was not able to print the HTML table when using the Print Button at some Browse forms.

The $TRAP_sql records generated when using the print button pick the 'Before browse' code of the form

When the user presses the Print Button, the browseprint.php file gets this code and executes it IN A SINGLE LINE using the eval() function in order to build the table of that form.

However when the 'Before browse' php code contains double-slash comments (//) the eval() function breaks after the first comment becuase the code was retrieved IN A SINGLE LINE.

Therefore I just needed to remove the double-slash comments at the 'Before browse' tab, in order to make the Print Button work correctly.

Hope this helps someone still using nuBuilder v2.

Kind regrads,

Fike
Post Reply