infinite redirect in mythweb schedules

Bug #721358 reported by Peter Cooner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mythplugins
Unknown
Unknown
mythplugins (Ubuntu)
Triaged
Medium
Unassigned

Bug Description

Binary package hint: mythplugins

I'm using mythweb on the mythbuntu ppa repo so I hope this is the correct place to report this.

Steps to reproduce (100%)
1. Go to http://localhost/mythweb/tv/schedules/manual
2. Create schedule
3. Click on the newly created schedule link such as http://localhost/mythweb/tv/schedules/manual/21
4. Select "Cancel this schedule"
5. Save schedule

I'm given an infinite redirect loop such as this: http://arrival.local/mythweb/tv/schedules/manual/tv/tv/tv/tv/tv/tv/tv/tv/tv/tv/tv/tv/tv/tv/tv/tv/tv/tv/tv/tv/tv/schedules

I can see this in my Apache log as well, adding another instance of "/tv" every time, such as these log entries

192.168.xxx.xxx - - [18/Feb/2011:10:46:37 -0500] "GET /mythweb/tv/schedules/manual/tv/schedules HTTP/1.1" 302 457 "http://arrival.local/mythweb/tv/schedules/manual/21" "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13"
192.168.xxx.xxx - - [18/Feb/2011:10:46:37 -0500] "GET /mythweb/tv/schedules/manual/tv/tv/schedules HTTP/1.1" 302 457 "http://arrival.local/mythweb/tv/schedules/manual/21" "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13"

This happens in both Firefox 3.6, Firefox 4.0, and Google-Chrome

I'm not a PHP programmer, but I had a look at the code and thought maybe it had to do with this difference

modules/tv/schedules_manual.php
24: redirect_browser('tv/schedules');
53: header('Location: tv/schedules');
109: header('Location: tv/schedules/manual/'.$schedule->recordid);

modules/tv/schedules_custom.php
26: redirect_browser(root_url.'tv/schedules');
67: header('Location: '.root_url.'tv/schedules');
148: header('Location: '.root_url.'tv/schedules/custom/'.$schedule->recordid);

Note the use of root_url in the redirect in the schedules_custom.php... I added the root_url piece to schedules_manual.php and this seemed to fix the redirect problem. I don't know if there are additional hacks needed to really fix the problem though.

Other infos:
$ lsb_release -rd
Description: Ubuntu 10.04.2 LTS
Release: 10.04

$ apt-cache policy mythwebmythweb:
  Installed: 2:0.24.0+fixes.20110218.2b7036f-0ubuntu0mythbuntu1
  Candidate: 2:0.24.0+fixes.20110218.2b7036f-0ubuntu0mythbuntu1
  Version table:
 *** 2:0.24.0+fixes.20110218.2b7036f-0ubuntu0mythbuntu1 0
        500 http://ppa.launchpad.net/mythbuntu/0.24/ubuntu/ lucid/main Packages
        100 /var/lib/dpkg/status
     0.23.0+fixes24104-0ubuntu2 0
        500 http://us.archive.ubuntu.com/ubuntu/ lucid/multiverse Packages

Revision history for this message
Peter Cooner (petriborg) wrote :

--- schedules_manual.php.orig 2011-02-18 11:26:28.926032333 -0500
+++ schedules_manual.php 2011-02-18 11:25:47.017912399 -0500
@@ -21,7 +21,7 @@
         $schedule =& Schedule::find($_GET['recordid']);
     // Not a manual schedule
         if (empty($schedule->search) || $schedule->search != searchtype_manual)
- redirect_browser('tv/schedules');
+ redirect_browser(root_url.'tv/schedules');
     }
 // Create a new, empty schedule
     else
@@ -50,7 +50,7 @@
             // Redirect back to the schedule list
                 add_warning(t('The requested recording schedule has been deleted.'));
                 save_session_errors();
- header('Location: tv/schedules');
+ header('Location: '.root_url.'tv/schedules');
                 exit;
             }
         }
@@ -106,7 +106,7 @@
         // Save the schedule
             $schedule->save($type);
         // Redirect to the new schedule
- header('Location: tv/schedules/manual/'.$schedule->recordid);
+ header('Location: '.root_url.'tv/schedules/manual/'.$schedule->recordid);
             exit;
         }
     }

Revision history for this message
MarcRandolph (mrand) wrote :

Howdy, and thank you for helping to improve Mythtv and Mythbuntu by opening this ticket - and especially for attaching a patch! I've forwarded this upstream.

Changed in mythplugins (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
tags: added: patch
tags: added: patch-forwarded-upstream
Changed in mythplugins:
status: Unknown → New
Changed in mythplugins:
status: New → Confirmed
Changed in mythplugins:
status: Confirmed → Unknown
Revision history for this message
Peter Cooner (petriborg) wrote :

What does "status: Confirmed → Unknown" mean?

Revision history for this message
Thomas Mashos (tgm4883) wrote :

It means it has been attached to an upstream bug, and that launchpad cannot read the status of the upstream bug tracker

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.