MythTV / mythweb

The official MythTV mythweb repository

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

upgrade to 22.04 from 20.04 breaks mythweb

zyeborm opened this issue · comments

Not sure exactly what is wrong and I've almost certainly "fixed" it badly....but.

After doing the release upgrade I was getting this when attempting to access mythweb on the mother in laws PC.

PHP Fatal error:  Uncaught Error: Undefined constant "modules_path" in
/usr/share/mythtv/mythweb/includes/class_autoload.php:19\nStack trace:\n#0
/usr/share/mythtv/mythweb/classes/Translate.php(16): autoload()\n#1
/usr/share/mythtv/mythweb/includes/class_autoload.php(18): include_once('...')\n#2 [internal function]: autoload()\n#3 /usr/share/mythtv/mythweb/includes/errors.php(116): class_exists()\n#4 [internal function]: error_handler()\n#5
/usr/share/mythtv/mythweb/includes/php_version_check.php(20): trigger_error()\n#6
/usr/share/mythtv/mythweb/includes/init.php(33): require_once('...')\n#7
/usr/share/mythtv/mythweb/mythweb.php(20): require_once('...')\n#8 {main}\n  thrown in
/usr/share/mythtv/mythweb/includes/class_autoload.php on line 19

It looks like it's running the class_autoload before it has run the defines that well define modules_path.

My "fix" for it was to edit /usr/share/mythtv/mythweb/includes/init.php
At the start of the file is

// Attempt to load up firephp if installed on the server
    @include_once('FirePHPCore/fb.php');

    require_once 'includes/errors.php';
// Lazy load the classes...
    require_once 'includes/class_autoload.php';

I changed this to

// Attempt to load up firephp if installed on the server
    @include_once('FirePHPCore/fb.php');

    require_once 'includes/errors.php';

//these should be loaded before running the class autoloader, it may be better placing these requires there as it is the bit that requires it but other things here will probably also need it
    require_once 'includes/utils.php';
    require_once 'includes/defines.php';

// Lazy load the classes...
    require_once 'includes/class_autoload.php';

and it seems to work.

I'm putting this here rather than a pull in hopes google finds it and hence others do too if they need it. Also I'm at my mother in laws place over xmas and getting all that chooching would be a giant pain. Sorry to whomever picks this one up.

A new apt upgrade to fixes/32 on ubuntu-22.04 (jammy) now breaks mythweb, for installations where it had been working previously. The error is the same.

[Fri Jan 06 09:42:34.347807 2023] [php:error] [pid 1341] [client 192.168.88.20:39004] PHP Fatal error: Uncaught Error: Undefined constant "modules_path" in /usr/share/mythtv/mythweb/includes/class_autoload.php:19\nStack trace:\n#0 /usr/share/mythtv/mythweb/classes/Translate.php(16): autoload()\n#1 /usr/share/mythtv/mythweb/includes/class_autoload.php(18): include_once('...')\n#2 [internal function]: autoload()\n#3 /usr/share/mythtv/mythweb/includes/errors.php(116): class_exists()\n#4 [internal function]: error_handler()\n#5 /usr/share/mythtv/mythweb/includes/php_version_check.php(20): trigger_error()\n#6 /usr/share/mythtv/mythweb/includes/init.php(33): require_once('...')\n#7 /usr/share/mythtv/mythweb/mythweb.php(20): require_once('...')\n#8 {main}\n thrown in /usr/share/mythtv/mythweb/includes/class_autoload.php on line 19, referer: http://pvr.local/mythweb/tv/upcoming

This was not an issue before recently updating. I am running
mythweb/jammy,now 2:32.0+fixes.202301051905.e677dd354f~ubuntu22.04.1

This was working fine just the other day, anyone please help me figure out a fix? I'm not wise to the layers of PHP module loading. Looks like the default PHP on this box is 8.1.

Thanks to OP, but the mother-in-law patch seems to create other problems for me.

What other issues did you have with that change?

it intoduces an error in php_version_check, for some reason can't seem to find the mysql extension anymore (which is installed and was working until 1/5/2023 update).

Also throws an undefined function error in footer.php after that.

I've been trying to figure out what changed, I only did an apt upgrade with fixes/32 in my sources.list.
Packages php-mythtv and mythweb were both updated, but I haven't been able to figure out which files changed exactly if any.
Everything had been working fine previously.

So I finally fixed this by removing and installing package 'php8.1-mysql'. Some other upstream update must have disabled this PHP module. By reinstalling it I appear to have triggered other downstream post-install steps in apache2 modules etc. etc.

Not a bug for me anymore. I did not change any delivered mythweb PHP as above.

thanks

I neglected to point out clearly that on top of vanilla ubuntu 22.04 "jammy", during this episode I have had these repos in my apt sources list.

https://ppa.launchpadcontent.net/ondrej/php/ubuntu
https://ppa.launchpadcontent.net/mythbuntu/32/ubuntu