Page 1 of 1

Debug Results Form - "Delete All"

Posted: Sun Feb 04, 2018 11:50 am
by toms
Steven,

Could you make the "Delete All" button visible on both the Browse and Edit Form? This allows you to delete all debug entries right from the Browse form without the need to open a record first.
debug_view.PNG
I made this small change to the zzzzsys_debug javascript:

Code: Select all

if(nuFORM.getCurrent().record_id != ''){
    $('.nuActionButton').remove();
    nuAddActionButton('Delete');
// old position:   nuAddActionButton('DeleteAll','Delete All', 'nuDeleteAllAction()');  
}
// new position: 
nuAddActionButton('DeleteAll','Delete All', 'nuDeleteAllAction()'); 
In addition to that, to prevent the debug form from closing after hitting the "Delete All" button, I modified nuajax.js (There might be another way of doing it)

Code: Select all

if (action == "delete" && instruction == "all" && fm.record_id == "")
			{
			    // refresh the browse form
			    nuGetBreadcrumb();
			} else
delete_all_nuajax.PNG

Re: Debug Results Form - "Delete All"

Posted: Sun Feb 04, 2018 11:54 am
by toms
...and the "Delete All" confirm dialog should say "Delete All Records?":

Code: Select all

function nuDeleteAllAction(){
	
    if (confirm("Delete This Record?")) {

		$('#nuDelete').prop('checked', true);
		
		nuUpdateData('delete', 'all');
		
    }
	
}

Re: Debug Results Form - "Delete All"

Posted: Mon Feb 05, 2018 3:35 am
by admin
toms,

I have put the Button on the Browse now too.

It's on Github and you'll need to run Update.

Can you please test it?

If you want me to change Delete All to Delete All Records, I'll ask you to Add Delete All Records to all the Translations we have.

I think that, if a User doesn't understand Delete All, changing it to Delete All Records, probably won't help much.

Steven

Re: Debug Results Form - "Delete All"

Posted: Mon Feb 05, 2018 5:39 am
by toms
Steven,

The deleting works just fine. I just noticed a small glitch in the record navigator. "1/0" is shown instead of "0/0" after hitting "Delete All". This issue might occur on any other Browse Form too.
page1_0.PNG

Re: Debug Results Form - "Delete All"

Posted: Mon Feb 05, 2018 9:50 am
by admin
toms,

I have changed empty Browse Forms to Page 1 / 1

(and put that on Github)

Steven

Re: Debug Results Form - "Delete All"

Posted: Mon Feb 05, 2018 10:54 am
by toms
Steven,

The number of pages is now displayed correctly (Page 1 / 1) after deleting all records.
Now if I click the next icon (►) in the record navigator, (Page 0 / 1) is shown. Then, hitting twice the back button (◄) , I see two new entries in the debug list:
nuDebug_Errors.png
===PDO MESSAGE===

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-15, 15' at line 4

===SQL===========

SELECT zzzzsys_debug_id,deb_message,deb_added
FROM zzzzsys_debug
WHERE 1
ORDER BY zzzzsys_debug_id DESC LIMIT -15, 15

===BACK TRACE====

Re: Debug Results Form - "Delete All"

Posted: Mon Feb 05, 2018 11:28 am
by admin
toms,

I think this bug was previously there.

All I changed was this...
page.png
I can't reproduce the error.

Can you give me a way to reproduce it, and tell me of a system Form that I can reproduce it on? (eg. Form, Objects, Translation)

Steven

Re: Debug Results Form - "Delete All"

Posted: Mon Feb 05, 2018 12:34 pm
by toms
Steven,

I can reproduce it on both a fresh installation & my productive system.
I recorded a video demonstrating the error.

https://vimeo.com/254289062

Re: Debug Results Form - "Delete All"

Posted: Mon Feb 05, 2018 8:43 pm
by admin
toms,

Ahh, I see what you mean now...

The fix is now on Github.

Steven