matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.91k stars 2.65k forks source link

Safe mode is not displayed when there is a crash/error in some cases #10693

Closed mattab closed 8 years ago

mattab commented 8 years ago

After upgrading one instance to 3.0.0-b1 the safe mode was not displayed as the Safe mode HTML page was output in the middle a javascript block, as follows

<!DOCTYPE html>
<html id="ng-app" lang="en" ng-app="piwikApp">
    <head>
                        <meta charset="utf-8">
            <title>Piwik App Usage (opted-in) - 2016 - Web Analytics Reports - Piwik</title>
            <meta http-equiv="X-UA-Compatible" content="IE=EDGE,chrome=1"/>
            <meta name="viewport" content="initial-scale=1.0"/>
            <meta name="generator" content="Piwik - free/libre analytics platform"/>
            <meta name="description" content="Web Analytics report for Piwik&#x20;App&#x20;Usage&#x20;&#x28;opted-in&#x29; - Piwik"/>
            <meta name="apple-itunes-app" content="app-id=737216887" />
            <meta name="google-play-app" content="app-id=org.piwik.mobile2">
                            <meta name="robots" content="noindex,nofollow">

                <link rel="shortcut icon" href="plugins/CoreHome/images/favicon.png"/>
                <link rel="mask-icon" href="plugins/CoreHome/images/applePinnedTab.svg" color="#d4291f">
            <script type="text/javascript">
    var piwik = {};

[............]

    piwik.userLogin = "root";
    piwik.idSite = "1";
    piwik.siteName = "Piwik\x20App\x20Usage\x20\x28opted\x2Din\x29";
    piwik.siteMainUrl = "http\x3A\x2F\x2Fdemo\x2Danonymous.piwik.org";
    piwik.period = "year";
    piwik.currentDateString = "2016-10-06";
    piwik.startDateString = "2016-01-01";
    piwik.endDateString = "2016-10-06";
    piwik.minDateYear = 2015;
    piwik.minDateMonth = parseInt("10", 10);
    piwik.minDateDay = parseInt("15", 10);
    piwik.maxDateYear = 2016;
    piwik.maxDateMonth = parseInt("10", 10);
    piwik.maxDateDay = parseInt("06", 10);
    piwik.language = "en";
    piwik.hasSuperUserAccess = 1;
    piwik.config = {};
    piwik.config = {"action_url_category_delimiter":"\/","autocomplete_min_sites":5,"datatable_export_range_as_day":"rss","datatable_row_limits":["5","10","25","50","100","250","500","-1"],"are_ads_enabled":true};
    <br />
<b>Fatal error</b>:  Class 'Piwik\Plugin\Settings' not found in <b>/home/piwik-demo-anonymous/www/demo-anonymous.piwik.org/plugins/AnonymousPiwikUsageMeasurement/Settings.php</b> on line <b>22</b><br />
<html>
    <head>
        <meta name="robots" content="noindex,nofollow">
        <style type="text/css">
            html, body {
                background-color: white;
            }
            td {
                border: 1px solid #ccc;
                border-collapse: collapse;
                padding: 5px;
            }
            table {
                border-collapse: collapse;
                border: 0px;
            }
            a {
                text-decoration: none;

Expected behavior

The safe mode should be displayed so users can disable the plugin causing the fatal error.

mattab commented 8 years ago

fixed in #10696