senaite / senaite.core

Enterprise Open Source Laboratory System (LIMS)
https://senaite.com
GNU General Public License v2.0
254 stars 145 forks source link

Un-catalog orphan brains on uid_catalog's clean-up (upgrade step 2610) #2502

Closed xispa closed 8 months ago

xispa commented 8 months ago

Description of the issue/feature this PR addresses

This Pull Request uncatalogs orphan brains to upgrade step 2610

Current behavior before PR

Traceback (innermost last):                                                                                                                                                                                        
  Module ZPublisher.WSGIPublisher, line 176, in transaction_pubevents                                                                                                                                              
  Module ZPublisher.WSGIPublisher, line 385, in publish_module                                                                                                                                                     
  Module ZPublisher.WSGIPublisher, line 288, in publish                                                                                                                                                            
  Module ZPublisher.mapply, line 85, in mapply                                                                                                                                                                     
  Module ZPublisher.WSGIPublisher, line 63, in call_object                                                                                                                                                         
  Module Products.CMFPlone.controlpanel.browser.quickinstaller, line 666, in __call__                                                                                                                              
  Module Products.CMFPlone.controlpanel.browser.quickinstaller, line 399, in upgrade_product                                                                                                                       
  Module Products.GenericSetup.tool, line 1202, in upgradeProfile                                                                                                                                                  
  Module Products.GenericSetup.upgrade, line 185, in doStep                                                                                                                                                        
  Module senaite.core.upgrade.v02_06_000, line 545, in cleanup_uid_catalog                                                                                                                                         
AttributeError: 'NoneType' object has no attribute 'getPhysicalPath'

Desired behavior after PR is merged

System checks and uncatalog orphan brains before removal of duplicates and temporaries

-- I confirm I have tested this PR thoroughly and coded it according to PEP8 and Plone's Python styleguide standards.