Opened 11 years ago

Closed 11 years ago

#6371 closed defect (invalid)

User Job button not checked as default in MythWeb

Reported by: williams@… Owned by: xris
Priority: minor Milestone: 0.22
Component: Plugin - MythWeb Version: head
Severity: medium Keywords: MythWeb, Database, NULL
Cc: Ticket locked: no


I have User Job 1 selected in the mythtv. This works in the frontend's scheduler but is not defaulted in the Advanced part of detail.php in MythWeb.

The settings in the database have:

AutoRunUserJob1 1 NULL

SQL generated does not produced required result when getting a setting from the database. The SQL generated is:

SELECT data FROM settings WHERE value=? AND hostname LIKE ?

with args 'AutoRunUserJob1' and '%'. No rows are returned because LIKE '%' does not match NULL.

Changing the NULL to say 'all' gets around the problem in MythWeb but breaks the frontend defaults.

get_backend_setting() in ./includes/utils.php provides '%' if the hostname argument is null. If you have several backend servers then you would get several results returned. I think the expected result is one row (at least for AutoRunUserJobX) which is why the hostname is NULL in the settings table.

Very strangely on my setup too:

CentOS 5.2 php-5.1.6-20.el5_2.1 mysql-server-5.0.45-7.el5

$schedule->autouserjob1 = get_backend_setting('AutoRunUserJob1');

behaves differently to:

<dt><?php echo get_backend_setting('UserJobDesc1') ?>:</dt>

in that the second example 'misses' the

if (is_null($host))

in "function get_backend_setting($setting, $host = null)" ending in sql with "IS NULL" rather than "LIKE '%'".

This is in MythWeb from SVN 20063.

Change History (4)

comment:1 Changed 11 years ago by anonymous

The 'very strangely' bit is explained by _advanced_options.php calling:

<?php echo setting('UserJobDesc1')

and not using get_backend_setting at all.

comment:2 Changed 11 years ago by Shane Shrybman

Component: MythTV - GeneralPlugin - MythWeb
Milestone: unknown0.22
Owner: changed from Isaac Richards to xris
Version: unknownhead

May be a duplicate of #6324.

The patch on #6324 attempts to fix get_backend_setting(..)

comment:3 Changed 11 years ago by Rob Smith

Status: newinfoneeded_new

Still a problem?

comment:4 Changed 11 years ago by robertm

Resolution: invalid
Status: infoneeded_newclosed

No response in four weeks, closing. If still an issue with .22, open a new ticket.

Note: See TracTickets for help on using tickets.