Menu

#2100 AttributeURL - custom validation pattern

Future release
closed
None
Core/OQL
Low
3.0.1
defect
2022-08-18
2022-08-17
No

AttributeURL allows for a custom validation_pattern to be specified, per latest documentation. If not specified, it defaults to what's configured for iTop's config setting "url_validation_pattern".

However: I tried to add "AttributeURL" since it was most fitting, and made the validation pattern less strict than what's in that setting. For the front-end validation (iTop console), I can now enter a URL with a place holder: https://jeffreybostoen.be/$current_user->language$ without any issue.
This is a documented feature with no mention of limitation: https://www.itophub.io/wiki/page?id=latest%3Acustomization%3Axml_reference#fields

However, upon saving, it results in this error:

The object cannot be saved : Unexpected value for attribute 'newvalue': Wrong format [https://jeffreybostoen.be/compatibility-with-itop-3-0/$current_user->language$]

I debugged it and it comes from CMDBChangeOpSetAttributeURL's "newvalue" attribute. It enforces the url_validation_pattern, which was NOT explicitly updated to support more characters.

Rather than enforcing the default validation here, there should not be any validation, as the real validation should theoretically have happened on the host class), it should just allow anything.

Discussion

  • Guillaume Lajarige

    Actually we fixed something similar in the upcoming 3.0.2, but on the oldvalue field, see here.

    @cisou you might want to check this and if we want to fix it as well.

     
  • Pierre Goiffon

    Pierre Goiffon - 2022-08-18
    • status: new --> to-be-reviewed
    • assigned_to: Guillaume Lajarige
     
  • Pierre Goiffon

    Pierre Goiffon - 2022-08-18

    Discussed with @cisou : we totally agree !
    Unfortunately the 3.0.2 is in its last review phase, so we can't add this fix :(

    I've added N°5423 for this second fix, and commit with a92b1971
    It will be part either of 3.0.3 (but up to this day we're not sure it this version will exist ?) or 3.1.0.

     
  • Pierre Goiffon

    Pierre Goiffon - 2022-08-18
    • status: to-be-reviewed --> closed
    • assigned_to: Guillaume Lajarige --> Pierre Goiffon
    • Milestone: Unassigned --> Future release
     

Log in to post a comment.

MongoDB Logo MongoDB