Opened 4 years ago
Closed 3 years ago
#20851 closed defect (fixed)
Tagging preset: value_template does not update value, right away, with conditions
Reported by: | skyper | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 21.07 |
Component: | Core | Version: | latest |
Keywords: | template_report tagging preset value_template condition update | Cc: | simon04 |
Description (last modified by )
Sorry, simon04. I really love this feature but it still is not working properly. Thanks for your work.
What steps will reproduce the problem?
- Have a condition in the expression for
value_template=""
like the one in #20842. - Have a relation selected matching the preset with some of the tags already tagged
- Open the preset, change a tag which is used in the expression with a condition, like
route=*
.
<group name="Public Transport" icon="presets/transport/bus.svg"> <item name="Public Transport Route (Rail)" icon="presets/misc/route.svg" type="relation" preset_name_label="true"> <link wiki="Public_transport#Service_routes" /> <space /> <key key="type" value="route" /> <combo key="route" text="Route type" values="train,subway,monorail,tram,light_rail" values_searchable="true" match="keyvalue!" /> <key key="public_transport:version" value="2" /> <!-- only validate marked relations in order to avoid false positives --> <text key="name" text="Name" value_template="?{route=train 'Train'|route=subway 'Subway'|route=monorail 'Monorail'|route=tram 'Tram'|route=light_rail 'Light_rail'|''} {ref}?{': {from} - {via} - {to}'|': {from} - {to}'|''}" /> <text key="ref" text="Reference" /> <text key="from" text="from" /> <text key="to" text="to" /> <text key="via" text="Via" /> </item> <!-- Public Transport Route (Rail) -->
What is the expected result?
The value is adjusted right away, after changing any tag which is used in the expression.
What happens instead?
The value might be adjusted when closing the dialog with "ok" but not always
Please provide any additional information below. Attach a screenshot if possible.
It work with tags not part of a condition, like ref=*
.
Opening the preset after closing changes the value again to the correct content.
The expression, especially conditions, are not always evaluated after changing an involved tag.
One more question: Is it wise to change an existing value, automatically, without user's interaction??
Think we need at least a preference option to enable/disable this feature of overwriting values.
Relative:URL: ^/trunk Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Last:Changed Date: 2021-05-04 21:01:14 +0200 (Tue, 04 May 2021) Revision:17860 Build-Date:2021-05-05 01:30:58 URL:https://josm.openstreetmap.de/svn/trunk Plugins: + tagging-preset-tester (35640) Tagging presets: + ${HOME}/JOSM/new/resources/data/defaultpresets_17833_route_17661_18662.xml
Attachments (3)
Change History (20)
comment:1 by , 4 years ago
Description: | modified (diff) |
---|
comment:2 by , 4 years ago
Cc: | added |
---|---|
Description: | modified (diff) |
comment:3 by , 4 years ago
Description: | modified (diff) |
---|
comment:4 by , 4 years ago
Milestone: | → 21.05 |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:5 by , 4 years ago
comment:8 by , 4 years ago
comment:9 by , 4 years ago
Description: | modified (diff) |
---|
comment:10 by , 4 years ago
Thanks, it does nicely update now.
Is it possible to use java functions (e.g. mapcss java functions) in the expressions to solve my problem with multiple values which I want to split?
May you, please, take another look at the documentation at the bottom of the attributes' section. Try & Error is not the best method to document a new function.
comment:11 by , 4 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Sorry, but there is still a minor glitch using above preset.
- Have a relation matching the preset with
from=*
,to=*
andvia
- Open preset and remove the values for all three tags.
- I still find two
-
inname=*
which are never deleted no whether I delete the the whole value ofname=*
nor changing any other tag's value.
- I still find two
- Close preset
- wrong name value
- Open preset again
- Finally the correct value is used.
by , 4 years ago
Attachment: | josm_20851_reopen_preset.png added |
---|
reopen preset after close with incorrect value
comment:13 by , 4 years ago
Well, I changed the expression a little bit but the problem still exists:
<text key="name" text="Name" value_template="?{route=train 'Train'|route=subway 'Subway'|route=monorail 'Monorail'|route=tram 'Tram'|route=light_rail 'Light_rail'|''}?{' {ref}'|''}?{': {from} - {via} - {to}'|': {from} - {to}'|''}" />
Open preset with some tags already added to the relation:
Remove from=*
, which should remove everything behind "Train".
Closing the presets leads to the incorrect value Train: - B - C
.
Reopening the preset finally leads to the correct value.
comment:15 by , 4 years ago
Milestone: | 21.05 |
---|---|
Owner: | changed from | to
Status: | reopened → new |
comment:16 by , 3 years ago
Milestone: | → 21.07 |
---|
In 17875/josm: