Problem/Motivation
- While working on #2248767: Use fast, local cache back-end (APCu, if available) for low-write caches (bootstrap, discovery, and config), I ran into the problem that LanguageConfigFactoryOverride::createConfigCollectionName() creates a collection name that violates the documented (but not enforced except when a specific backend chokes on a character it can't cope with), restriction on collection names in StorageInterface::createCollection(), because language codes contain hyphens.
- Mapping langcode hyphens to collection name underscores seems natural, except LanguageFormBase::validateCommon() currently allows underscores too, despite that not being allowed by the RFC referenced by http://www.w3.org/International/articles/language-tags/.
- In reading that RFC, I found that it allows numbers in language codes. Would numbers be problematic in config collection names?
Proposed resolution
Figure out how to harmonize all of the above.
Remaining tasks
- See what's in the patch.
- Do we want to add validation in implementors of StorageInterface that the passed in collection name conforms to what the interface docs say it should?
- Do we need additional tests of both langcode validation and collection name validation?
User interface changes
API changes
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | 2312189-16.patch | 1.69 KB | darvanen |
Comments
Comment #2
tim.plunkettComment #3
jhedstromRerolled. The latter change in the above patch I think isn't needed anymore given #2023091: Drupal does not allow W3C compliant language codes where you target a numeric region.
Comment #5
jhedstromSyntax error, going too fast.
Comment #6
mgiffordPatch no longer applies.
Comment #15
larowlanTriaged as part of daily bug smash issue.
Comment #16
darvanenRerolled. Should probably have a test to prevent regression.
Comment #20
quietone commentedThis was a bugsmash daily target yesterday. It is still valid and still needs tests.