Ticket #12402 (closed Bug: fixed)

Opened 2 years ago

Last modified 2 years ago

plone.app.linkintegrity misses references when the relative path starts with characters in the portal URL

Reported by: yomatters Owned by:
Priority: minor Milestone:
Component: General Version: 4.1
Keywords: link integrity Cc:

Description

The problem is in findObject (plone.app.linkintegrity.handlers):

components = path.lstrip(portal_path + '/').split('/')

For example:

>>> portal_path = '/foo/bar'
>>> path = '/foo/bar/food/image'
>>> components = path.lstrip(portal_path + '/').split('/')
>>> components
['d', 'image']

Traversing using those path components does not lead to the intended object, which results in the reference to the image being silently missed.

Change History

comment:1 Changed 2 years ago by kleist

  • Component changed from Unknown to Infrastructure

Which Plone version please?

comment:2 Changed 2 years ago by davisagli

  • Status changed from new to closed
  • Version set to 4.1
  • Resolution set to fixed
  • severity set to Untriaged

Fixed in  https://github.com/plone/plone.app.linkintegrity/commit/40bb1c696560df046b9b5144ffc5dd3b58be5dd6

Too bad I only found and remembered this ticket after debugging the issue myself. No wonder that lstrip thing looked familiar... :)

comment:3 Changed 2 years ago by mj

I re-fixed the fix; see  c281e98, where we do not assume that absolute paths always start with the portal id.

comment:4 Changed 22 months ago by davisagli

  • Component changed from Infrastructure to General
Note: See TracTickets for help on using tickets.