Project

General

Profile

bug #9142

The Agent search dialog shows duplicated entries

Added by Andreas Müller 10 months ago. Updated 4 months ago.

Status:
Closed
Priority:
New
Assignee:
Category:
taxeditor
Target version:
Start date:
07/10/2020
Due date:
% Done:

90%

Severity:
normal
Found in Version:

Description

This happens in caryo_spp.

Things like this sometimes happen due multiple language representations of a term which is used in the underlying query. There is a workaround for this.

But there might be other reasons.

WGB:
Im Bulk-Editor erscheint das Team nur einmal, und die IDs deuten ja auch darauf hin, dass hier etwas faul ist.

picture893-1.png View (7.99 KB) Andreas Müller, 07/10/2020 04:43 PM

Associated revisions

Revision 359b77dd (diff)
Added by Katja Luther 5 months ago

fix #9142: fix doubled entries in agent selection dialog

Revision f0cf9026 (diff)
Added by Katja Luther 5 months ago

ref #9142: fix getUuidAndAbbrevTitleCache for agents

Revision 84e04ed3 (diff)
Added by Katja Luther 5 months ago

ref #9142: use clazz for FROM statement in getUuidAndAbbrevTitleCache for agents

Revision 3133b77d (diff)
Added by Andreas Müller 4 months ago

ref #9142 code simplification

Revision c955d553 (diff)
Added by Katja Luther 4 months ago

ref #9142: code cleaning

History

#1 Updated by Andreas Müller 10 months ago

  • Description updated (diff)

#2 Updated by Katja Luther 5 months ago

  • Target version changed from Release 5.18 to Release 5.19

#3 Updated by Katja Luther 5 months ago

  • Status changed from New to Resolved
  • Assignee changed from Katja Luther to Andreas Müller

This should be fixed. Please review.

#4 Updated by Katja Luther 5 months ago

  • % Done changed from 0 to 50

#5 Updated by Andreas Müller 5 months ago

can you shortly explain what the problem was and why the commit fixes it?

#6 Updated by Andreas Müller 5 months ago

  • Status changed from Resolved to Feedback
  • Assignee changed from Andreas Müller to Katja Luther

#7 Updated by Katja Luther 5 months ago

  • Status changed from Feedback to Resolved
  • Assignee changed from Katja Luther to Andreas Müller

First I thought it was because the search method was called twice but the real cause was the wrong implementation of the getUuidAndAbbrevTitleCache method.

#8 Updated by Andreas Müller 5 months ago

  • Status changed from Resolved to Feedback
  • Assignee changed from Andreas Müller to Katja Luther

Thats what I thought. It is actually not really a wrong implementation of the method but due to the above described strange behavior of hibernate when using eager loading.

By the way can't we remove the commented line?

Also I wonder if not the more correct way to filter for classes is to use the class parameter in HQL as described here (https://docs.jboss.org/hibernate/orm/3.5/reference/de-DE/html/queryhql.html#queryhql-where) or here (https://stackoverflow.com/questions/8911894/hql-query-for-multiple-types-classes). I guess this way you can also use abstract superclasses like TeamOrPersonBase and do not have to distinguish each case. The current implementation is dangerous whenever the might be a new AgentBase subclass in future and probably does even now not work if you pass "AgenBase.class" as parameter which is a legal argument.

#9 Updated by Katja Luther 5 months ago

  • Assignee changed from Katja Luther to Andreas Müller

Andreas Müller wrote:

Thats what I thought. It is actually not really a wrong implementation of the method but due to the above described strange behavior of hibernate when using eager loading.

By the way can't we remove the commented line?

Also I wonder if not the more correct way to filter for classes is to use the class parameter in HQL as described here (https://docs.jboss.org/hibernate/orm/3.5/reference/de-DE/html/queryhql.html#queryhql-where) or here (https://stackoverflow.com/questions/8911894/hql-query-for-multiple-types-classes). I guess this way you can also use abstract superclasses like TeamOrPersonBase and do not have to distinguish each case. The current implementation is dangerous whenever the might be a new AgentBase subclass in future and probably does even now not work if you pass "AgenBase.class" as parameter which is a legal argument.

I already thought about it, but thought that TeamOrPersonBase would not work, but it work. I changed the implementation in this way, please have a look.

#10 Updated by Andreas Müller 4 months ago

Katja Luther wrote:

Andreas Müller wrote:

Thats what I thought. It is actually not really a wrong implementation of the method but due to the above described strange behavior of hibernate when using eager loading.

By the way can't we remove the commented line?

Also I wonder if not the more correct way to filter for classes is to use the class parameter in HQL as described here (https://docs.jboss.org/hibernate/orm/3.5/reference/de-DE/html/queryhql.html#queryhql-where) or here (https://stackoverflow.com/questions/8911894/hql-query-for-multiple-types-classes). I guess this way you can also use abstract superclasses like TeamOrPersonBase and do not have to distinguish each case. The current implementation is dangerous whenever the might be a new AgentBase subclass in future and probably does even now not work if you pass "AgenBase.class" as parameter which is a legal argument.

I already thought about it, but thought that TeamOrPersonBase would not work, but it work. I changed the implementation in this way, please have a look.

I cleaned up the query code a bit further to make it simpler.

#11 Updated by Andreas Müller 4 months ago

  • Assignee changed from Andreas Müller to Katja Luther
  • % Done changed from 50 to 90

Andreas Müller wrote:

By the way can't we remove the commented line?

I deleted the line and also cleaned up the TaxEditor code further.

There is still the commented code for "createFilter()" starting at line 110. Can this be removed?

The ticket can be closed then.

#12 Updated by Katja Luther 4 months ago

  • Status changed from Feedback to Closed

cleaned the code and close ticket.

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)