Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal_reset
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal_reset
Commits
4b2d321f
Commit
4b2d321f
authored
8 years ago
by
git
Committed by
Liam Morland
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2816519
by dbiscalchin: Fix PDOException after the database tables are deleted.
parent
ece28068
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
drupal_reset.lib.inc
+31
-0
31 additions, 0 deletions
drupal_reset.lib.inc
drupal_reset.module
+1
-1
1 addition, 1 deletion
drupal_reset.module
with
32 additions
and
1 deletion
drupal_reset.lib.inc
+
31
−
0
View file @
4b2d321f
...
...
@@ -67,3 +67,34 @@ function _drupal_reset_is_supported_database_configuration() {
global
$databases
;
return
isset
(
$databases
[
'default'
][
'default'
])
&&
count
(
$databases
[
'default'
])
===
1
&&
isset
(
$databases
[
'default'
][
'default'
][
'prefix'
])
&&
is_string
(
$databases
[
'default'
][
'default'
][
'prefix'
]);
}
/**
* Sends the user to a different page without database access.
*
* This function should be used instead of drupal_goto() after the database
* tables have been deleted. Unlike drupal_goto() a destination in $_GET is
* ignored.
*
* @param string $path
* A Drupal path or a full URL, which will be passed to url() to compute the
* redirect for the URL.
* @param array $options
* An associative array of additional URL options to pass to url().
* @param int $http_response_code
* The HTTP status code to use for the redirection, defaults to 302.
*
* @see drupal_goto()
*/
function
_drupal_reset_goto
(
$path
=
''
,
array
$options
=
array
(),
$http_response_code
=
302
)
{
// The 'Location' HTTP header must be absolute.
$options
[
'absolute'
]
=
TRUE
;
$url
=
url
(
$path
,
$options
);
header
(
'Location: '
.
$url
,
TRUE
,
$http_response_code
);
// We do not call drupal_exit() to avoid errors raised by hook_exit()
// implementations that use the database.
drupal_session_commit
();
exit
;
}
This diff is collapsed.
Click to expand it.
drupal_reset.module
+
1
−
1
View file @
4b2d321f
...
...
@@ -98,6 +98,6 @@ function drupal_reset_admin_settings_submit($form, &$form_state) {
_drupal_reset_drop_database
();
// Redirect to install page.
drupal_goto
(
'install.php'
);
_
drupal_
reset_
goto
(
'install.php'
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment