﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
20851	Tagging preset: value_template does not update value, right away, with conditions	skyper	team	"Sorry, simon04. I really love this feature but it still is not working properly. Thanks for your work.

==== What steps will reproduce the problem?
1. Have a condition in the expression for `value_template=""""` like the one in #20842.
1. Have a relation selected matching the preset with some of the tags already tagged
1. Open the preset, change a tag  which is used in the expression with a condition, like `route=*`.

{{{
#!preset
    <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
}}}"	defect	closed	normal	21.07	Core	latest	fixed	template_report tagging preset value_template condition update	simon04
