Ticket #8167 (closed Bug: fixed)

Opened 8 years ago

Last modified 7 years ago

plone.app.linkintegrity does not recognize files with spaces

Reported by: maurits Owned by: maurits
Priority: minor Milestone: 3.1.3
Component: General Version:
Keywords: Cc:


In a fresh plone 3 buildout from paster (Plone 3.1) all tests for plone.app.linkintegrity pass.

When you add LinguaPlone to that buildout (just add Products.LinguaPlone to the eggs) then about 20 percent of the tests for plone.app.linkintegrity fail.

And when you add a File to your Plone Site, make a link from a page to that file, and then remove that File, linkintegrity does not warn you. Indeed <yourpage>.getRefs() returns an empty list so linkintegrity thinks it is fine to delete this file.

LinguaPlone creates references in the reference_catalog with name 'translationOf' and p.a.linkintegrity uses 'isReferencing'. Apparently somewhere along the line they bite each other. I am not sure yet whether this needs a fix in LinguaPlone or in linkintegrity.

I can have a look, but I wanted an official ticket too. :-)

Change History

comment:1 Changed 8 years ago by maurits

The test failures are because LinguaPlone overwrites the default processForm. And I really see no good way around that. So in the linkintegrity test setup I call unmarkCreationFlag on all created objects so any calls to processForm() will not result in renaming of those objects. Then the tests pass again. Committed in r21000.

I will look tomorrow if the problem relating to files is some strange artifact of one buildout plus customer Data.fs where I saw it. I could not reproduce that bug in a fresh buildout with fresh Data.fs

comment:2 Changed 8 years ago by maurits

  • Owner changed from witsch to maurits
  • Keywords LinguaPlone removed
  • Status changed from new to assigned
  • Summary changed from LinguaPlone versus plone.app.linkintegrity to plone.app.linkintegrity does not recognize files with spaces

It turns out LinguaPlone did not have anything to do with this. The problem happens in a default Plone 3 site when you upload a file with spaces. So for example 'My First Word File.doc'.

So to reproduce this:

  • Create a new Plone 3 Site (3.0/3.1).
  • Add a File with spaces in its id.
  • In case the file id gets renamed to e.g. 'My-First-Word-File.doc' rename it yourself again so it has spaces in its id.
  • Add an internal link to that file in for example the front-page.
  • Observe that in reference_catalog no items were added.
  • Rename the file so it has no spaces anymore.
  • Recreate the link on the front-page.
  • Observe that reference_catalog now has an item.

Actually, now that I have discovered what the exact problem is, I can also fix it. I will commit it soon, with a test.

comment:3 Changed 8 years ago by maurits

  • Status changed from assigned to closed
  • Resolution set to fixed

(In [21093]) Fixed the recognizing of links to files (or any object) with a space in the id. Fixes #8167.

comment:4 Changed 8 years ago by witsch

hey maurits,

thanks for taking care of this — i was planning to look into it, but i've been too busy recently. so i was happy to see your fix today! :)



comment:5 Changed 7 years ago by hannosch

  • Component changed from Linkintegrity to Infrastructure

comment:6 Changed 4 years ago by davisagli

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