AttributeError regarding NoneType in Catalog Results
This Error Reference applies to:
Any version.
This Error Reference is intended for:
Any audience.
If your catalog gets out of sync the paths in the catalog will not resolve. Prior to Zope 2.8 you would end up with a NoneType when you called .getObject on a brain. i.e.:
for b in catalog(id='foo'):
if b.getObject() is None:
raise ValueError, 'This catalog entry is no longer in sync'
Typically you want to fix this and find out where in your application this is happening. There are a few ways of looking at it: for instance brains usually have a .getURL attribute that you can see where the location of the object is suppose to be.
There are numerous ways a brain could return None or an exception (in Zope 2.8) - for instance a ConflictError.
'NoneType' object has no attribute 'Title'
1) whilst editing any object for which related content can be specified, in the pop-up window for selecting related content, if I search for terms graham or perrin (my forename and surname) Plone presents the following AttributeError:
NoneType object has no attribute Title
Not logged
Incidentally, this error leaves nothing in the error log.
'NoneType' object has no attribute 'getId'
2) Whilst editing an article's links, if I browse for links, in the pop-up window (a slightly different dialogue) if I search for the same terms a different AttributeError occurs and does appear in the log:
NoneType object has no attribute getId
How to Resync Catalog
ZMI -> portal_catalog -> Advanced tab -> Update Catalog button.
Depending on size of the system this could take a very long time.
Running Zope 2.8.x series or greater should decrease None entries in catalogs.
Catalog update does not resolve the issue
Thanks for the prompt response :-)
Beyond a normal update, which unfortunately did not resolve the problem, portal_catalog has also been cleared then rebuilt (Find Objects dialogue, finding all objects). Still the error occurs.
Further details at http://article.gmane.org/gmane.comp.web.zope.plone.user/53971/
I note Zope 2.9.3 included with the new Plone 2.5 installer for Mac OS X 10.4, but our Mac OS X Server is currently limited to 10.3.9.
Considering the symptoms/circumstances, how confident can we be that an upgrade to 2.5 might resolve the issue?
On one hand, I might shift the service to a host that's running Mac OS X 10.4...
...on the other hand, the site in which the error occurs is an experiment, a proof-of-concept before we select Plone for a production environment. Which makes me rather keen to resolve the issue without resorting to major/minor OS/Plone upgrades!
TIA for any further thoughts.
Best, Graham
Steps to find and fix?
For the benefit of those of us who are not too familiar with the ZMI, please, can someone offer advice on how to find and resolve errors of this type?