[mythtv-users] MythWeb Issue
Jason Lee
mythtv at theleehouse.net
Fri Sep 10 14:54:39 EDT 2004
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I upgraded to 0.16 this morning, and found that the recorded programs
page took *forever* to load and then had a plethora of errors about an
invalid argument being passed to foreach() in line 307 of
includes/programs.php. I did some poking around and found that
load_one_program() was returning an empty array. I didn't have the time
to dig through load_all_program_data() (which is what load_one_program()
calls), so I made this change:
~ $tmp = load_one_program($this->starttime, $this->chanid);
~ if (count ($tmp) > 0) {
~ foreach (get_object_vars($tmp) as $key => $value) {
~ $this->$key = $value;
~ }
~ }
That got rid of the errors and drastically improved performance.
I also made this change includes/sorting.php at line 42 to fix an error
on the same page when there are no recordings:
~ if (count($_SESSION[$session]) > 0) {
~ foreach ($_SESSION[$session] as $key => $sort) {
~ $depth++;
~ // No match, continue looking
~ if ($sort['field'] != $field)
~ continue;
~ // What to do now...
~ return ($sort['reverse'] ? 0 - $depth : $depth);
~ }
~ }
If there's a better fix (using the @ sign might be a better solution but
I'm not too sure about that), I'm all ears, but this got me going. Hope
it helps someone else...
- --
jason lee
Steeplesoft -- http://www.steeplesoft.com
README.txt -- http://jason.theleehouse.net
Bosco -- http://bosco.sourceforge.net
Public Key -- http://jason.theleehouse.net/pubkey.asc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFBQfhvQJAydrmp8lMRAkqPAJwKN3JDnWltck8T4jP6TvdMk7nZRwCgo/V2
uMvi20OeiuEPIY8nrIQhhB4=
=9c//
-----END PGP SIGNATURE-----
More information about the mythtv-users
mailing list