Re: sorted() method of MultilinkHTMLProperty is broken?

"John P. Rouillard" <[email protected]>
Newsgroups gmane.comp.bug-tracking.roundup.user
Message-ID <[email protected]>
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="i python:context.documents.sorted('d_feltoltes', reverse=True)">
>
>And this leads to "KeyError: 'd_feltoltes'", induced by the command 
>
>prop = 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
===========================================================================
My employers don't acknowledge my existence much less my opinions.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.