Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
database update system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
24 Apr 2012 at 07:21 UTC
Updated:
29 Jul 2014 at 20:38 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
sunComment #2
berdirSimplest PSR-0 patch evar ;)
Wasn't sure about the namespace, though. We already have Updater, so I thought that maybe Drupal\DatabaseUpdate is clearer and also maps to the component here on d.o.
Comment #3
berdirComment #4
berdirOk, would help if I would convert the usages of that exception too.
We don't use it actually, only in documentation blocks and hook_update_N() documentation ;)
Comment #6
berdir#4: update-exception-1545068-4.patch queued for re-testing.
Comment #7
Crell commentedThis should be Drupal\Core\DatabaseUpdate.
Strictly speaking, the update system isn't just database updates. People run other changes all the time, to reformat configuration. I suspect in D8 that will be more common, with configuration living in CMI files, it will still need to be cleaned up. (Deleted a variable, renamed a variable, etc.) So perhaps Update is the correct subsystem name? Or SystemUpdate?
A number of the other exceptions we've been converting to extend from RuntimeException to be a bit more accurate. We may as well do that here. It will need a "use" statement.
Comment #8
sunwow, "Updater" really is a poor component name to begin with... that should be renamed to something more self-descriptive. Separate issue.
I think a proper component name here would be "SystemUpdate". (Update on its own could mean everything and the world.)
(oh, didn't see that @Crell suggested the same name! Nice! :))
Comment #9
berdirYeah, I did initially go for Update as well. The problem is that we then have Updater and Update namespaces, which are something *completely* different. So I did go for DatabaseUpdate because that matches with with the component name "database update system". Which has been renamed from update system, I guess to avoid being mixed up with the update module.
Edit: SystemUpdate would be fine with me as well.
Comment #10
berdirSo be it.
- Changed to SystemUpdate
- extends RuntimeException
- Added use for that. As I said, the class is not actually used, otherwise this would have already failed with the Exception as well.
Comment #11
Crell commentedWhen Crell and sun independently agree on something, you know there's something to it. :-)
Didn't update this. And there's a spelling error. And it's missing \Core.
Still missing \Core.
Missing \Core.
I think we definitely need to add a test here to catch this, even if it's a trivial unit test.
Comment #12
berdirHah, serious fail.
This should be better.
As for the tests, we could add an update hook implementation to a test module and throw an exception there. Right now, there is nothing that could be tested other than manually throwing an exception directly in the test code.
Comment #13
Crell commentedThat seems like a reasonable test at first blush. Or #12 looks good now on its own on visual inspection.
Comment #14
robloach#12: update-exception-1545068-12.patch queued for re-testing.
Comment #15
berdirNot sure if the tests should be a follow-up. I don't think we have any tests yet that actually test what happens when an update fails, that could be quite a task.
Comment #16
robloachDo we really need a whole new Drupal\Core\DatabaseUpdate namespace for this? Couldn't we just put this in Drupal\Core\Utility\UpdateException or something?
27 days to next Drupal core point release.
Comment #17
berdirFine with me, we can still move it back once there is more there than just an exception class...
Comment #18
robloachComment #19
catchSorry folks needs a quick re-roll for this typo, which appears twice:
Utlity.
Comment #20
berdirAll were wrong, actually. Fixed.
Comment #21
catchComment #22
catchCommitted/pushed to 8.x.