[SOLVED] Undefined offset: 1 in /gallery/system/libraries/I18n.php on line 60

jakobbg
jakobbg's picture

Joined: 2003-09-30
Posts: 11
Posted: Mon, 2014-08-25 11:14

Hi,

Just recently upgraded from php5.4 to 5.5 and suddenly noticed this on http://tertnesidrettsskole.no/gallery/

Tried following the tips about buffers and timezone in earlier posts, but error persists no matter what I do.

Errors on page:

Notice: Undefined offset: 1 in /data/www/docs/www.tertnesidrettsskole.no/gallery/system/libraries/I18n.php on line 60

Notice: Undefined offset: 1 in /data/www/docs/www.tertnesidrettsskole.no/gallery/system/libraries/I18n.php on line 60
:-(
Dang... Something went wrong!

We tried really hard, but it's broken.

Talk to your Gallery administrator for help fixing this!

Notice: Undefined offset: 1 in /data/www/docs/www.tertnesidrettsskole.no/gallery/system/libraries/I18n.php on line 60

Fatal error: Uncaught exception 'Kohana_PHP_Exception' with message 'Undefined offset: 1' in /data/www/docs/www.tertnesidrettsskole.no/gallery/system/libraries/I18n.php:60 Stack trace: #0 /data/www/docs/www.tertnesidrettsskole.no/gallery/system/libraries/I18n.php(60): Kohana_PHP_Exception_Core::error_handler(8, 'Undefined offse...', '/data/www/docs/...', 60, Array) #1 /data/www/docs/www.tertnesidrettsskole.no/gallery/system/libraries/I18n.php(93): I18n_Core::get_text('Undefined offse...') #2 /data/www/docs/www.tertnesidrettsskole.no/gallery/system/core/Kohana_Exception.php(42): __('Undefined offse...', NULL) #3 /data/www/docs/www.tertnesidrettsskole.no/gallery/system/libraries/Kohana_PHP_Exception.php(60): Kohana_Exception_Core->__construct('Undefined offse...') #4 /data/www/docs/www.tertnesidrettsskole.no/gallery/system/libraries/Kohana_PHP_Exception.php(95): Kohana_PHP_Exception_Core->__construct(8, 'Undefined offse...', '/data/www/docs/...', 60) #5 [internal function]: Kohana_PHP_Exception_Core::shutdown_handler(NULL) in /data/www/docs/www.tertnesidrettsskole.no/gallery/system/libraries/I18n.php on line 60

Notice: Undefined offset: 1 in /data/www/docs/www.tertnesidrettsskole.no/gallery/system/libraries/I18n.php on line 60

Notice: Undefined offset: 1 in /data/www/docs/www.tertnesidrettsskole.no/gallery/system/libraries/I18n.php on line 60

Fatal error: Uncaught exception 'Kohana_PHP_Exception' with message 'Undefined offset: 1' in /data/www/docs/www.tertnesidrettsskole.no/gallery/system/libraries/I18n.php:60 Stack trace: #0 /data/www/docs/www.tertnesidrettsskole.no/gallery/system/libraries/I18n.php(60): Kohana_PHP_Exception_Core::error_handler(8, 'Undefined offse...', '/data/www/docs/...', 60, Array) #1 /data/www/docs/www.tertnesidrettsskole.no/gallery/system/libraries/I18n.php(93): I18n_Core::get_text('#:errno: :error') #2 /data/www/docs/www.tertnesidrettsskole.no/gallery/system/core/Kohana_Exception.php(42): __('#:errno: :error', Array) #3 /data/www/docs/www.tertnesidrettsskole.no/gallery/system/libraries/Database_Mysql.php(50): Kohana_Exception_Core->__construct('#:errno: :error', Array) #4 /data/www/docs/www.tertnesidrettsskole.no/gallery/system/libraries/Database_Mysql.php(130): Database_Mysql_Core->connect() #5 /data/www/docs/www.tertnesidrettsskole.no/gallery/system/libraries/Database.php(429): Database_Mysql_Core->escape('3ijr9nfs4mer8dk...') #6 [in in /data/www/docs/www.tertnesidrettsskole.no/gallery/system/libraries/I18n.php on line 60

System info:

$ uname -a
FreeBSD core2.grimstveit.no 10.0-RELEASE-p7 FreeBSD 10.0-RELEASE-p7 #1 r270156: Tue Aug 19 01:48:13 CEST 2014

:/usr/obj/usr/src/sys/CORE2 amd64

$ php -v
PHP 5.5.15 (cli) (built: Aug 22 2014 10:56:39)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies

$ pkg info|grep -e php -e apache
apache24-2.4.10_1 Version 2.4.x of Apache web server
mod_php55-5.5.15_1 PHP Scripting Language
php55-5.5.15_1 PHP Scripting Language
php55-bz2-5.5.15_1 The bz2 shared extension for php
php55-ctype-5.5.15_1 The ctype shared extension for php
php55-dom-5.5.15_1 The dom shared extension for php
php55-exif-5.5.15_1 The exif shared extension for php
php55-extensions-1.8 "meta-port" to install PHP extensions
php55-fileinfo-5.5.15_1 The fileinfo shared extension for php
php55-filter-5.5.15_1 The filter shared extension for php
php55-gd-5.5.15_1 The gd shared extension for php
php55-gettext-5.5.15_1 The gettext shared extension for php
php55-iconv-5.5.15_1 The iconv shared extension for php
php55-json-5.5.15_1 The json shared extension for php
php55-mbstring-5.5.15_1 The mbstring shared extension for php
php55-mcrypt-5.5.15_1 The mcrypt shared extension for php
php55-mysql-5.5.15_1 The mysql shared extension for php
php55-mysqli-5.5.15_1 The mysqli shared extension for php
php55-opcache-5.5.15_1 The opcache shared extension for php
php55-openssl-5.5.15_1 The openssl shared extension for php
php55-pdo-5.5.15_1 The pdo shared extension for php
php55-pdo_mysql-5.5.15_1 The pdo_mysql shared extension for php
php55-pdo_sqlite-5.5.15_1 The pdo_sqlite shared extension for php
php55-posix-5.5.15_1 The posix shared extension for php
php55-recode-5.5.15_1 The recode shared extension for php
php55-session-5.5.15_1 The session shared extension for php
php55-simplexml-5.5.15_1 The simplexml shared extension for php
php55-soap-5.5.15_1 The soap shared extension for php
php55-sockets-5.5.15_1 The sockets shared extension for php
php55-sqlite3-5.5.15_1 The sqlite3 shared extension for php
php55-tokenizer-5.5.15_1 The tokenizer shared extension for php
php55-xml-5.5.15_1 The xml shared extension for php
php55-xmlreader-5.5.15_1 The xmlreader shared extension for php
php55-xmlwriter-5.5.15_1 The xmlwriter shared extension for php
php55-zlib-5.5.15_1 The zlib shared extension for php

All and any help appreciated!

 
spags

Joined: 2010-03-26
Posts: 120
Posted: Mon, 2014-08-25 21:09

The error is something to do with languages and translations. The offending line is:

if($local_translation_files = Kohana::find_file('i18n', $locale[0].'/'.$locale[1]))

Unfortunately I'm not familiar with such things but I suspect it means that your host system is using an unexpected locale (or at least its name/description is in an unexpected format).

Read this forum post, which looks like it is the same sort of problem.

http://galleryproject.org/node/109467

 
jakobbg
jakobbg's picture

Joined: 2003-09-30
Posts: 11
Posted: Mon, 2014-08-25 21:19

Yeah, I've seen those posts earlier. I've tried setting both timezone to "Europe/Oslo", CET, "America/New_York" and similar, but nothing helps. I've also tried commenting out the ob_ stuff, but no change in behaviour, unfortunately.

 
spags

Joined: 2010-03-26
Posts: 120
Posted: Tue, 2014-08-26 08:45

Hmm you've probably done more searching/reading than me, so I assume you also restarted Apache as well... those posts hinting at modifying the timezone in the php.ini file require the restart to pick up the change.

Are you running the latest git version of G3? I noticed floridave referred to some patches in some of those other posts.

It would be great to see what value is in $locale - it might put some light on the situation.

 
jakobbg
jakobbg's picture

Joined: 2003-09-30
Posts: 11
Posted: Tue, 2014-08-26 08:52

Yup. My Apache has seldom been restarted more often than the latest few days :-). I'm not running latest GIT, was not aware of that being a recipe for success. Well, I guess it can't hurt to try. Albeit it seems like that some SQL queries and file copying is imminent for a migration over to SmugMug/Google+ Photos, since Gallery3 seems dead anyhoo. Sad.

 
jakobbg
jakobbg's picture

Joined: 2003-09-30
Posts: 11
Posted: Tue, 2014-08-26 09:21

Upgrading to GIT version fixed my problem. Either by effectively having removed bad customizations on my host, or due to new and improved code in GIT. Anyhoo; works gr8! Yay! Thank you for the tip, spags!