Roundup Tracker - Issues

Message7784

Author rouilj
Recipients rouilj
Date 2023-06-12.02:42:58
Message-id <20230612024252.CEC836A01A6@pe15.cs.umb.edu>
In-reply-to
------- 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-12 02:42:59rouiljsetrecipients: + rouilj
2023-06-12 02:42:58rouiljlinkissue2551280 messages
2023-06-12 02:42:58rouiljcreate