[Zope-CMF] Re: problems w/ 'File' type in CMF 1.6

Rob Miller ra at burningman.com
Tue Nov 29 02:47:28 EST 2005


Florent Guillaume wrote:
> Rob Miller wrote:
> 
>> in trying to get Plone working against the 1.6 branch i've come across 
>> some problems w/ the way that CMFDefault.File.File is working since 
>> the base classes have been reordered.
>>
>> the biggest problem has to do w/ the default view lookup.  when 
>> OFS.Image.File was the first base class, then that class's index_html 
>> method would be used as the default view.  with PortalContent first, 
>> however, index_html is None.  this causes ZPublisher to use __call__, 
>> but this then calls queryMethodId('(Default)') on the FTI, which 
>> returns index_html, which is still None.  when i add CMF File objects 
>> in a Plone site and try to browse to them, i'm getting 404s; in a pure 
>> CMF site i get a notice that 'index_html' has an empty or missing 
>> docstring.
> 
> I'll check that. Pointing index_html to the OFS one is probably sufficient.

this seems to be working; i've checked it in.  i just set:

index_html = OFS.Image.File.index_html

rather than defining another method that delegates, which is what 
CMF.Image.Image does.  seems like it should suffice...

>> the other problem, not as big an issue, has to do with the comment 
>> that is immediately after the File class definition; it explicitly 
>> says that the base classes should not be reordered b/c this would 
>> cover up the id() method in the OFS.Image.File class.  using getId() 
>> will always work, of course, and i'm not even sure that covering the 
>> id() method will actually break anything, but it probably deserves a 
>> little bit of investigation and, if all is well, we should remove the 
>> misleading comment.
> 
> Ah yes, actually I'm taking care of all that by using the 
> standard-for-quite-some-time getId(), and making sure the id is stored 
> in the id attribute (and not __name__ anymore) using _setId explicitely. 
> I also keep a backward compat id() method for old instances.
> 
> I'll remove the old comment that threw you off.

removed the comment in both File and Image classes.

-r



More information about the Zope-CMF mailing list