Modify

Opened 3 years ago

Last modified 22 months ago

#22001 new defect

display_value's in presets ignored when sorting value list

Reported by: Hufkratzer Owned by: team
Priority: normal Milestone:
Component: Core Version: tested
Keywords: preset display_value sorting Cc: skyper, marcello@…

Description

What steps will reproduce the problem?

  1. Switch language to German
  2. Open preset "Neue Wiki-Tags/Freizeit/Kegelbahn"

What is the expected result?

You see an alphabetically sorted sports list (because in the preset values_sort="false" is missing, I will add it after this bug is fixed).

What happens instead?

You see an alphabetically unsorted sports list:


Please provide any additional information below.

It looks like the sorting ignores the display_value's.

This bug was detected when testing an enhanced version of defaultpresets.xml that makes extensive use of display_value's, more details see comment:15:ticket:21907 ff.

URL:https://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2022-01-02 21:24:43 +0100 (Sun, 02 Jan 2022)
Build-Date:2022-01-02 20:26:19
Revision:18360
Relative:URL: ^/trunk

Identification: JOSM/1.5 (18360 de) Windows 7 64-Bit
OS Build number: Windows 7 Home Premium (7601)
Memory Usage: 283 MB / 681 MB (44 MB allocated, but free)
Java version: 1.8.0_201-b09, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM
Look and Feel: com.sun.java.swing.plaf.windows.WindowsLookAndFeel
Screen: \Display0 1024×768 (scaling 1.00×1.00)
Maximum Screen Size: 1024×768
Best cursor sizes: 16×16→32×32, 32×32→32×32
System property file.encoding: Cp1252
System property sun.jnu.encoding: Cp1252
Locale info: de_DE
Numbers with default locale: 1234567890 -> 1234567890
Dataset consistency test: No problems found

Tagging presets:
+ https://josm.openstreetmap.de/josmfile?page=Presets/NewTags&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Presets/Animal_facilities&zip=1

Map paint styles:
- https://github.com/bastik/mapcss-tools/raw/osm/mapnik2mapcss/osm-results/mapnik.zip
- https://josm.openstreetmap.de/josmfile?page=Styles/Osmc&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Styles/IconTester&zip=1
+ G:\JOSM18404\elemstyles.mapcss

Validator rules:
+ https://josm.openstreetmap.de/josmfile?page=Rules/SuspiciousSwimming_Pool&zip=1
+ G:\JOSM18404\horse_ridiing_v2test.zip

Attachments (3)

kegelbahn.jpg (26.4 KB ) - added by Hufkratzer 3 years ago.
nuclear.png (140.6 KB ) - added by Hufkratzer 22 months ago.
shows unsorted list in nuclear reactor preset
bugdemo.png (14.2 KB ) - added by Hufkratzer 22 months ago.
shows result from demo preset source

Download all attachments as: .zip

Change History (6)

by Hufkratzer, 3 years ago

Attachment: kegelbahn.jpg added

comment:1 by skyper, 3 years ago

Keywords: preset added

comment:2 by skyper, 2 years ago

Cc: marcello@… added

comment:3 by Hufkratzer, 22 months ago

Here is another example that demonstrates this bug:

The list for generator:type in the preset Nuclear Reactor (defaultpresets.xml) isn't sorted correctly:
shows unsorted list in nuclear reactor preset
("cold-fusion" should follow "China Pressurized Reactor (CPR-1000)" and not precede it; there is no values_sort="false".)

The bug seems to depend on how the display_value's are set (separately with display_value=xxx or all together in a list), see example:
shows result from demo preset source
which comes from

<?xml version="1.0" encoding="UTF-8"?>
<presets xmlns="http://josm.openstreetmap.de/tagging-preset-1.0">
  <group name="Bugdemo" icon="presets/attraction/animal.svg">
    <item name="Sorting Bug" icon="presets/attraction/animal.svg" type="node,closedway,multipolygon">
        <multiselect key="key1" text="display_value's set separately">
            <list_entry value="b" display_value="C" />
            <list_entry value="c" display_value="B" />
            <list_entry value="a" display_value="A" />
        </multiselect>
        <multiselect key="key4" text="display_value's set in a list" values="b;c;a" display_values="C;B;A" />
        <space />
        <combo key="key1" text="display_value's set separately">
            <list_entry value="b" display_value="C" />
            <list_entry value="c" display_value="B" />
            <list_entry value="a" display_value="A" />
        </combo>
        <combo key="key2" text="display_value's set in a list" values="b,c,a" display_values="C,B,A" />
    </item>
  </group>
</presets>

by Hufkratzer, 22 months ago

Attachment: nuclear.png added

shows unsorted list in nuclear reactor preset

by Hufkratzer, 22 months ago

Attachment: bugdemo.png added

shows result from demo preset source

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team to the specified user.
Next status will be 'needinfo'. The owner will be changed from team to Hufkratzer.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from team to anonymous. Next status will be 'assigned'.

Add Comment


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