Changeset 1245 in products


Ignore:
Timestamp:
Aug 13, 2009 7:59:22 PM (15 years ago)
Author:
mylan
Message:

Fix bug in canonical path adapter for IPossibleWeblogEntry (Document in case of QuillsEnabled?)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.quills.extras/trunk/quintagroup/quills/extras/adapters.py

    r979 r1245  
    1818        purl = getToolByName(self.context,'portal_url') 
    1919        pw = getToolByName(self.context,'portal_workflow') 
    20         if not pw.getInfoFor(self.context, 'review_state') == 'published': 
    21             return '/' + purl.getRelativeContentURL(self.context) 
    22         entry = IWeblogEntry(self.context).__of__(self.context.aq_inner.aq_parent) 
    23         weblog_content = entry.getWeblogContentObject() 
    24         weblog_path = '/' + purl.getRelativeContentURL(weblog_content) 
    25         return '%s/%s' % (weblog_path,'/'.join(getArchivePathFor(entry, weblog_content))) 
     20        relpath = '/' + purl.getRelativeContentURL(self.context) 
     21        if pw.getInfoFor(self.context, 'review_state') == 'published': 
     22            entry = IWeblogEntry(self.context).__of__(self.context.aq_inner.aq_parent) 
     23            weblog_content = entry.getWeblogContentObject() 
     24            if weblog_content is not None: 
     25                weblog_path = '/' + purl.getRelativeContentURL(weblog_content) 
     26                relpath = '%s/%s' % (weblog_path,'/'.join(getArchivePathFor(entry, weblog_content))) 
     27        return relpath 
    2628 
    2729 
Note: See TracChangeset for help on using the changeset viewer.