Welcome to the nuBuilder Forums!

Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.

nuHasBeenSaved

Questions related to using nuBuilder Forte.
Post Reply
marc
Posts: 92
Joined: Mon May 14, 2018 3:26 pm

nuHasBeenSaved

Unread post by marc »

Happy new year to all nuBuilders!

I'm going to try this one again. It's very simple to reproduce.

Step 1: Add a new record to an edit screen,
Step 2: Refresh the form (CTRL+SHIFT+R)

nuHasBeenSaved() outputs 1 to the console instead of 0. This is not correct because the form has not yet been saved.

This is to be placed in the JavaScript of the form:

Code: Select all

if(nuFormType() == 'edit') {
   console.log(nuHasBeenSaved());
};
I'd be really glad if the behavior could be corrected. I really don't like to go back to Google Forms.
admin
Site Admin
Posts: 2829
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 30 times

Re: nuHasBeenSaved

Unread post by admin »

marc,

I have put a fix on Github for the nuHasBeenSaved() bug.

Steven
marc
Posts: 92
Joined: Mon May 14, 2018 3:26 pm

Re: nuHasBeenSaved

Unread post by marc »

admin
Site Admin
Posts: 2829
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 30 times

Re: nuHasBeenSaved

Unread post by admin »

marc,

Sorry I meant to say the latest version of nuBuilder Forte can only be found on Sourceforge.

https://sourceforge.net/projects/nubuilder/

Steven
marc
Posts: 92
Joined: Mon May 14, 2018 3:26 pm

Re: nuHasBeenSaved

Unread post by marc »

Steven,

The bug is appearing again in the latest nubuilder. nuHasBeenSaved() returns 0 when the form is saved (it should return 1)
kev1n
nuBuilder Team
Posts: 4566
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 76 times
Been thanked: 529 times
Contact:

Re: nuHasBeenSaved

Unread post by kev1n »

kev1n
nuBuilder Team
Posts: 4566
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 76 times
Been thanked: 529 times
Contact:

Re: nuHasBeenSaved

Unread post by kev1n »

Steven,

In the latest version, when you add a new record and save it, nuHasBeenSaved() still returns the wrong result (0 instead of 1).
Please let me know if my fix works for you.
Janusz
nuBuilder Team
Posts: 508
Joined: Fri Dec 28, 2018 1:41 pm
Location: Krakow, Poland
Has thanked: 11 times
Been thanked: 18 times

Re: nuHasBeenSaved

Unread post by Janusz »

Hi,
Just tested the latest version of nuBuilder (Oct 22 23:58) and noticed the issue with nuHasBeenSaved();
It does not work for the first save on new record.
And just want confirm that the fix from Kev1n works OK.
Belowe short movie how to replicate the issue:
https://drive.google.com/file/d/1ypplI3 ... sp=sharing

and the fix
https://github.com/steven-copley/nubuil ... orm.js#L27

Code: Select all

To replace this line (nuform.js  line 27)
if(window.nuLastForm != f.form_id || nuLastRecordId != f.record_id){
with
if(window.nuLastForm != f.form_id || (nuLastRecordId != f.record_id && nuLastRecordId !== "-1")) {
@Steven - is it possible to implement this fix with next release?
If you like nuBuilder, please leave a review on SourceForge
admin
Site Admin
Posts: 2829
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 30 times

Re: nuHasBeenSaved

Unread post by admin »

Janusz,

Thanks.

I have added that to Github, please test it.


Steven
Janusz
nuBuilder Team
Posts: 508
Joined: Fri Dec 28, 2018 1:41 pm
Location: Krakow, Poland
Has thanked: 11 times
Been thanked: 18 times

Re: nuHasBeenSaved

Unread post by Janusz »

Steven,
The nuHasBeenSaved() from the latest update (Oct 29 04:26) tested and works fine.

Thanks a lot.
If you like nuBuilder, please leave a review on SourceForge
Post Reply