Dolibarr / dolibarr

Dolibarr ERP CRM is a modern software package to manage your company or foundation's activity (contacts, suppliers, invoices, orders, stocks, agenda, accounting, ...). it's an open source Web application (written in PHP) designed for businesses of any sizes, foundations and freelancers.
https://www.dolibarr.org
GNU General Public License v3.0
5.32k stars 2.75k forks source link

Preffered shipping method (SOCIETE_ASK_FOR_SHIPPING_METHOD) broken by #24716 #25152

Closed jobrien2001 closed 2 months ago

jobrien2001 commented 1 year ago

Bug

24716

$form->selectShippingMethod(((GETPOSTISSET('shipping_method_id')` && GETPOST('shipping_method_id', 'int') != 0) ? GETPOST('shipping_method_id') : $shipping_method_id), 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx');

Should be > 0 not != 0 ??

I dont know php but this seems to fix it.

Looks like other fields may be affected by the same change?

Environment Version

17.02

Environment OS

win10

Environment Web server

WAMP

Environment PHP

7.4

Environment Database

mariadb

Environment URL(s)

No response

Expected and actual behavior

No response

Steps to reproduce the behavior

-Set default shipping on third party -Create order, shipping is not selected

Attached files

No response

bos4711 commented 1 year ago

Where do you set default shipping on third party?

jobrien2001 commented 1 year ago

Where do you set default shipping on third party?

"Other setup", set SOCIETE_ASK_FOR_SHIPPING_METHOD to 1

You can find most vars in the docs.

bos4711 commented 1 year ago

Works fine for me (v17.0.2 / PHP 7.0).

2023-06-29_001507 2023-06-29_001514

jobrien2001 commented 1 year ago

Thats odd, it doesnt work for me. Im on php 7.4. Are you using the sourceforge 17.02 release?

bos4711 commented 1 year ago

Yes, we use the SF-release.

bos4711 commented 1 year ago

Just tested this with PHP 8.0 / Doli 17.0.2 and it works fine there as well.

github-actions[bot] commented 3 months ago

This issue is stale because it has been open 1 year with no activity. If this is a bug, please comment to confirm it is still present on latest stable version. if this is a feature request, please comment to notify the request is still relevant and not yet covered by latest stable version. This issue may be closed automatically by stale bot in 10 days (you should still be able to re-open it if required).