Ticket #9012 (closed defect: fixed)

Opened 8 years ago

Last modified 8 years ago

Determine if there are more file naming conflicts

Reported by: ew2 Owned by: jccooper
Priority: high Milestone: Hot Fixes
Component: Content Editing Version:
Severity: major Keywords:
Cc: kef, ew2 System Area: Authoring
Primary Skill: Python
Site URL:
Suppress email to reporter: no

Description

Refer to #8990

  • Need to write a test script to check if there are other files similar to font.png that would cause a similar problem.
  • Script would get list of file names from database and try to add them to a folder. The correct behavior is an error stating that the file name is reserved.

Change History

  Changed 8 years ago by reedstrm

script checked in at [27973] Implementation uses the actual check from CMFCore

Current output:

m12664 font.png
m12193 font.png
m12983 font.png
m11158 h.png
m11454 h.png
m11161 image.png
m10942 image.png
m12058 image.png
m11011 image.png
m12207 text.png
m12209 text.png
m12205 text.png
m15848 unknown.png
m12193 up.png

14 modules affected by 6 files, all in the MimetypesRegistry? Product:

/opt/instances/cnx/Products/MimetypesRegistry/skins/mimetypes_icons/font.png
/opt/instances/cnx/Products/MimetypesRegistry/skins/mimetypes_icons/h.png
/opt/instances/cnx/Products/MimetypesRegistry/skins/mimetypes_icons/image.png
/opt/instances/cnx/Products/MimetypesRegistry/skins/mimetypes_icons/text.png
/opt/instances/cnx/Products/MimetypesRegistry/skins/mimetypes_icons/unknown.png
/opt/instances/cnx/Products/MimetypesRegistry/skins/mimetypes_icons/up.png

  Changed 8 years ago by jccooper

We could just toss the mimetypes_icons layer. I don't think it faces anything outside the ZMI.

  Changed 8 years ago by reedstrm

  • status changed from new to accepted

Cameron suggests that the entire mimetypes_icons skins layer isn't used in user-facing ways. I've grepped the code, and only find these:

./PortalTransforms/www/editTransformsChain.zpt down.png
./PortalTransforms/www/editTransformsChain.zpt up.png
./Rhaptos/CNXMLTransforms/Extensions/Install.py text.png
./Rhaptos/CNXMLTransforms/Extensions/Install.py tgz.png
./Rhaptos/RhaptosCollection/types/Collection.py icons/unknown.png

Worst case, an image goes missing,as compared to 14 uneditable modules. I'm pulling the skin right now.

  Changed 8 years ago by jccooper

PortalTransforms? items are ZMI, and in a bit no one's likely to look at.

The CNXMLTransforms just adds an icon to some mimetypes we create; these would be used no more than we use any of the other icons.

The RhaptosCollection? points out the one place where we do, apparently, use the mimetype icons: multimedia zip export.

icon_path is what to look for to determine if these icons are used dynamically. We find that in MM zip and Archetypes 'getBestIcon' (which degrades gracefully if it doesn't find the mimetypes icon, and which I don't know that we even use: it's only on ImageField? and FileField? display widgets.)

So: MM zip is the only problem with this.

  Changed 8 years ago by ew2

  • status changed from accepted to closed
  • resolution set to fixed

In discussions with Chuck and Ross, it seems this is fixed for now. The script is checked in and available, so we can check for this problem again at a later date.

  Changed 8 years ago by reedstrm

  • status changed from closed to accepted
  • resolution fixed deleted

Reran the script: we've got a new hit, in our own code:

found 18449 filenames
m12205 pencil.png
m12207 pencil.png
m12209 pencil.png

This appears in:

 RhaptosContent/skins/rhaptos_content/pencil.png

We should probably rename that, since those three modules are now currently not editable.

  Changed 8 years ago by reedstrm

Do we have a bug for "we really really need a work around for this"? BTW, pencil.png (as well as tags.png, tags-closed.png, tags-open.png, empty_star.png, full_+star.png, half_star.png, endorsed.gif) came in w/ siyavula-phase-1

follow-up: ↓ 9   Changed 8 years ago by jccooper

Since pencil.png is completely in our domain, we should rename it to something less likely. We can slip it into MEW if it is not actually a hotfix (though it probably should be.)

in reply to: ↑ 8   Changed 8 years ago by reedstrm

Replying to jccooper:

Since pencil.png is completely in our domain, we should rename it to something less likely. We can slip it into MEW if it is not actually a hotfix (though it probably should be.)

Right, as I said above. These three modules can not be checked out, at all. I vote leaving this a hotfix, for what it's worth.

  Changed 8 years ago by jccooper

  • owner changed from reedstrm to jccooper
  • status changed from accepted to working

  Changed 8 years ago by jccooper

  • status changed from working to testing

(In [28195]) Rename pencil.png to pencil_cnx.png to avoid stomping on module content of the same name; fix #9012 on trunk as hot fix. And while I'm here, use portal_url paths instead of wrong / paths

  Changed 8 years ago by jenn

  • cc kef, ew2 added; kef jccooper removed
  • status changed from testing to assigned

My understanding was that we should now be able to upload something called pencil.png and have it work; just not something called pencil_cnx.png. But I get a validation message that says "pencil.png is reserved" if I try.

  Changed 8 years ago by jccooper

Yes, pencil.png should be available.

  Changed 8 years ago by reedstrm

Cameron, looks like [28195] went partly on trunk, partly on mew-phase-1

  Changed 8 years ago by jccooper

  • status changed from assigned to working

Yes, RhaptosContent?, the important part, got lost. Fixing.

  Changed 8 years ago by jccooper

  • status changed from working to testing

(In [28234]) redo r28195 on trunk; it was accidentally put on the mew-phase-1 branch. fix #9012

  Changed 8 years ago by jenn

  • status changed from testing to closed
  • resolution set to fixed

This actually went out on 6/8.

Note: See TracTickets for help on using tickets.