Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
9ba259be
Commit
9ba259be
authored
Oct 03, 2013
by
alexpott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#1788610
by chertzog, fjd, brainbender: Hook_update_N has unreachable UpdateException.
parent
28077fa5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
core/modules/system/system.api.php
core/modules/system/system.api.php
+5
-3
No files found.
core/modules/system/system.api.php
View file @
9ba259be
...
...
@@ -2584,12 +2584,14 @@ function hook_update_N(&$sandbox) {
$sandbox
[
'#finished'
]
=
empty
(
$sandbox
[
'max'
])
?
1
:
(
$sandbox
[
'progress'
]
/
$sandbox
[
'max'
]);
if
(
$some_error_condition_met
)
{
// In case of an error, simply throw an exception with an error message.
throw
new
UpdateException
(
'Something went wrong; here is what you should do.'
);
}
// To display a message to the user when the update is completed, return it.
// If you do not want to display a completion message, simply return nothing.
return
t
(
'The update did what it was supposed to do.'
);
// In case of an error, simply throw an exception with an error message.
throw
new
UpdateException
(
'Something went wrong; here is what you should do.'
);
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment