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

Weight / height can't be empty with unit pre-selected #31711

Open
Themiller12 opened this issue Nov 6, 2024 · 2 comments
Open

Weight / height can't be empty with unit pre-selected #31711

Themiller12 opened this issue Nov 6, 2024 · 2 comments
Labels
Bug This is a bug (something does not work as expected) Event: Devcamp 2024 Nancy

Comments

@Themiller12
Copy link

Themiller12 commented Nov 6, 2024

Bug

Hi, we created lot of products in previous versions of Dolibarr, and we are used to clone similars products to create new ones.
But in 20.0.1 if you want to save a product with unit pre-selected and empty field, you'll have a blank page.

Simple fix in functions2.lib.php :

`function weight_convert($weight, &$from_unit, $to_unit)
{

if(!empty($from_unit) AND $from_unit > 0) {
    
$weight = is_numeric($weight) ? $weight : 0;
while ($from_unit != $to_unit) {

[.....]
`

Dolibarr Version

20.0.1

Environment PHP

8

Environment Database

No response

Steps to reproduce the behavior and expected behavior

No response

Attached files

bug doli 20
@Themiller12 Themiller12 added the Bug This is a bug (something does not work as expected) label Nov 6, 2024
@IC-Safa
Copy link

IC-Safa commented Nov 15, 2024

Hi, I'm not really to understand your issue here. Is it when you create the product you want to pre-define units but it doesn't save them if they are empty right ? if so, I can manage to replicate the bug

@hregis
Copy link
Contributor

hregis commented Dec 31, 2024

@Themiller12 look this fix : #32496

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) Event: Devcamp 2024 Nancy
Projects
None yet
Development

No branches or pull requests

4 participants