Opened 5 years ago
Last modified 5 years ago
#19511 new enhancement
Support of complete tag in fixChange and FixRemove
| Reported by: | skyper | Owned by: | team |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Core validator | Version: | |
| Keywords: | template_report tag fixChange fixRemove | Cc: |
Description
What steps will reproduce the problem?
- Have
way[highway][placement=transition]["placement:forward"=transition], way[highway][placement=transition]["placement:backward"=transition] { throwWarning: tr("Use {0} only as value of {1}", "{1.value}", "{2.key}=*"); group: tr("suspicious tag combination"); fixAdd: "placement=transition"; fixChange: "placement:forward=transition=>placement=transition"; fixRemove: "placement:backward=transition"; }
- Load rule
What is the expected result?
No warning and rule is loaded
What happens instead?
SEVERE: Cannot add MapCSS rule: Cannot add instruction fixChange: placement:forward=transition=>placement=transition!SEVERE: Cannot add MapCSS rule: java.lang.IllegalArgumentException: Unexpected '='. Please only specify the key to remove in: fixRemove: String<placement:backward=transition>;
and rule is not loaded
Please provide any additional information below. Attach a screenshot if possible.
I want to only change or remove placement;backward/forward with value transition
It would be nice if I do not have to write the needed syntax to change or remove only specific key-value combinations for each rule. Thanks a lot.
Relative:URL: ^/trunk Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Last:Changed Date: 2020-07-09 17:42:41 +0200 (Thu, 09 Jul 2020) Revision:16740 Build-Date:2020-07-10 01:30:51 URL:https://josm.openstreetmap.de/svn/trunk Last errors/warnings: - E: Cannot add MapCSS rule: java.lang.IllegalArgumentException: Unexpected '='. Please only specify the key to remove in: fixRemove: String<placement:forward=transition>; - E: Cannot add MapCSS rule: Cannot add instruction fixChange: placement:forward=transition=>placement=transition!
Attachments (0)
Change History (3)
follow-up: 2 comment:1 by , 5 years ago
comment:2 by , 5 years ago
Replying to Klumbumbus:
I don't understand the point. Why not use
fixRemove: "placement:forward"; fixRemove: "placement:backward";
Because it removes e.g. placement:backward=left_of:4 as well.
And if needed
fixAdd: "placement=transition";but in your example it is not needed as it is already in the selector.
I condensed the example. The complete block is:
way[highway][placement=transition]["placement:forward"=transition], way[highway][placement=transition]["placement:backward"=transition], way[highway][placement=transition]["placement:both_ways"=transition], way[highway]["placement:forward"=transition]["placement:backward"=transition], way[highway]["placement:forward"=transition]["placement:both_ways"=transition], way[highway]["placement:backward"=transition]["placement:both_ways"=transition] { throwWarning: tr("Use {0} only as value of {1}", "{1.value}", "{2.key}=*"); group: tr("suspicious tag combination"); fixAdd: "placement=transition"; fixRemove: "placement:forward=transition"; fixRemove: "placement:backward=transition"; fixRemove: "placement:both_ways=transition"; assertMatch: "way highway=primary placement:backward=transition placement:forward=transition"; assertNoMatch: "way highway=primary placement=middle_of:1 placement:forward=transition"; }



I don't understand the point. Why not use
?
And if needed
but in your example it is not needed as it is already in the selector.