[Zope-CMF] Old Portal File items have lost their connection with the portal_types tool

Tres Seaver tseaver@zope.com
Wed, 13 Feb 2002 09:37:55 -0500


Lucas Hofman wrote:
> Lucas Hofman wrote:
> 
>> The data in my site has been entered using various PTK/CMF versions. I 
>> just found out that old portal items, probably entered during the 
>> PTK0.9 time seem to have lost their connection with the portal types 
>> tool.
>>
>> They are searchable by searching on metatype='Portal File', but when 
>> selected in the list of searchresults the following error comes up:
>>
>> Error Type: Not Found
>> Error Value: Cannot find default view for 
>> "/research/Members/lucas/copy_of_Access.doc"
>>
>> (the URL asked for is 
>> http://web.research.pgs.com/Members/lucas/copy_of_Access.doc/view)
>>
>> In 'my stuff' these items are displayed with the DTML-Document icon, 
>> instead of the portal file icon. When selecting one of these items, no 
>> object actions are displayed in the action box
>>
>> What could cause this behaviour, and how could it be repaired?
>>
> Found it. For the record, in case anyone notices the same:
> 
> 
> This behaviour was caused by old Portal_File items having a funny value 
> for the 'portal_type' attribute. The value was 'None'. After (with an 
> external method) setting this to 'File' everything behaved normal againg.
> 
> The same was the case for old Portal_Image items.

I recall fixing behaviour related to such a bug somewhere in the
past year;  essentially, any object whose 'meta_type' didn't match
'portal_type' (CMFDefault.Image and File were the ones affected
out of the box) wouldn't find its type information object.

Newly-created objects all get their 'portal_type' explicitly set
immediately after construction in 'invokeFactory'.

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com