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.