[mythtv-commits] Ticket #11513: MythWeb fails to load translations with php5.5

MythTV noreply at mythtv.org
Mon Jun 24 21:36:48 UTC 2013


#11513: MythWeb fails to load translations with php5.5
----------------------------------+-------------------------
 Reporter:  scott.shawcroft@…     |          Owner:
     Type:  Bug Report - General  |         Status:  new
 Priority:  minor                 |      Milestone:  unknown
Component:  MythTV - General      |        Version:  0.26
 Severity:  medium                |     Resolution:
 Keywords:                        |  Ticket locked:  0
----------------------------------+-------------------------

Comment (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.

--
Ticket URL: <http://code.mythtv.org/trac/ticket/11513#comment:3>
MythTV <http://www.mythtv.org>
MythTV Media Center


More information about the mythtv-commits mailing list