Modify

Opened 2 years ago

Closed 17 months ago

Last modified 16 months ago

#22096 closed defect (fixed)

regexp_match() in validator.mapcss should allow placeholders

Reported by: andygol Owned by: team
Priority: normal Milestone:
Component: Core validator Version:
Keywords: placeholder, mapcss, validator Cc:

Description

Related to #17669

What steps will reproduce the problem?

/* Excessive ";" symbol at the end of the value */
*[/(phone|fax)/][/(phone|fax)/ =~ /^(.+); *$/] {
    throwWarning: tr("{0}", "{0.value}");
    group: tr("Empty value after \";\"");
    fixAdd: concat("{0.key}=", get(regexp_match("^(.+); *$", "{0.value}"), 1));
}

run this rule against POI with contact:phone=+380 4594 57 441;+380 4594 57 442; or fax=+380 4594 57 441; or similar tags

What is the expected result?

Value without trailing ; symbol

  • contact:phone=+380 4594 57 441;+380 4594 57 442
  • fax=+380 4594 57 441

What happens instead?

Tested tag disappears as regexp_match() with placeholder "{0.value}" returns null.

This behaviour is very similar to the case of using tag("{0.key}"), if we use placeholder instead of explicit key

Please provide any additional information below. Attach a screenshot if possible.

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2022-04-04 22:26:00 +0200 (Mon, 04 Apr 2022)
Revision:18427
Build-Date:2022-04-05 01:30:55
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (18427 uk) Mac OS X 12.4
OS Build number: macOS 12.4 (21F79)
Memory Usage: 508 MB / 8192 MB (280 MB allocated, but free)
Java version: 18+36-2087, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Look and Feel: com.apple.laf.AquaLookAndFeel
Screen: Display 1 1512×982 (scaling 2.00×2.00)
Maximum Screen Size: 1512×982
Best cursor sizes: 16×16→16×16, 32×32→32×32
System property file.encoding: UTF-8
System property sun.jnu.encoding: UTF-8
Locale info: uk_UA
Numbers with default locale: 1234567890 -> 1234567890
Program arguments: [--debug]
Dataset consistency test: No problems found

Attachments (0)

Change History (2)

comment:1 by taylor.smock, 17 months ago

Resolution: duplicate
Status: newclosed

Closed as duplicate of #17669.
It looks like fixing #17669 will fix this ticket.

comment:2 by taylor.smock, 16 months ago

Resolution: duplicatefixed

In 18757/josm:

Fix #17669, #22096: Allow placeholders in more locations in MapCSS

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.