Open cdw9 opened 6 years ago
Assuming you are migrating to Dexterity
Could this actually be turned into a behavior? :thinking:
Overall, I do not think its a bug. It's a feature doing things different than you expect them. The normalization and name-choosing is always lower-casing. Usually this is good.
The only part I consider a bug is, on second rename a -1
is chosen. This is probably wrong.
I agree, this could be handled different. While derivation of an ID from from title all is fine. If an ID is explicitly set using a form, it could be taken literally if it is an allowed Zope ID and not conflicting with existing IDs and templates names etc.
URL normalization is handled by an adapter so it should be fairly straightforward to override. I can imagine that different sites might want different policy about how strictly to enforce the normalization.
It is also possible to keep the ids as they are and register a custom case insensitive zope.traversing.interfaces.ITraversable adapter.
@davisagli I want to use capital letters in an ID too. Please let me know how to override the normalizer.
I found the normalizer. https://github.com/plone/plone.i18n/blob/master/plone/i18n/normalizer/__init__.py#L153 I will try to override the method.
Tested in Plone 5.0 and 5.1
What I did:
Added a new folder. In the settings tab, I set the Short name to
Test
, with a capital T. After saving, the id istest
. I click Actions > Rename, and enterTest
again. Now the folder has the idtest-1
.What I expect to happen:
I expect this to keep the capital letters in the ID.
Reasoning:
I'm guessing this change was on purpose, and I agree that urls should be all lowercase. But here is my use case:
I'm working in a migrated site, and the folders created in the migration use capital letters, as they did in the original site. I don't always want to run a full migration to test a specific page, so sometimes I'll add the folders in the path manually. But if I can't create the folders TTW with the capital letters, I have to take extra steps to test the migration for an item that is 5 levels deep in the site.