Gallery2 does not work with smarty3 package

Bug #1177321 reported by Peter
28
This bug affects 4 people
Affects Status Importance Assigned to Milestone
gallery2 (Debian)
Fix Released
Unknown
gallery2 (Fedora)
Fix Released
Undecided
gallery2 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

LSB Version: core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:core-4.0-amd64:core-4.0-noarch
root@Troilo:~# lsb_release -rd
Description: Ubuntu 13.04
Release: 13.04

gallery2:
  Installed: 2.3-1ubuntu6
  Candidate: 2.3-1ubuntu6
  Version table:
 *** 2.3-1ubuntu6 0
        500 http://de.archive.ubuntu.com/ubuntu/ raring/universe amd64 Packages
        100 /var/lib/dpkg/status

After installation of gallery2 package on a fresh installed Ubuntu
Raring Ringtail there's a problem regarding smarty php package
(gallery2 displays only white page which is an indication for a php
related problem):

From apache2 error.log file:

[...]
[Tue May 07 09:57:51 2013] [error] [client 127.0.0.1] PHP Fatal error: require_once(): Failed opening required '/usr/share/gallery2/modules/core/classes/../../../lib/smarty/Smarty.class.php' (include_path='.:/usr/share/php:/usr/share/pear') in /usr/share/gallery2/modules/core/classes/GalleryCoreApi.class on line 2827
[Tue May 07 09:58:38 2013] [error] [client 127.0.0.1] PHP Warning: require_once(/usr/share/gallery2/modules/core/classes/../../../lib/smarty/Smarty.class.php): failed to open stream: Datei oder Verzeichnis nicht gefunden in /usr/share/gallery2/modules/core/classes/GalleryCoreApi.class on line 2827
[...]

The symlink /usr/share/gallery2/lib/smarty seems to be broken (points
to /usr/share/php/smarty which should be /usr/share/php/smarty3 which
is provided by the smarty3 spackage that comes with Raring Ringtail)

Fixing this symlink does not help, the following error is displayed in apache2 error.log file:

[...]
[Tue May 07 11:03:05 2013] [error] [client 127.0.0.1] PHP Notice: Indirect modification of overloaded property GallerySmarty::$plugins_dir has no effect in /usr/share/gallery2/modules/core/classes/GalleryTemplate.class on line 335
[Tue May 07 11:03:05 2013] [error] [client 127.0.0.1] PHP Fatal error: Uncaught exception 'SmartyException' with message 'Call of unknown method 'register_object'.' in /usr/share/php/smarty3/sysplugins/smarty_internal_templatebase.php:806\nStack trace:\n#0 /usr/share/gallery2/modules/core/classes/GalleryTemplate.class(346): Smarty_Internal_TemplateBase->__call('register_object', Array)\n#1 /usr/share/gallery2/modules/core/classes/GalleryTemplate.class(346): GallerySmarty->register_object('g', Object(GalleryTemplateAdapter), Array, true, Array)\n#2 /usr/share/gallery2/modules/core/classes/GalleryTemplate.class(71): GalleryTemplate->_getSmarty(true)\n#3 /usr/share/gallery2/main.php(463): GalleryTemplate->GalleryTemplate('/usr/share/gall...')\n#4 /usr/share/gallery2/main.php(104): _GalleryMain(false)\n#5 /usr/share/gallery2/main.php(88): GalleryMain()\n#6 {main}\n thrown in /usr/share/php/smarty3/sysplugins/smarty_internal_templatebase.php on line 806
[...]

~# dpkg -l "*smarty*" "gallery*"
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==========================-==================-==================-=========================================================
un gallery <none> (no description available)
ii gallery-uploader 2.4-1 all graphical tool to upload pictures and videos to Gallery
ii gallery2 2.3-1ubuntu6 all web-based photo album written in PHP
un smarty <none> (no description available)
ii smarty3 3.1.10-2 all Template engine for PHP
root@Troilo:~#

Gallery file integrity check shows also the missing smarty files:

Warning
- Missing files (49) lib/adodb/license.txt lib/adodb/readme.txt lib/smarty/COPYING.lib lib/smarty/Config_File.class.php lib/smarty/README lib/smarty/Smarty_Compiler.class.php lib/smarty/internals/core.assemble_plugin_filepath.php lib/smarty/internals/core.assign_smarty_interface.php lib/smarty/internals/core.create_dir_structure.php lib/smarty/internals/core.display_debug_console.php lib/smarty/internals/core.get_include_path.php lib/smarty/internals/core.get_microtime.php lib/smarty/internals/core.get_php_resource.php lib/smarty/internals/core.is_secure.php lib/smarty/internals/core.is_trusted.php lib/smarty/internals/core.load_plugins.php lib/smarty/internals/core.load_resource_plugin.php lib/smarty/internals/core.process_cached_inserts.php lib/smarty/internals/core.process_compiled_include.php lib/smarty/internals/core.read_cache_file.php lib/smarty/internals/core.rm_auto.php lib/smarty/internals/core.rmdir.php lib/smarty/internals/core.run_insert_handler.php lib/smarty/internals/core.smarty_include_php.php lib/smarty/internals/core.write_cache_file.php lib/smarty/internals/core.write_compiled_include.php lib/smarty/internals/core.write_compiled_resource.php lib/smarty/internals/core.write_file.php lib/smarty/plugins/compiler.assign.php lib/smarty/plugins/function.assign_debug_info.php lib/smarty/plugins/function.config_load.php lib/smarty/plugins/function.debug.php lib/smarty/plugins/function.eval.php lib/smarty/plugins/function.popup.php lib/smarty/plugins/function.popup_init.php lib/smarty/plugins/modifier.cat.php lib/smarty/plugins/modifier.count_characters.php lib/smarty/plugins/modifier.count_paragraphs.php lib/smarty/plugins/modifier.count_sentences.php lib/smarty/plugins/modifier.count_words.php lib/smarty/plugins/modifier.default.php lib/smarty/plugins/modifier.indent.php lib/smarty/plugins/modifier.lower.php lib/smarty/plugins/modifier.nl2br.php lib/smarty/plugins/modifier.string_format.php lib/smarty/plugins/modifier.strip.php lib/smarty/plugins/modifier.strip_tags.php lib/smarty/plugins/modifier.upper.php lib/smarty/plugins/modifier.wordwrap.php

- Modified files (57) install/steps/StorageSetupStep.class install/templates/StorageSetupRequest.html lib/adodb/adodb-error.inc.php lib/adodb/adodb-iterator.inc.php lib/adodb/adodb-lib.inc.php lib/adodb/adodb-perf.inc.php lib/adodb/adodb-php4.inc.php lib/adodb/adodb-time.inc.php lib/adodb/adodb.inc.php lib/adodb/drivers/adodb-ado.inc.php lib/adodb/drivers/adodb-ado5.inc.php lib/adodb/drivers/adodb-ado_mssql.inc.php lib/adodb/drivers/adodb-db2.inc.php lib/adodb/drivers/adodb-mysql.inc.php lib/adodb/drivers/adodb-mysqli.inc.php lib/adodb/drivers/adodb-mysqlt.inc.php lib/adodb/drivers/adodb-oci8.inc.php lib/adodb/drivers/adodb-oci805.inc.php lib/adodb/drivers/adodb-oci8po.inc.php lib/adodb/drivers/adodb-oracle.inc.php lib/adodb/drivers/adodb-pdo.inc.php lib/adodb/drivers/adodb-pdo_sqlite.inc.php lib/adodb/drivers/adodb-postgres64.inc.php lib/adodb/drivers/adodb-postgres7.inc.php lib/adodb/perf/perf-db2.inc.php lib/adodb/perf/perf-mssql.inc.php lib/adodb/perf/perf-mysql.inc.php lib/adodb/perf/perf-oci8.inc.php lib/adodb/perf/perf-postgres.inc.php lib/adodb/tohtml.inc.php lib/smarty/Smarty.class.php lib/smarty/debug.tpl lib/smarty/plugins/block.textformat.php lib/smarty/plugins/function.counter.php lib/smarty/plugins/function.cycle.php lib/smarty/plugins/function.fetch.php lib/smarty/plugins/function.html_checkboxes.php lib/smarty/plugins/function.html_image.php lib/smarty/plugins/function.html_options.php lib/smarty/plugins/function.html_radios.php lib/smarty/plugins/function.html_select_date.php lib/smarty/plugins/function.html_select_time.php lib/smarty/plugins/function.html_table.php lib/smarty/plugins/function.mailto.php lib/smarty/plugins/function.math.php lib/smarty/plugins/modifier.capitalize.php lib/smarty/plugins/modifier.date_format.php lib/smarty/plugins/modifier.debug_print_var.php lib/smarty/plugins/modifier.escape.php lib/smarty/plugins/modifier.regex_replace.php lib/smarty/plugins/modifier.replace.php lib/smarty/plugins/modifier.spacify.php lib/smarty/plugins/modifier.truncate.php lib/smarty/plugins/outputfilter.trimwhitespace.php lib/smarty/plugins/shared.escape_special_chars.php lib/smarty/plugins/shared.make_timestamp.php upgrade/steps/SystemChecksStep.class

+ Old files (6)
These files are no longer part of Gallery. They probably won't cause any problems but it is a good idea to remove them to keep your install clean.
Continue to Step 3»
Gallery: your photos on your website » gallery.sourceforge.net

=> To me this looks like an incompatibility with smarty3 package

Peter

Revision history for this message
In , Michael (michael-redhat-bugs) wrote :

Description of problem: Fedora 18 has php-Smarty-3.1.12. Fedora 17 had php-Smart-2.6.27. After upgrading my gallery2 box to F18 my gallery broke.

Log:
PHP Fatal error: Uncaught exception 'SmartyException' with message 'Call of unknown method 'register_object'.' in /usr/share/php/Smarty/sysplugins/smarty_internal_templatebase.php:806\nStack trace:\n#0 /usr/share/gallery2/modules/core/classes/GalleryTemplate.class(346): Smarty_Internal_TemplateBase->__call('register_object', Array)\n#1 /usr/share/gallery2/modules/core/classes/GalleryTemplate.class(346): GallerySmarty->register_object('g', Object(GalleryTemplateAdapter), Array, true, Array)\n#2 /usr/share/gallery2/modules/core/classes/GalleryTemplate.class(71): GalleryTemplate->_getSmarty(true)\n#3 /usr/share/gallery2/main.php(463): GalleryTemplate->GalleryTemplate('/usr/share/gall...')\n#4 /usr/share/gallery2/main.php(104): _GalleryMain(false)\n#5 /usr/share/gallery2/main.php(88): GalleryMain()\n#6 /home/michael/www/cronenworth_gallery/main.php(3): require('/usr/share/gall...')\n#7 {main}\n thrown in /usr/share/php/Smarty/sysplugins/smarty_internal_templatebase.php on line 806

Downgrading php-Smarty back to the F17 version fixes the problem.

Version-Release number of selected component (if applicable):
gallery2-2.3.2-5.fc18.noarch

Revision history for this message
In , Laurent (laurent-redhat-bugs) wrote :

Hi,

Same thing here, curious that it has not been reported before !

Regards,

Laurent

Revision history for this message
In , Gwyn (gwyn-redhat-bugs) wrote :

Have a look here:

http://fedorapeople.org/~limb/review/php-Smarty2/

I've placed a parallel-installable php-Smarty2 package, and rebuilds of gallery2 RPMS that use it instead of php-Smarty. If these work for you, I'll submit php-Smarty2 for review, and once approved, push it and updates for gallery2.

Revision history for this message
In , Michael (michael-redhat-bugs) wrote :

(In reply to comment #2)
> http://fedorapeople.org/~limb/review/php-Smarty2/

These packages work for me. Thanks.

Revision history for this message
In , Laurent (laurent-redhat-bugs) wrote :

Hi,

This is also working for me !
Thanks a lot ! :)

Regards

Laurent

Revision history for this message
In , Bevis (bevis-redhat-bugs) wrote :

Just upgraded to this version and everything seems to be working just fine.

Thank you!

Ship it to the poor folks out there who haven't found this bug report yet! :-(

Regards, Bevis.

Revision history for this message
In , Gwyn (gwyn-redhat-bugs) wrote :
Revision history for this message
In , Gwyn (gwyn-redhat-bugs) wrote :

*** Bug 915983 has been marked as a duplicate of this bug. ***

Revision history for this message
In , David (david-redhat-bugs) wrote :

FWIW I've "fixed" this for now with 'yum --releasever=17 downgrade smarty'.

Perhaps RPM dependencies should have expressed that in the first place, somehow?

Revision history for this message
In , Gwyn (gwyn-redhat-bugs) wrote :

Yes, if I had realized that gallery2 needed php-Smarty <= 2.x.

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

gallery2-2.3.2-7.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/gallery2-2.3.2-7.fc18

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

Package php-Smarty2-2.6.27-1.fc18, gallery2-2.3.2-7.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing php-Smarty2-2.6.27-1.fc18 gallery2-2.3.2-7.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-3730/php-Smarty2-2.6.27-1.fc18,gallery2-2.3.2-7.fc18
then log in and leave karma (feedback).

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

php-Smarty2-2.6.27-1.fc18, gallery2-2.3.2-7.fc18 has been pushed to the Fedora 18 stable repository. If problems still persist, please make note of it in this bug report.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in gallery2 (Ubuntu):
status: New → Confirmed
Revision history for this message
Nir Yeffet (nir-launchpad-net-8ff8) wrote :

Temporary and ugly fix; run as root

cd
wget http://www.smarty.net/files/Smarty-2.6.27.tar.gz
cd /usr/share/php/
tar xzf ~/Smarty-2.6.27.tar.gz
chown -R root:root Smarty-2.6.27
cd /usr/share/gallery2/lib
rm smarty
ln -s /usr/share/php/Smarty-2.6.27/libs smarty

Revision history for this message
Olek Wojnar (olekw) wrote :

Fixed upstream in version 2.3.1-1.

Revision history for this message
Olek Wojnar (olekw) wrote :

Hmm, won't let me adjust Importance. Based on the symptoms this should have High Importance. Also note that the most recent version in Debian was 2.3.2.dfsg-1.

Changed in gallery2 (Debian):
status: Unknown → Fix Released
Changed in gallery2 (Fedora):
importance: Unknown → Undecided
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.