Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Message shows failure of error report submission #758

Merged
merged 2 commits into from

3 participants

@m0hamed

No description provided.

@coveralls

Coverage Status

Coverage remained the same when pulling f82e321 on m0hamed:ft/fail_on_no_submission into 677e449 on phpmyadmin:master.

@coveralls

Coverage Status

Coverage remained the same when pulling 38fea8e on m0hamed:ft/fail_on_no_submission into 677e449 on phpmyadmin:master.

@nijel nijel merged commit 51fb148 into phpmyadmin:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 17, 2013
  1. @m0hamed
  2. @m0hamed

    Fixed linting error

    m0hamed authored
This page is out of date. Refresh to see the latest.
Showing with 64 additions and 19 deletions.
  1. +64 −19 error_report.php
View
83 error_report.php
@@ -13,28 +13,73 @@
if (isset($_REQUEST['send_error_report'])
&& $_REQUEST['send_error_report'] == true
) {
- PMA_sendErrorReport(PMA_getReportData(false));
+ $server_response = PMA_sendErrorReport(PMA_getReportData(false));
+
+ if ($server_response === false) {
+ $success = false;
+ } else {
+ $decoded_response = json_decode($server_response, true);
+ $success = !empty($decoded_response) ? $decoded_response["success"] : false;
+ }
+
if ($_REQUEST['automatic'] === "true") {
- $response->addJSON(
- 'message',
- PMA_Message::error(
- __(
- 'An error has been detected and an error report has been '
- .'automatically submitted based on your settings.'
+ if ($success) {
+ $response->addJSON(
+ 'message',
+ PMA_Message::error(
+ __(
+ 'An error has been detected and an error report has been '
+ .'automatically submitted based on your settings.'
+ )
+ . '<br />'
+ . __('You may want to refresh the page.')
+ )
+ );
+ } else {
+ $response->addJSON(
+ 'message',
+ PMA_Message::error(
+ __(
+ 'An error has been detected and an error report has been '
+ .'generated but failed to be sent.'
+ )
+ . ' '
+ . __(
+ 'If you experience any '
+ .'problems please submit a bug report manually'
+ )
+ . '<br />'
+ . __('You may want to refresh the page.')
)
- . '<br />'
- . __('You may want to refresh the page.')
- )
- );
+ );
+ }
} else {
- $response->addJSON(
- 'message',
- PMA_Message::success(
- __('Thank you for submitting this report.')
- . '<br />'
- . __('You may want to refresh the page.')
- )
- );
+ if ($success) {
+ $response->addJSON(
+ 'message',
+ PMA_Message::success(
+ __('Thank you for submitting this report.')
+ . '<br />'
+ . __('You may want to refresh the page.')
+ )
+ );
+ } else {
+ $response->addJSON(
+ 'message',
+ PMA_Message::error(
+ __('Thank you for submitting this report.')
+ . ' '
+ . __('Unfortunately the submission failed.')
+ . ' '
+ . __(
+ 'If you experience any '
+ .'problems please submit a bug report manually'
+ )
+ . '<br />'
+ . __('You may want to refresh the page.')
+ )
+ );
+ }
if ($_REQUEST['always_send'] === "true") {
PMA_persistOption("SendErrorReports", "always", "ask");
}
Something went wrong with that request. Please try again.