Opened 14 years ago

Closed 14 years ago

#7502 closed defect (fixed)

Mythweb fatal error when clicking "Never Record"

Reported by: stichnot@… Owned by: Rob Smith
Priority: minor Milestone: 0.23
Component: Plugin - MythWeb Version: 0.22-fixes
Severity: medium Keywords:
Cc: Ticket locked: no

Description

Search for a program that isn't associated with a recording rule, then select the program and click the "Never Record" button. This gives a fatal error message, the gist of which is:

error string:  SQL Error: Column 'recordid' cannot be null
    filename:  /usr/share/mythweb/modules/tv/classes/Program.php
  error line:  711

If this error is fixed, it reveals a similar error that column 'rectype' cannot be null. It appears to me that both values should be 0 if there is no corresponding recording rule.

Here is a sample patch, but maybe there is a better way to do it.

Index: mythweb/modules/tv/classes/Program.php
===================================================================
--- mythweb/modules/tv/classes/Program.php      (revision 22733)
+++ mythweb/modules/tv/classes/Program.php      (working copy)
@@ -703,9 +703,9 @@
                                 .escape($this->category)                  .','
                                 .escape($this->seriesid)                  .','
                                 .escape($this->programid)                 .','
-                                .escape($this->recordid)                  .','
+                                .escape(isset($this->recordid) ? $this->recordid : 0)                  .','
                                 .escape($this->channel->callsign)         .','
-                                .escape($this->rectype)                   .','
+                                .escape(isset($this->rectype) ? $this->rectype : 0)                   .','
                                 .'11'                                     .','
                                 .'1'                                      .')')
             or trigger_error('SQL Error: '.mysql_error(), FATAL);

Here is more of the error output.

    datetime:  2009-11-04 10:20:46 (PST)
    errornum:  256
  error type:  User Error
error string:  SQL Error: Column 'recordid' cannot be null
    filename:  /usr/share/mythweb/modules/tv/classes/Program.php
  error line:  711

==========================================================================

Backtrace: 

    file:  /usr/share/mythweb/modules/tv/classes/Program.php
    line:  711
   class:  
function:  trigger_error
    type:  
    args:  Array
(
    [0] => SQL Error: Column 'recordid' cannot be null
    [1] => 256
)

    file:  /usr/share/mythweb/modules/tv/detail.php
    line:  258
   class:  Program
function:  rec_never_record
    type:  ->
    args:  Array ( )
    file:  /usr/share/mythweb/modules/tv/handler.php
    line:  87
   class:  
function:  require_once
    type:  
    args:  Array
(
    [0] => /usr/share/mythweb/modules/tv/detail.php
)

    file:  /usr/share/mythweb/mythweb.php
    line:  35
   class:  
function:  require_once
    type:  
    args:  Array
(
    [0] => /usr/share/mythweb/modules/tv/handler.php
)

Attachments (1)

7502.patch (1.1 KB) - added by Jim Stichnoth <stichnot@…> 14 years ago.
Attaching patch file instead of inline patch text.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 14 years ago by NotFakeBarry@…

This error occurs on my system (0.21) as well. Why has the patch not been applied?

comment:2 Changed 14 years ago by stuartm

Ticket locked: set

0.21 is not supported.

comment:3 Changed 14 years ago by Stuart Auchterlonie

Milestone: unknown0.23
Ticket locked: unset
Version: unknown0.22-fixes

Unlocking so Jim can attach patch here.

Stuart

Changed 14 years ago by Jim Stichnoth <stichnot@…>

Attachment: 7502.patch added

Attaching patch file instead of inline patch text.

comment:4 Changed 14 years ago by sphery

Resolution: fixed
Status: newclosed

(In [23625]) Fixes #7502. Fix Never Record in MythWeb when recordid and rectype aren't set using patch from Jim Stichnoth.

Note: See TracTickets for help on using tickets.