nopSolutions / nopCommerce

ASP.NET Core eCommerce software. nopCommerce is a free and open-source shopping cart.
https://www.nopcommerce.com
Other
9.08k stars 5.19k forks source link

Fix validation of pickup point lat/lon fields in the admin area #7205

Closed exileDev closed 1 month ago

exileDev commented 1 month ago

nopCommerce version: 4.70

Steps to reproduce the problem:

When using the Hungarian language, the Latitude and Longitude fields in the PickupInStore module do not accept decimal values correctly. The decimal separator in Hungarian locale is a comma (,), but the validation expects a period (.), which causes validation failures specifically for these fields.

Behavior:
    Switching the application language to English (en-US) resolves the issue, and the Latitude and Longitude inputs validate as expected.
    Switching back to Hungarian reintroduces the problem only for these specific fields.

Reproduction Steps:
    Set the application language to Hungarian.
    Navigate to the PickupInStore configuration.
    Attempt to input decimal values for Latitude and Longitude.
    Observe that the validation fails due to the expected decimal separator being a period instead of a comma.

Additional Context:
    This issue did not occur in version 4.60.5 with the same server settings.
    The problem started appearing from version 4.70.0 onwards.
    Other decimal fields in different parts of the application do not exhibit this issue; it seems to be isolated to the PickupInStore Latitude and Longitude fields.

Given these details, it seems like the validation for these specific fields might still be using the server locale (en-us) rather than the application locale (hu-HU) when rendering and validating these fields. This discrepancy might be causing the validation issues with decimal inputs in the Hungarian language. Could you please provide guidance on how to ensure that the PickupInStore module respects the Hungarian locale settings for decimal input validation without modifying the core nopCommerce settings? Any advice or direction would be greatly appreciated.

Source: https://www.nopcommerce.com/en/boards/topic/99120/decimal-validation-issue-in-nopcommerce-470#312808

exileDev commented 1 month ago

Closed #7205