Modify
Warning Please read the Ticket HowTo before creating or commenting on a ticket. Failure to do so may cause your ticket to be rejected or result in a slower response.

Opened 12 months ago

Closed 8 months ago

#11513 closed Bug Report - General (Fixed)

MythWeb fails to load translations with php5.5

Reported by: scott.shawcroft@… Owned by: knight
Priority: minor Milestone: 0.27
Component: MythTV - General Version: 0.26
Severity: medium Keywords:
Cc: Ticket locked: no

Description

MythWeb fails to load translation files with php5.5 because module_path isn't set when Translate is constructed by error_handler to handle the error message generated by calling mysql_connect. To fix this I moved the error_reporting check above Translate::find. define and translate should probably be init earlier if error reporting depends on them.

Attachments (0)

Change History (7)

comment:1 Changed 10 months ago by jason@…

could you paste your fix somewhere by any chance?

comment:2 Changed 10 months ago by scott.shawcroft@…

Sure. I'll do it this weekend.

comment:3 Changed 10 months ago by scott.shawcroft@…

Sorry it took me longer to get you a patch. Here it is:

--- mythplugins-0.26.0/mythweb/includes/errors.php      2012-08-28 10:22:44.000000000 -0700
+++ /var/www/mythweb/htdocs/includes/errors.php 2013-06-21 14:45:28.580966423 -0700
@@ -103,6 +103,9 @@
 /**/
     function error_handler($errno, $errstr, $errfile, $errline, $vars) {
         global $db;
+    // Leave early if we haven't requested reports from this kind of error
+        if (!($errno & error_reporting()))
+            return;
         if (class_exists('Translate'))
             $errstr = Translate::find()->string($errstr);
     // Try to auto-repair damaged SQL tables
@@ -113,9 +116,6 @@
             add_error('Regular Expression Error:  '.$match[1]);
             return;
         }
-    // Leave early if we haven't requested reports from this kind of error
-        if (!($errno & error_reporting()))
-            return;
     // Fatal errors should report considerably more detail
         if (in_array($errno, array(E_USER_ERROR, E_ERROR))) {
         // What type of error?

The bug is caused by attempting to translate an error message before the state needed to load the translate library is setup. The error is non-fatal anyway afaict so this causes it to exit earlier before doing the translation rather than after.

comment:4 Changed 8 months ago by knight

  • Milestone changed from unknown to 0.27
  • Owner set to knight
  • Status changed from new to assigned

comment:5 Changed 8 months ago by Scott Shawcroft <scott.shawcroft@…>

In 35edce50186c212aa25c2eb7545f604ad3ca9ed1/mythweb:

Fix the problem of MythWeb failing to load translations

Refs #11513

Signed-off-by: Nicolas Riendeau <nriendeau@…>

comment:6 Changed 8 months ago by Scott Shawcroft <scott.shawcroft@…>

In 7326d7ef70fb86037d9c30ca7e0762d0cb01b7ff/mythweb:

Fix the problem of MythWeb failing to load translations

Refs #11513

Signed-off-by: Nicolas Riendeau <nriendeau@…>

comment:7 Changed 8 months ago by knight

  • Resolution set to Fixed
  • Status changed from assigned to closed

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'new'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.