template_option

Bug #342217 reported by vmeier
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Xibo
Fix Released
Medium
Alex Harrington

Bug Description

hello
when i select the
"layout tab" -> design
tab, i receive the following error:

<errormsg>Undefined variable: template_option</errormsg>
<errornum>8</errornum>
<errortype>Notice</errortype>
<scriptname>/var/www/localhost/htdocs/xibo/lib/pages/layout.class.php</scriptname>
<scriptlinenum>779</scriptlinenum>

i just see a blank page.
happens in rc1 + rc2 + current bzr code

thanks & regards
vinz

Revision history for this message
vmeier (vm-digicomp) wrote :
Revision history for this message
Alex Harrington (alexharrington) wrote :

Thanks for your bug report.

Can you tell us a bit more about the environment.

Server OS + verson
Webserver + version
Web browser + version

Cheers

Alex

Revision history for this message
Dan Garner (dangarner) wrote :

Hi,

Can you try the latest from the attached branch (see related branches above)

The fact a notice was being raise shouldn't have stopped the page loading - so I think there might be some underlying problem - but the above branch should stop the notice being raised.

Cheers,
Dan

Revision history for this message
vmeier (vm-digicomp) wrote :

hello
thanks for the responses

Server OS + verson
Linux hellfire 2.6.22-gentoo-r5 #1 PREEMPT Fri Aug 31 13:42:20 CEST 2007 i686 Intel(R) Pentium(R) 4 CPU 2.80GHz GenuineIntel GNU/Linux

Webserver + version
dev-lang/php-5.2.8-r2 USE="apache2 bcmath berkdb bzip2 calendar cdb cgi cjk cli crypt ctype curl curlwrappers dbase discard-path exif filter flatfile ftp gd gdbm gmp hash iconv imap json kolab mcve mhash mysql ncurses nls pcntl pcre pdo pic posix readline reflection session sharedext sharedmem simplexml snmp soap sockets spell spl ssl suhosin sysvipc tidy tokenizer truetype unicode wddx xml xmlreader xmlrpc xmlwriter xpm xsl yaz zlib -adabas -birdstep -concurrentmodphp -db2 -dbmaker -debug -doc -empress -empress-bcs -esoob -fastbuild -fdftk -firebird -force-cgi-redirect -frontbase -gd-external -inifile -interbase -iodbc -ipv6 (-java-external) -kerberos -ldap -ldap-sasl -libedit -msql -mssql -mysqli -oci8 -oci8-instant-client -odbc -postgres -qdbm -recode -sapdb -solid -sqlite -sybase -sybase-ct -threads -zip -zip-external"

www-servers/apache-2.2.10 USE="ssl -debug -doc -ldap (-selinux) -sni -static -suexec -threads" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias -asis -auth_digest -authn_dbd -cern_meta -charset_lite -dbd -dumpio -ident -imagemap -log_forensic -proxy -proxy_ajp -proxy_balancer -proxy_connect -proxy_ftp -proxy_http -substitute -version"

Web browser + version
i've tried both IE7 and FF306

Revision history for this message
vmeier (vm-digicomp) wrote :

i've just tried the latest branch, the only difference is that the error no longer gets triggered, but the page still does not load

Revision history for this message
vmeier (vm-digicomp) wrote :

i've attached the generated html just in case

Revision history for this message
vmeier (vm-digicomp) wrote :

i was able to pin down the error to this:
layout.class.php

        function RenderDesigner()
        {
                $db =& $this->db;

                //Assume we have the xml in memory already
                echo "bla1";

                //load the XML into a SimpleXML OBJECT
                $xml = simplexml_load_string($this->xml);
                echo "bla2";

bla2 is not reached, so "simplexml_load_string($this->xml);" fails

Revision history for this message
vmeier (vm-digicomp) wrote :

the parameter given is

string(1704) "<?xml version="1.0"?>
<layout width="800" height="500" bgcolor="#000000"><region id="47ff29524ce1b" width="800" height="500" top="0" left="0"><media id="ba2b90ee2e21f9aaffbc45f253068c60" type="text" duration="20" lkid="" schemaVersion="1">
     <options><direction>none</direction></options>
     <raw><text><![CDATA[<h1 style="text-align: center;"><span style="font-size: 2em;"><span style="font-family: Verdana;"><span style="color: rgb(255, 255, 255);">Welcome to </span></span></span></h1><h1 style="text-align: center;"><span style="font-size: 2em;"><span style="font-family: Verdana;"><span style="color: rgb(255, 255, 255);">Xibo! </span></span></span></h1><h1 style="text-align: center;"><span style="font-size: 2em;"><span style="font-family: Verdana;"><span style="color: rgb(255, 255, 255);">Open Source Digital Signage</span></span></span></h1><p style="text-align: center;"><span style="font-family: Verdana;"><span style="color: rgb(255, 255, 255);"><span style="font-size: 1.6em;">This is the default layout - please feel free to change it whenever you like!</span></span></span></p>]]></text></raw>
    </media><media id="7695b17df85b666d420c232ee768ef68" type="ticker" duration="100" lkid="" schemaVersion="1">

     <options><direction>up</direction><uri>http://xibo.org.uk/feed/</uri></options>
     <raw><template><![CDATA[<h2 style="text-align: center;"><span style="color: rgb(255, 255, 255);"><span style="font-size: 1.6em;"><u><span style="font-size: 1.8em;">[Title]</span></u></span></span></h2><p><span style="color: rgb(255, 255, 255);"><span style="font-size: 1.6em;">[Description]</span></span></p><p>&nbsp;</p><p>&nbsp;</p>]]></template></raw>
    </media></region></layout>
"

Revision history for this message
Dan Garner (dangarner) wrote :

Hi!

Thank you for doing so much debugging into this issue.

I think the answer might be a missing PHP dependency - more info here: http://uk.php.net/manual/en/simplexml.installation.php (although your output indicates that simple xml is present).

I think the answer is for me to re-write the way that works (I am surprised that SimpleXML is being used - I had thought it had all been converted to DOM-XML.

While I do that (will be done in a few hours) would you mind following the suggestion for gentoo users on the above link - just to see if that is definitely the reason?

Ill post a comment when converted.

Cheers,
Dan

Revision history for this message
vmeier (vm-digicomp) wrote :

i've re-emerged php, although it has been emerged before with the simplexml useflag (you can see this at the color of the useflag), anyway, it does work now.
thanks for your help

just a thought, maybe all the extensions being used should be checked if they are supported at the installation page

Revision history for this message
Alex Harrington (alexharrington) wrote :

Dan - if there's an additional dependancy you need me to check for then shout.

A

Revision history for this message
vmeier (vm-digicomp) wrote :

i've figured out the hard way that calendar is also a required extension
thanks

Revision history for this message
Alex Harrington (alexharrington) wrote :

vmeier - which extension is required by the calendar?

All these extensions you seem to be missing are defaults for PHP 5 - which is why we're not testing for them at the moment.

Revision history for this message
Dan Garner (dangarner) wrote :

I have now removed the SimpleXML calls (as of the attached branch, which will make it into rc3)

After taking a quick look through the schedule code nothing is jumping out at me which might be a dependency... could you elaborate?

Hope you like Xibo.

Thanks,
Dan

Changed in xibo:
assignee: nobody → dangarner
importance: Undecided → Medium
milestone: none → 1.0.0-rc3
status: New → Triaged
Revision history for this message
vmeier (vm-digicomp) wrote :

thanks for the help

on gentoo, if the calendar use flag is not set for php, the schedule page will not load.

for example, cal_days_in_month() used in schedule.class.php is a calendar extention. http://www.php.net/manual/en/ref.calendar.php

Revision history for this message
Alex Harrington (alexharrington) wrote :

Thanks Vmeier

I'm not a Gentoo user. Is this calendar extension set to build by default on Gentoo? It's built in to the default PHP distributions (Debian, Ubuntu, Fedora, Windows) as standard, so I don't see why Gentoo would disable it by default?

Alex

Revision history for this message
Dan Garner (dangarner) wrote :

vmeier - thanks for that pointer!

Now I understand, I hadn't appreciated that the calendar functions could be turned off.

I have created a blueprint here (https://blueprints.launchpad.net/xibo/+spec/server-mode) which I believe will provide the functionality required for debugging problems such as these.

In the mean time if you do have any other un-explained problems you could try editing lib/include.php at line 25

ini_set('display_errors', 0);

Change this to 1. PHP should then output the exact line/function dependency that is causing the problem. Hopefully there are no more lurking!

Are you OK with me marking this bug as completed? We can track further progress on the blueprint.

Cheers,
Dan

Revision history for this message
vmeier (vm-digicomp) wrote :

as you can not guarantee that on each platform and distribution the extensions are enabled, it is in my opinion good to check for the extensions used by php since there are already some checks for other extensions. i do not know why gentoo disables it by default.

thanks for the help and the info on display_errors, you can mark it as completed

regards
vinz

Revision history for this message
Dan Garner (dangarner) wrote :

Alex: can you add the calendar extension as a dependency check in the installer?

vinz: OK thanks - Alex will mark as complete once the installer has been changed.

Changed in xibo:
assignee: dangarner → alexharrington
Revision history for this message
Alex Harrington (alexharrington) wrote :

Installer and upgrader now check for the calendar extension.

Changed in xibo:
status: Triaged → Fix Committed
Changed in xibo:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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