[issue2551280] [Roundup-users] sorted() method of MultilinkHTMLProperty is broken?

John Rouillard <[email protected]> Mon, 12 Jun 2023 02:42:59 +0000
Newsgroups gmane.comp.bug-tracking.roundup.devel
Message-ID <[email protected]>
New submission from John Rouillard:

------- Blind-Carbon-Copy

From: "John P. Rouillard" <[email protected]>
To: Nagy Gabor <[email protected]>
cc: [email protected]
Subject: Re: [Roundup-users] sorted() method of MultilinkHTMLProperty is broken?
In-reply-to: <20230609120100.0780e9bf@Dell>
References: <20230609120100.0780e9bf@Dell>
Comments: In-reply-to Nagy Gabor <[email protected]>
   message dated "Fri, 09 Jun 2023 12:01:00 +0200."
Reply-To: [email protected]
ZReturn-Receipt-To: [email protected]
ZDisposition-Notification-To: [email protected]
Sender: [email protected]
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <[email protected]>
Content-Transfer-Encoding: quoted-printable
Date: Sun, 11 Jun 2023 22:42:52 -0400

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.

- --
				-- rouilj
John Rouillard
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
My employers don't acknowledge my existence much less my opinions.

------- End of Blind-Carbon-Copy

----------
messages: 7784
nosy: rouilj
severity: normal
status: new
title: [Roundup-users] sorted() method of MultilinkHTMLProperty is broken?

_________________________________________________
Roundup tracker <[email protected]>
<https://issues.roundup-tracker.org/issue2551280>
_________________________________________________