Bug #3277

Sorting treeview error when mixing identifiers with none identifiers

Added by Anonymous over 10 years ago. Updated over 7 years ago.

Status:VerifiedStart date:
Priority:CriticalDue date:
Assignee:David Juhasz% Done:

0%

Category:-
Target version:Release 1.3
Google Code Legacy ID:atom-1327 Tested version:
Sponsored: Requires documentation:

Description

Google user: vermeye...@gmail.com

To reproduce this error: ========================
1)Set treeview on sort by identifier-title
2)create objects with and without identifiers
3)view archival description

Resulting error: ================
Treeview doesn't sort well due to the fact that there are null values in
the identifier.

Expected result: ================
Treeview should ignore the null value(which can't be sorted) and sort on
title instead.

I've temporarily fixed this in my installation by setting a default value
for identifier and changing the condition in isad.class.php to exclude the
default-value from the composed identifier(in this case 'geen'):

<application_root>/lib/isad.class.php

if (($ancestor->getIdentifier()) and ($ancestor->getIdentifier() !=
'geen')) {
$identifiers[] = $ancestor->getIdentifier();
}

This is off course a dirty hack, but it does the trick and the default is
only visible while editing the information object.

Cheers,

Maarten

[g] Legacy categories: Hierarchy

treeviewIDerror.png (8.12 KB) Jessica Bushey, 12/01/2012 02:38 AM

TreeviewIDerrorSort.png (7.83 KB) Jessica Bushey, 12/01/2012 02:38 AM

Treesort-Manual.png (4.42 KB) Jessica Bushey, 12/01/2012 02:38 AM

TreeSort-Identifier.png (3.59 KB) Jessica Bushey, 12/01/2012 02:38 AM

TreeSort-Title.png (13.2 KB) Jessica Bushey, 12/01/2012 02:38 AM

Tree-Sort-Title.png (12.5 KB) Jessica Bushey, 12/01/2012 02:38 AM

Tree-Sort-Id-Title.png (10.2 KB) Jessica Bushey, 12/01/2012 02:38 AM

school-photographs;ead.xml Magnifier (4.71 KB) Jessica Bushey, 12/01/2012 02:38 AM

Tree-sort-manual2.png (18.6 KB) Jessica Bushey, 12/01/2012 02:38 AM

Tree-sort-title2.png (16.1 KB) Jessica Bushey, 12/01/2012 02:38 AM

Tree-sort-Identifier-title2.png (18.5 KB) Jessica Bushey, 12/01/2012 02:38 AM

History

#1 Updated by Evelyn McLellan over 10 years ago

  • Priority changed from Medium to High
  • Target version set to Release 1.0.9

Upgrading to high for release 1.0.9.

[g] Labels added: Priority-High, Milestone-Release-1.0.9, Component-Hierarchy
[g] Labels removed: Priority-Medium
[g] New owner: Jesús García Crespo

#2 Updated by Evelyn McLellan over 10 years ago

  • Status changed from New to Won't fix

Won't fix because user can choose to sort information objects alphabetically in
treeview if that is the preferred sort order. When sorting by identifier it is the
desired behaviour to have objects without identifiers appear at the top of the
treeview hierarchy.

#3 Updated by Anonymous over 10 years ago

It is indeed desired that the ones without identifier appear on top. The ones on top
appear in totally random order, because they are a concatanation of a null value and
a non null value, which results in null. The resulting order of the null values will
be determined by the order in wich mysql returns the results, which is highly
undesirable, if you ask me.

#4 Updated by Evelyn McLellan over 10 years ago

  • Status changed from Won't fix to In progress
  • Priority changed from High to Medium
  • Target version changed from Release 1.0.9 to Release 1.1

Sorry, Maarten, I didn't fully understand what you were saying. You're right, it
would be good to have the descriptions without identifier values sort in title order
at the top of the treeview. I'm re-opening this issue for release 1.1. Thanks for
your input.
-Evelyn

[g] Labels added: Priority-Medium, Milestone-Release-1.1
[g] Labels removed: Priority-High, Milestone-Release-1.0.9

#5 Updated by Anonymous about 10 years ago

  • Priority set to Low

[g] Labels added: Priority-Low

#6 Updated by Evelyn McLellan almost 10 years ago

  • Target version set to Release 1.2

Moved to 1.2.

[g] Labels added: Milestone-Release-1.2

#7 Updated by David Juhasz over 8 years ago

  • Target version set to Release 1.3

Roll over to Release 1.3

[g] Labels added: Milestone-Release-1.3

#8 Updated by Jesús García Crespo about 8 years ago

  • Status changed from In progress to QA/Review

I think it is fixed after r12062. I have not tested it fully though.

#9 Updated by Jessica Bushey about 8 years ago

Weird things are happening...

First screenshot (treeviewIDerror) is when I added identifiers to all child levels. Then when I clicked on "Item 02" in the treeview a duplication of "Item 03" can be seen in the treeview. This is not correct behaviour. There should only be one "Item 03".

Second screenshot (TreeviewIDerrorSort) is when I added child levels without identifiers. As you can see "Item Milly d" appears randomly within the treeview hierarchy and "Item 02" is missing from the treeview. This is not correct behaviour. Shouldn't the ordering be consistent - either all numbers first or alphabetical according to title and that means Jenny and Johnny would be together and Mikey and Milly would follow. ??

#10 Updated by Anonymous about 8 years ago

- Missing comment -

#11 Updated by Jesús García Crespo almost 8 years ago

  • Status changed from Feedback to QA/Review

David, could you take a look?

You can find the piece of code involved in this bug under QubitInformationObject.class.php, lines 1695 - 1730.

Using an extra LPAD for the title column fixes it, but I don't think that is feasible since the string could be very long. Is there any solution?

[g] New owner: David Juhasz

#12 Updated by Jesús García Crespo almost 8 years ago

  • Status changed from QA/Review to Feedback

#13 Updated by David Juhasz almost 8 years ago

  • Status changed from Feedback to New

I'll have a look.

#14 Updated by David Juhasz almost 8 years ago

Fixed duplicates (screen 1) in r12169.

#15 Updated by David Juhasz almost 8 years ago

  • Status changed from New to QA/Review

Fixed in r12175

#16 Updated by Jessica Bushey almost 8 years ago

I tested on a Fonds with Series and Items:

Treeview Sort Manual results: I could not click on the arrow at the Fonds level. It was there, but no action. I could not see any lower child-levels using the treeview. See screenshot titled TreeSort-Manual

Treeview Sort Identifier results: I could click on the arrow at the Fonds level and Series level, but only two items were listed in the treeview at the item-level. These are records that do not have an alphanumeric id prior to the level. See screenshot titled TreeSort-Identifier

Treeview Sort Title results: I could click on the arrow at the Fonds level and Series level, and all the item-level records were shown. See screenshot titled TreeSort-Title

#17 Updated by David Juhasz almost 8 years ago

Jessica, please provide an import file for you test Fonds so I can test locally.

#18 Updated by David Juhasz almost 8 years ago

The arrow clicking problem is reported in /p/qubit-toolkit/issues/detail?id=2417, please follow up in that issue report.

#19 Updated by Jessica Bushey almost 8 years ago

I included a file in /p/qubit-toolkit/issues/detail?id=2417 for testing the arrow click/open error.

#20 Updated by Jessica Bushey almost 8 years ago

Tested treeview with mixing identifiers and none identifiers, still having problems:

If I sort treeview by Title I get inaccurate results in the treeview, see attached file Tree-Sort-title

If I sort treeview by Identifier-title I get a duplication of an item in the treeview (MacKinnon item is show twice), see attached file Tree-Sort-ID-title

#21 Updated by Jessica Bushey almost 8 years ago

here is a test file of a series with item-level records that include identifiers (e.g., 1 and 01) and no identifiers (e.g., Jennifer Flowers)

#22 Updated by David Juhasz almost 8 years ago

  • Status changed from Feedback to QA/Review

Fixed in r12179

#23 Updated by David Juhasz almost 8 years ago

Note that strings + numbers will not sort in a "natural" order, so identfiers:
IMG 1
IMG 2
IMG 10
IMG 100

Will sort:
IMG 1
IMG 10
IMG 100
IMG 11
IMG 2

See http://www.codinghorror.com/blog/2007/12/sorting-for-humans-natural-sort-order.html for a description of this problem, and see http://bugs.mysql.com/bug.php?id=1588 for a feature request for MySQL support of natural sorting from 2003. :(

#24 Updated by Jessica Bushey almost 8 years ago

I retested and got the following:

Sort order by Manual see attached file: 'Tree-sort-manual2'

Sort order by Title see attached file: 'Tree-sort-title2'

Sort order by Identifier-title see attached file: 'Tree-sort-identifier-title2'

In response to initial user comment that information objects without identifiers are sorted at the top and in alphabetical order - this has been achieved in the identifier-title sort option in the administrator settings.

Also available in: Atom PDF