uncatalog comments from the old location of the item being moved, not its parent
svn path=/plone.app.discussion/trunk/; revision=51692
This commit is contained in:
		
							parent
							
								
									2b10fd06e2
								
							
						
					
					
						commit
						2bf5b43df5
					
				@ -16,7 +16,7 @@ Changelog
 | 
			
		||||
 | 
			
		||||
- Make sure only comments to the content object are removed from the catalog
 | 
			
		||||
  when the content object is moved.
 | 
			
		||||
  [hannosch, timo]
 | 
			
		||||
  [hannosch, timo, davisagli]
 | 
			
		||||
  
 | 
			
		||||
- Make sure the conversation.getComments method returns acquisition wrapped 
 | 
			
		||||
  comments.
 | 
			
		||||
 | 
			
		||||
@ -227,8 +227,9 @@ def notify_content_object_moved(obj, event):
 | 
			
		||||
        return
 | 
			
		||||
    # Remove comments at the old location from catalog
 | 
			
		||||
    catalog = getToolByName(obj, 'portal_catalog')
 | 
			
		||||
    old_path = '/'.join(event.oldParent.getPhysicalPath() + (event.oldName,))
 | 
			
		||||
    brains = catalog.searchResults(dict(
 | 
			
		||||
                 path={'query': '/'.join(event.oldParent.getPhysicalPath())},
 | 
			
		||||
                 path={'query': old_path},
 | 
			
		||||
                 portal_type="Discussion Item"
 | 
			
		||||
                 ))
 | 
			
		||||
    for brain in brains:
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user