Ticket #11151 (closed Bug: fixed)

Opened 4 years ago

Last modified 3 years ago

ATTopic's ATSortCriterion and GopipIndex

Reported by: petschki Owned by: witsch
Priority: minor Milestone: 4.x
Component: Archetypes Version:
Keywords: TuneUp green-belt Cc: pigeonflight, ken.manheimer@…

Description

right now, the "getObjPositionInParent" index is not selectable as a sort criterion due to its new catalog index "GopipIndex"

you can patch this in your zope2 products initialize() function like

from Products.ATContentTypes.criteria import registerCriterion, SORT_INDICES
from Products.ATContentTypes.criteria.sort import ATSortCriterion


def initialize(context):
    """Initializer called when used as a Zope 2 product."""
    # add getObjPositionInParent to topic sort criterions
    registerCriterion(ATSortCriterion, SORT_INDICES + ('GopipIndex', ))

but wouldn't it be nice, if GopipIndex is added to SORT_INDICES per default ? regards

Change History

comment:1 in reply to: ↑ description ; follow-up: ↓ 2 Changed 4 years ago by witsch

Replying to petschki:

but wouldn't it be nice, if GopipIndex is added to SORT_INDICES per default ?

yes, it would! :) i'm wondering though, why it's not added by default — it is a proper index object after all...

comment:2 in reply to: ↑ 1 Changed 4 years ago by witsch

  • Keywords TuneUp35 added
  • Status changed from new to assigned
  • Type changed from Feature Request to Bug
  • Owner set to witsch

Replying to witsch:

Replying to petschki:

but wouldn't it be nice, if GopipIndex is added to SORT_INDICES per default ?

yes, it would! :) i'm wondering though, why it's not added by default — it is a proper index object after all...

hanno just suggested that the class might have to be registered (as an index) for it to be added. i'll have a look on friday...

comment:3 follow-up: ↓ 4 Changed 4 years ago by petschki

Products.ATContentTypes.criteria.SORT_INDICES is a static tuple ... maybe there could be some more "magic" :-)

ps: world record reply time, by the way ;-)

comment:4 in reply to: ↑ 3 Changed 4 years ago by witsch

Replying to petschki:

Products.ATContentTypes.criteria.SORT_INDICES is a static tuple ... maybe there could be some more "magic" :-)

ah, that would explain it, i guess.

ps: world record reply time, by the way ;-)

pure luck — it's pretty rare these days that i hang out on the fwt channel _and_ also pay attention... :(

comment:5 Changed 4 years ago by kiorky

  • Keywords TuneUp35,green-belt added; TuneUp35 removed

comment:6 Changed 3 years ago by cganz

  • Keywords TuneUp green-belt added; TuneUp35,green-belt removed

comment:7 Changed 3 years ago by klm

  • Cc ken.manheimer@… added

this patch is still necessary in Plone 4.0.7 in order to be able to use getObjPositionInParent as a sort order criterion in collections. could the fix please be incorporated in plone, proper?

comment:8 Changed 3 years ago by pigeonflight

I've created a policy add-on that fixes this issue for Plone 4.1.x, haven't tested it on Plone 4.0.x it is available here:  https://bitbucket.org/alteroo/cepaddgopip.policy (version 1.0.2) works for me.

comment:9 Changed 3 years ago by pigeonflight

  • Cc pigeonflight added

comment:10 Changed 3 years ago by davisagli

(In [52333]) re-enable the gopip index, refs #11151

comment:11 Changed 3 years ago by davisagli

(In [52335]) re-enable the gopip index, refs #11151

comment:12 Changed 3 years ago by davisagli

(In [52336]) merge gopip index upgrade step from trunk, refs #11151

comment:13 Changed 3 years ago by davisagli

  • Status changed from assigned to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.