Page 1 of 1

Bug: zzzzsys_session

Posted: Thu Oct 11, 2018 1:33 am
by alf1976
Hi Steven

I run nuBuilder on a synology webstation. Its all been working fine until an update yesterday.
Since the update i couldn't:
See any add / delete and clone buttons.
See nuDebug Results / Form properties / Form object list options
Update kept "Something's wrong. Try logging in again..."
and a few other issues

Eventually i traced the problem through the zzzzsys_debug

Code: Select all

2018-10-11 00:04:47 - SQL Error in <b>nuRunQuery</b>

<br>

[0] : 
===USER==========

globeadmin

===PDO MESSAGE=== 

SQLSTATE[HY000]: General error: 1364 Field 'sss_time' doesn't have a default value

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

INSERT INTO zzzzsys_session SET sss_access = ?, zzzzsys_session_id = ?

===BACK TRACE====

/volume1/web/nuBuilder/nusession.php - line 187 (nuRunQuery)

/volume1/web/nuBuilder/nuapi.php - line 4 (require_once)

Once i amended the table to set a default value on this field everything worked fine.

Please can you amend the amend the update procedure so went it updates the table definition it assigns a default setting to sss_time

At the moment i am having to repeat this procedure after doing a system update

Kinds regards
Andrew

Re: Bug: zzzzsys_session

Posted: Fri Oct 12, 2018 3:25 am
by admin
Andrew,

I believe I have fixed it.

Let me know if it works for you now.


Steven

Re: Bug: zzzzsys_session

Posted: Mon Oct 15, 2018 12:13 am
by alf1976
Hi Steven,

i have also experienced the same problem on zzzzsys_object and zzzzsys_php. Both have fields that lack defaults values that nuBuilder does not populate when inserting.

zzzzsys_php has sph_php, sph_run, sph_zzzzsys_form_id and sph_hide - discovered when inserting an beforesave event

zzzzsys_object had sob_lookup_autocomplete and sob_lookup_php. discovered when cloning a form object


Andrew

Re: Bug: zzzzsys_session

Posted: Sat Oct 27, 2018 10:16 am
by alf1976
Hi Steven,

Another one in

zzzzsys_file

Field 'sfi_system' doesn't have a default value

Re: Bug: zzzzsys_session

Posted: Sat Nov 03, 2018 1:59 pm
by alf1976
another one

Field 'syt_help' doesn't have a default value in zzzzsys_tab

Re: Bug: zzzzsys_session

Posted: Sat Nov 03, 2018 2:22 pm
by alf1976
another one,

sus_language in zzzzsys_user

Re: Bug: zzzzsys_session

Posted: Sat Nov 03, 2018 9:27 pm
by admin
Andrew,

I don't get these problems.

I believe it is to do with your setup.

This might help.

https://stackoverflow.com/questions/187 ... ault-value

Steven

Re: Bug: zzzzsys_session

Posted: Sun Nov 04, 2018 1:05 am
by alf1976
Hi Steven,

That helps. Upon further examination i found this too.

https://mariadb.com/kb/en/library/sql-mode/

It appears that from version MariaDB 10.2.4 strict mode is active as default. The last update my diskstation did took the version upto 10.3.7.

Code: Select all

SELECT REPLACE(@@SQL_MODE, ',', '\n')
Runnng the above in phpMyAdmin does confirm that my MariaDb has the 'STRICT_TRANS_TABLES' flag active.

The page also describes how to remove the flag, which in theory, should resolve the problem.

Why this may be a simple solution, i'm not sure if it is the best solution. if newer installs of mariadb has this flag set as default then more users, in particular new users, will experience the same issues as me. This appears to be already happening https://forums.nubuilder.cloud/viewtopic.php?f=19&t=9715.

I am more than happy to leave it strict mode and report errors as i find them if you are willing to correct them

Please let me know how you wish to proceed.

Andrew

Re: Bug: zzzzsys_session

Posted: Sun Nov 04, 2018 2:03 am
by admin
Andrew,

Thanks for the offer but I have just set a default value of NULL to all but fields with Primary Keys.

And pushed the changes to Github.

If you could test it on your box, that would be great.


Steven

Re: Bug: zzzzsys_session

Posted: Sun Nov 04, 2018 2:12 am
by alf1976
hi Steven,

will do. i will let you know how it goes.

Andrew