Raptus / raptus.article.core

Provides a configurable article content type (replaces the default Page content type).
0 stars 4 forks source link

computeRelatedItems deprecated #7

Closed davidemoro closed 10 years ago

davidemoro commented 10 years ago

Hi,

the related items component of raptus articles still uses a deprecated python script named computeRelatedItems, no more available on Plone 4.3.2.

See here: https://github.com/Raptus/raptus.article.core/blob/master/raptus/article/core/browser/related.py#L46

With Plone 4.3.2 the related items component is completely broken since the plone_deprecated layer is not registered on portal skins themes.

(Pdb) self.context.computeRelatedItems() *\ AttributeError: computeRelatedItems

davidemoro commented 10 years ago

computeRelatedItems was dropped without providing an alternative ready to be used...

Possible solutions: 1 - reimplement a browserview @@relateditems that returns the same information provided by the old computeRelatedItems script. It should be quite an easy task, we can copy from the related items viewlet (but I don't like code duplication) 2 - does we really need a new related items viewlet for raptus? We can get rid of the existing (broken) related items raptus viewlet and just use the plone's viewlet. Something like that:

<article:component
    name="related"
    component=".related.Component"
    viewlet="plone.app.layout.viewlets.content.ContentRelatedItems"
    manager="plone.app.layout.viewlets.interfaces.IBelowContentBody"
    />

I prefer the solution number 2. Does it make sense for you?

davide

skaeser commented 10 years ago

I prefer a variant of solution number 2:

That way we keep our custom HTML intact and are not breaking existing CSS.

What do you think?

davidemoro commented 10 years ago

+1000

davidemoro commented 10 years ago

Hi @skaeser,

I've implemented the fix, can you review my fork on https://github.com/davidemoro/raptus.article.core? Let me know if it sounds good for you and I'll make a pull request.

davidemoro commented 10 years ago

I've seen a problem with the brain titles, I'll let you know when it is ready

davidemoro commented 10 years ago

Ready to be reviewed.

skaeser commented 10 years ago

Merged and contained in the upcoming release.

davidemoro commented 10 years ago

Thank you @skaeser