Roundup Tracker - Issues

Issue 2551280

classification
[Roundup-users] sorted() method of MultilinkHTMLProperty is broken?
Type: crash Severity: major
Components: Web interface Versions: 2.2.0, 2.1.0
process
Status: fixed fixed
:
: rouilj : rouilj
Priority: high :

Created on 2023-06-12 02:42 by rouilj, last changed 2023-06-22 03:43 by rouilj.

Messages
msg7784 Author: [hidden] (rouilj) Date: 2023-06-12 02:42
------- Blind-Carbon-Copy

From: "John P. Rouillard"
To: Nagy Gabor
Subject: Re: [Roundup-users] sorted() method of MultilinkHTMLProperty is broken?

Hi Gabor:

In message <20230609120100.0780e9bf@Dell>, Nagy Gabor writes:
>I am using Roundup 2.1.0, and I cannot get the sorted() method of
>MultilinkHTMLProperty to work in the web interface.
>
>In schema.py, the class "issue" has the following definition:
>[...]
>When I try to list the documents of an issue, according to the Roundup
>documentation, I am trying to do this in issue.item.html:
>
><tr tal:repeat=3D"i python:context.documents.sorted('d_feltoltes', revers=
e=3DTrue)">
>
>And this leads to "KeyError: 'd_feltoltes'", induced by the command =

>
>prop =3D self._db.getclass(self._classname).getprops()[property]
>
>in cgi/templating.py/MultilinkHTMLProperty/sorted().
>
>After replacing self._classname to self._prop.classname in that codeline,
>it seems to work as expected.
>
>Am I completely oversee something, or this sorted() method is broken,
>but nobody uses it?

I think the method is broken. That code (along with some other
templating code) is not covered by the test suite, so it is quite
possible this bug has existed for the past 2 years.

Your fix looks correct as far as I can tell by walking through the code
in the debugger.

I have committed your fix in:  changeset:   7478:d267b0454500

Thanks for the report and the fix.

[ edited to remove extra headers and email addresses. -- rouilj ]
History
Date User Action Args
2023-06-22 03:43:31rouiljsettype: behavior -> crash
2023-06-12 02:44:20rouiljsetstatus: new -> fixed
priority: high
assignee: rouilj
severity: normal -> major
components: + Web interface
versions: + 2.1.0, 2.2.0
type: behavior
resolution: fixed
2023-06-12 02:42:59rouiljcreate