Problem/Motivation
#2807785: Move global constants from *.module files into interfaces deprecated a bunch of constants but it did not actually replace their usage. We should do this. This issue handles UPDATE_NOT_SECURE, UPDATE_REVOKED, UPDATE_NOT_SUPPORTED, UPDATE_NOT_CURRENT, UPDATE_CURRENT, UPDATE_NOT_CHECKED, UPDATE_UNKNOWN, UPDATE_NOT_FETCHED and UPDATE_FETCH_PENDING. This is a bug because we've deprecated something but we've not completed the task.
Proposed resolution
Use UpdateManagerInterface::NOT_SECURE, UpdateManagerInterface::REVOKED, UpdateManagerInterface::NOT_SUPPORTED, UpdateManagerInterface::NOT_CURRENT, UpdateManagerInterface::CURRENT, UpdateFetcherInterface::NOT_CHECKED, UpdateFetcherInterface::UNKNOWN, UpdateFetcherInterface::NOT_FETCHED and UpdateFetcherInterface::FETCH_PENDING instead.
Remaining tasks
User interface changes
None
API changes
None
Data model changes
None
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | interdiff-7-10.txt | 1.2 KB | longwave |
| #10 | 3015810-10.drupal.Properly-deprecate-UPDATE-constants.patch | 31.3 KB | longwave |
Comments
Comment #2
alexpottWith this patch the old constants are no longer used.
Comment #4
alexpottFixed the fails. Needed to read https://twig.symfony.com/doc/2.x/functions/constant.html
Comment #7
longwaveRerolled. This is now needed in 9.0.x for #3097423: Remove update.module BC layers
Comment #8
andypostComment #9
berdirThere is one reference to UPDATE_FETCH_PENDING left in update.compare.inc in a comment.
Comment #10
longwaveComment #11
berdirThanks, that was the only thing I found. It's a constant, so we can test/enforce it.
Comment #13
catchCommitted ed9baee and pushed to 9.0.x. Thanks!
Comment #15
berdirI see it was also pushed to 8.9 now, should also be safe for a backport as it just updates usage of constants, but also not so important.
Comment #16
benjifisherI guess I am a little too late for this issue, but
The namespace should be Drupal\update instead of Drupal\Update.
Comment #17
alexpottOriginally I thought that we should do #16 in a new issue because there are lots of code comments with the same bug but then I got concerned about case sensitive file systems so I made follow-up commit.
Committed and pushed 4a812fc9c7 to 9.0.x and 73b1fa5970 to 8.9.x. Thanks!