plone / plone.app.linkintegrity

link integrity checking for Plone content
https://pypi.org/project/plone.app.linkintegrity
6 stars 9 forks source link

Error extracting links from rich text fields #85

Open ale-rt opened 2 years ago

ale-rt commented 2 years ago

I spotted this traceback in one of my sites logs:

  Module plone.app.linkintegrity.handlers, line 116, in modifiedContent
  Module plone.app.linkintegrity.retriever, line 66, in retrieveLinks
  Module plone.app.contenttypes.behaviors.richtext, line 41, in text
AttributeError: 'RequestContainer' object has no attribute 'text'
ale-rt commented 2 years ago

The problem happens here: https://github.com/plone/plone.app.linkintegrity/blob/aff8c11c936d5cc90e8c15d2faaa0c95d1038440/plone/app/linkintegrity/retriever.py#L66

The traceback says that it cannot get the default value for the text field so it goes up in to the acquistion chain until it reaches the zope app and then it throws the attribute error.

Proably the line should be fixed like this:

value = getattr(schema(aq_base(self.context)), name, None)