Problem/Motivation
See #2613926: The PECL UUID implementation can return invalid UUIDs for background information.
We only consider lowercase UUIDs as valid for consistency and compatibility reasons even though the spec for UUIDs does not require this. \Drupal\Component\Uuid\Uuid::isValid() does not mention this, however, although this is an important detail that we should tell people.
Proposed resolution
See #15
Remaining tasks
Review
Commit
User interface changes
None.
API changes
None.
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 2625142-9.patch | 435 bytes | felribeiro |
Issue fork drupal-2625142
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 2625142-document-that-uuidisvalid
changes, plain diff MR !9056
Comments
Comment #2
tstoecklerComment #3
felribeiro commentedComment #4
felribeiro commentedComment #6
felribeiro commentedComment #7
felribeiro commentedComment #8
cilefen commentedThere must be one space after the single-line summary comment. See the documentation standards.
"It only allows lowercase string." doesn't really work. What about "Only lower case strings are considered valid for consistency and compatibility reasons."?
Comment #9
felribeiro commented@cilefen Thanks for your considerations.
Comment #10
felribeiro commentedComment #11
cilefen commented+1 This looks good to me. It must wait for the parent issue to go in so I am marking it "postponed".
Comment #12
hass commentedIf the spec allows upper case we need to support the same or people run into compatibility issues with other 3rd party integrations.
Comment #13
tstoeckler@hass: Please see #2613926: The PECL UUID implementation can return invalid UUIDs for more information and possibly comment there.
Comment #14
arla commentedThe relevant part of RFC 4122 is:
And the technically equivalent ITU-T Rec. X.667:
So when it comes to implementing a uuid validator, you have to know if you are validating output or input. We seem to be using this validator specifically for our own generated UUIDs, which I guess we can classify as "output". Then perhaps we should specify that (add another statement to the method doc), so people won't use it to validate "input".
Re: hass' argument, which was elaborated in the other issue as "E.g. Webservices can return this to me and than I need to save as is as it is a unique reference in a remote system that is not in my hand." Per the specs, web services must return lower-case uuids. If you are getting upper-case strings, then they cannot be proper uuids.
Comment #15
jhodgdonRegarding this patch, it would be a lot more concise if you just put the "lower-case" into the existing one-line documentation:
Comment #16
hass commentedI just edited an MSI setup 4 hours ago and it complained when i used uuids with lowercase letters. It was required to make them uppercase only. Lowercase have been invalid here.
Comment #17
berdirWindows environments mostly use *G*UID, which are often upper case.
See https://en.wikipedia.org/wiki/Globally_unique_identifier vs. https://en.wikipedia.org/wiki/Universally_unique_identifier, the examples are uppercase vs. lowercase.
Comment #35
quietone commentedImplemented solution in #15.
Comment #36
quietone commentedComment #37
smustgrave commentedSeems straight forward.
Comment #41
nod_Committed and pushed b8dc375a05 to 11.x and 4abd56206c to 10.4.x. Thanks!