Problem/Motivation
Drupal can use a number of different UUID generation schemes depending on which environment it's operating within.
It should display the current generation method in the status page.
Optionally, we should consider whether Uuid::isValid()
should be marked as final
, so that our determination of validity is the one and only allowable one.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Original Issue Summary
This is a followup issue to #1252486: Low level UUID API in core for code changes after the patch in #81 was committed.
Per sun's comments in #87, the last two in the list were implemented in Pol's patch in #88:
- Should Uuid::isValid() use the final keyword? (not included in the patch here)
- Make $plugin a static class property (creates a new $instance property on the Uuid class as a result)
- Move the default plugin in Uuid::determinePlugin() into an else block
Other changes introduced via Pol's patch in #88:
- Add a requirement to display the current UUID plugin implementation in the status report in system.install
This patch also adds a use Drupal\Component\Uuid\Uuid;
to system.install, otherwise installation will fail.
The follow-up patch in #88 removed Uuid::isValid() and added UuidInterface::validate() and UuidPhp::validate() - as per my understanding of the docblock in Uuid::isValid(), plugins should not implement validation, and it looks like this would break tests, so I did not roll those changes in.
Comment | File | Size | Author |
---|---|---|---|
#1 | 1738620-1.patch | 2.64 KB | star-szr |
Comments
Comment #1
star-szrPatch.
Comment #3
star-szr#1: 1738620-1.patch queued for re-testing.
(#1655422: Random test failures in SearchCommentTest)
Comment #4
sunThis will output the fully qualified class name on the requirements page. I guess we want to "prettify" that a bit (e.g., "PECL extension", "COM extension", "Drupal")
Comment #6
Mile23Updating this issue. :-)
Uuid no longer functions as a plugin. It's a service which is initialized in either
CoreServiceProvider::generateUuid()
(8.1.x) orCoreServiceProvider::alter()
(8.2.x)Therefore none of the concerns about plugins apply any more.
All that remains is the functionality of displaying the UUID generator in the status page, and also figuring out whether
Uuid::isValid()
should be markedfinal
.I'd say it's safe for this issue to concentrate on displaying the generator in the status page, if we're doing that.
Bumping up to 8.2.x since this is a code change.