Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0057357
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[POS2] POSminoralways2024-12-03 19:272024-12-12 14:24
ReportersofidossantView Statuspublic 
Assigned ToBimla_vm 
PrioritynormalResolutionfixedFixed in Version25Q1
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionpiSCM revision 
Review Assigned To
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0057357: Regular expression in CRM does not work with null

DescriptionWhen 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 Reproduce1- 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 SolutionErrro 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.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0173030)
hgbot (developer)
2024-12-06 06:03

Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/3211 [^]
(0173031)
hgbot (developer)
2024-12-06 06:07

Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/1677 [^]
(0173242)
hgbot (developer)
2024-12-12 14:23

Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2 [^]
Changeset: 39a369a8f4a6ff6dd44045424e82bb7f7d4c5d88
Author: Bimla Mayavan <b.mayavan@external.orisha.com>
Date: 12-12-2024 13:23:13
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/commit/39a369a8f4a6ff6dd44045424e82bb7f7d4c5d88 [^]

Fixed ISSUE-57357: Modified the condition of regExp validation

---
M web-jspack/org.openbravo.core2/src/core/validatorEngine/validators/regExp/regExpValidator.js
---
(0173243)
hgbot (developer)
2024-12-12 14:23

Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.core2/-/merge_requests/1677 [^]
(0173244)
hgbot (developer)
2024-12-12 14:24

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2 [^]
Changeset: 1af08fa3ee8afda011981e45b3b0e651b11e52d4
Author: Bimla Mayavan <b.mayavan@external.orisha.com>
Date: 12-12-2024 13:23:41
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/commit/1af08fa3ee8afda011981e45b3b0e651b11e52d4 [^]

Related to ISSUE-57357: Handled error msg in customerFormHandlerUtils

---
M web-jspack/org.openbravo.pos2/src/components/Customer/CustomerUtils/CustomerFormHandlerUtils.js
---
(0173245)
hgbot (developer)
2024-12-12 14:24

Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.pos2/-/merge_requests/3211 [^]

- 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


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker