Ticket #350 (new defect)

Opened 16 years ago

Last modified 14 years ago

Cannot create "start" and "end" files in folders, because getContentInfo.py uses those methods or attributes for listing folder contents

Reported by: madarche Owned by: bdelbosc
Priority: P2 Milestone: CPS 3.5.7
Component: CPSDefault Version: 3.0.0
Severity: minor Keywords:
Cc:

Description (last modified by fguillaume) (diff)

Because getContentInfo.py tries to call the "start" and "end" methods or retrieves the "start" and "end" on the document it inspects, creating documents named "start" or "end" causes errors.

Also browsing through a CPSLocalFS linked to a system directory that has files "start", for example a Nuxeo average Zope instance, causes errors.

Maybe the good way to procede would be for getContentInfo.py to check if some methods, but *not attributes*, named "start" or "end" exists and if so to call them.

But is it possible in Zope-python to test if a method and not an attribute exists ?

Change History

comment:1 Changed 16 years ago by disabled-hc@…

But is it possible in Zope-python to test if a method and not an attribute exists ?

I remember something about a method name "callable()" or so.

comment:2 Changed 16 years ago by disabled-hc@…

Anyway, are changes made in version 1.32 of any good?

comment:3 Changed 16 years ago by disabled-hc@…

I proposed to rename those catalog field to less generic names like start_date & end_date.

comment:4 Changed 16 years ago by bdelbosc

start and end are defined into CMFCalendar as we follow the same interface for our events I don't think it is good idea to rename these attributes furether more you have to check for start & end anyway to be compatible with existing events

comment:5 Changed 16 years ago by disabled-hc@…

  • Cc hc@… added

Ok, another CMF conceptual stuff ;-)

Anyway, those are fixed now?

comment:6 Changed 16 years ago by madarche

No it's not fixed : try to create a document that's called "start" or "end".

The code that needs a fix is the following in getContentInfo.py :

if hasattr(doc.aq_explicit, 'start'):

if callable(doc.start):

start = doc.start()

else:

start = doc.start

if start:

infostart? = start infostart_str? = context.getDateStr(start)

if hasattr(doc.aq_explicit, 'end'):

if callable(doc.end):

end = doc.end()

else:

end = doc.end

if end:

infoend? = end infoend_str? = context.getDateStr(end)

comment:7 Changed 15 years ago by fguillaume

We should get start/end only for subclasses of know types, otherwise it's too much of a pain.

comment:8 Changed 14 years ago by fguillaume

  • Description modified (diff)
  • Milestone changed from unspecified to CPS 3.5.0
Note: See TracTickets for help on using tickets.