Openbravo Issue Tracking System - POS2 | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0057357 | POS2 | POS | public | 2024-12-03 19:27 | 2024-12-12 14:24 |
Reporter | sofidossant | ||||
Assigned To | Bimla_vm | ||||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | OS | 5 | OS Version | ||
Product Version | pi | ||||
Target Version | Fixed in Version | 25Q1 | |||
Merge Request Status | |||||
Review Assigned To | |||||
OBNetwork customer | |||||
Support ticket | |||||
Regression level | |||||
Regression date | |||||
Regression introduced in release | |||||
Regression introduced by commit | |||||
Triggers an Emergency Pack | No | ||||
Summary | 0057357: Regular expression in CRM does not work with null | ||||
Description | When I configure the validation in the adress name field in the CRM, and I add the validation and the regular expression ^.{0,60}$, and when I want to save an adress in null, it fails and shows me the error message. | ||||
Steps To Reproduce | 1- Configurate in CRM, field address name, validation in Y, type:Regular Expression and regular expression validation ^.{0,60}$ 2- Do the refresh in the webpos2 3 - Create a new address with null, and check the error: "name has not a valid pattern " | ||||
Proposed Solution | Errro in the code const regExpValidator = new Validator( `regExp`, // eslint-disable-next-line no-unused-vars (propertyForValidation, entityForValidation) => propertyForValidation.value && new RegExp(propertyForValidation.extraProperties.validationregexp).test( propertyForValidation.value ) ? { status: VALIDATION_STATUS.OK } : { status: VALIDATION_STATUS.ERROR, message: getLabel('$OBC2_RegExpValidationError', [ propertyForValidation.name ]), propertyName: propertyForValidation.name } ); The if gives null and the regex If in javascript we try: undefined ? 1: 0, the result is 0. So it fails even though the regex gives me ok. | ||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2024-12-03 19:27 | sofidossant | New Issue | |||
2024-12-03 19:27 | sofidossant | Assigned To | => Retail | ||
2024-12-03 19:27 | sofidossant | Triggers an Emergency Pack | => No | ||
2024-12-04 14:51 | guilleaer | Assigned To | Retail => guilleaer | ||
2024-12-04 14:51 | guilleaer | Status | new => acknowledged | ||
2024-12-04 15:04 | Bimla_vm | Assigned To | guilleaer => Bimla_vm | ||
2024-12-04 15:04 | Bimla_vm | Status | acknowledged => scheduled | ||
2024-12-06 06:03 | hgbot | Note Added: 0173030 | |||
2024-12-06 06:07 | hgbot | Note Added: 0173031 | |||
2024-12-12 14:23 | hgbot | Resolution | open => fixed | ||
2024-12-12 14:23 | hgbot | Status | scheduled => closed | ||
2024-12-12 14:23 | hgbot | Fixed in Version | => 25Q1 | ||
2024-12-12 14:23 | hgbot | Note Added: 0173242 | |||
2024-12-12 14:23 | hgbot | Note Added: 0173243 | |||
2024-12-12 14:24 | hgbot | Note Added: 0173244 | |||
2024-12-12 14:24 | hgbot | Note Added: 0173245 |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|