plone/plone.app.blob — pull request #5 by pbauer (2013-03-15 14:37:06+00:00)
Title: Make sure the id is safe before setting the filename as id

When translating a object with a blob as primary field using LinguaPlone a copy is created before you can edit the translated object. That works well. When you translate it into another language then the id will be the same as the first translated item and we'll get the following traceback:

```
Traceback (innermost last):
Module ZPublisher.Publish, line 126, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 46, in call_object
Module Products.LinguaPlone.browser.translate, line 54, in __call__
Module Products.LinguaPlone.I18NBaseObject, line 112, in addTranslation
Module Products.LinguaPlone.utils, line 509, in createTranslation
Module Products.LinguaPlone.utils, line 574, in copyFields
Module Products.LinguaPlone.utils, line 568, in copyField
Module archetypes.schemaextender.field, line 68, in mutator
Module Products.LinguaPlone.utils, line 154, in generatedMutator
Module plone.app.blob.subtypes.image, line 22, in set
Module plone.app.blob.field, line 272, in fixAutoId
Module Products.Archetypes.BaseObject, line 215, in setId
Module plone.folder.ordered, line 187, in manage_renameObject
Module OFS.CopySupport, line 348, in manage_renameObject
CopyError:
Invalid Id
The id "schrift_rot.jpg" is invalid--it is already in use.
```
It only happens when the translated items end up in the same folder (still a frequently used setup).