Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in Module Builder on interger filed with default if it is not displayed the default value is not used #22509

Closed
FHenry opened this issue Oct 6, 2022 · 5 comments
Assignees
Labels
Bug This is a bug (something does not work as expected)

Comments

@FHenry
Copy link
Member

FHenry commented Oct 6, 2022

Bug

On New module create a field

'status_custom' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>'1', 'position'=>2000, 'notnull'=>1, 'visible'=>5, 'default'=>1, 'index'=>1, 'validate'=>'1',),

Create the object
value is 0

Environment Version

15.0, 16.0

Environment OS

No response

Environment Web server

No response

Environment PHP

No response

Environment Database

No response

Environment URL(s)

No response

Expected and actual behavior

No response

Steps to reproduce the behavior

No response

Attached files

2022-10-06.16-35-52.mp4
@FHenry FHenry added the Bug This is a bug (something does not work as expected) label Oct 6, 2022
nicolas-eoxia added a commit to nicolas-eoxia/dolibarr that referenced this issue Oct 6, 2022
@ksar-ksar
Copy link
Contributor

@FHenry Just by curiosity, what is the nice tool you use to developp ?

@FHenry
Copy link
Member Author

FHenry commented Oct 6, 2022

Phpstorm (my only "breaking rule" to open source or do not use it)

@ksar-ksar
Copy link
Contributor

Thanks!

@eldy
Copy link
Member

eldy commented Oct 7, 2022

I don't see what's wrong.
If field has property "not null" and default to 1, it meas it will be 1 if no info is provided.
Bu if you set the value to 0 = draft explicitely, we must store 0. Default value must apply only if we enter nothing (if we keep combo with no value)

@FHenry
Copy link
Member Author

FHenry commented Oct 8, 2022

@eldy The field status_custom is not provided as it visibility set 5 and default is 1 and notnull=1, I just copy the status field for sample, but it's another field, it's confusing but check it again

@nicolas-eoxia nicolas-eoxia self-assigned this Nov 25, 2022
nicolas-eoxia added a commit to nicolas-eoxia/dolibarr that referenced this issue Nov 25, 2022
eldy added a commit that referenced this issue Nov 26, 2022
…eQuery

FIX: #22509 default value on integer fields don't retrieve by setSaveQuery
@eldy eldy closed this as completed in b98eaa4 Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is a bug (something does not work as expected)
Projects
None yet
Development

No branches or pull requests

4 participants