Opened 5 years ago

Last modified 4 years ago

#20861 new defect

Tagging preset: "value_template" always overwrites value without strong indication and without option to disable. — at Initial Version

Reported by: skyper Owned by: team
Priority: normal Milestone:
Component: Core Version: latest
Keywords: template_report tagging preset value_template Cc: simon04

Description

This is a follow-up of #18949 and #20851

On #18949, KorneySan wrote in comment 6:

On preset dialog closing by OK button the engine should check the name value and if it is empty AND default_template is set, it should evaluate default_template and set the result to the name.

In #20851s description skyper wrote:

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.

What steps will reproduce the problem?

  1. Have a preset using value_template=""
  2. Create an object and tag it with preset
  3. After closing the preset, change the value of the tag with value_template=""
  4. Open the preset again with the object still selected

What is the expected result?

  • An strong indication about the automatically change of the value
  • An option to disable this automatism completely

What happens instead?

  • no strong indication
  • the value is always changed, despite having set it manually in advance
  • no preference option to disable value_template

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

  • How about touching the value only if the value is empty. User could still delete the value in the preset to reactivate the template but values are not overwritten automatically.
  • I did not check on name_template="" but I would say, the use of templates should be in user control with preferences options to generally enable/disable the use of each of both templates.

Thanks a lot for your work, I really appreciate it.

    <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) -->
Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2021-05-06 22:44:54 +0200 (Thu, 06 May 2021)
Revision:17878
Build-Date:2021-05-07 01:31:01
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

Change History (0)

Note: See TracTickets for help on using tickets.