Opened 12 years ago

Closed 10 years ago

#12003 closed Patch - Bug Fix (fixed)

Episode info not usable in templates in themes

Reported by: thomas@… Owned by: Jonatan Lindblad <jlindblad@…>
Priority: minor Milestone: 0.27.6
Component: Themes Version: Unspecified
Severity: medium Keywords:
Cc: Ticket locked: no

Description

I'm opening this bug and attaching this patch as requested by JYA in November. I couldn't find a bug already open on this issue.

The theming guide says we should be able to use %##x##% in theme templates to show season and episode info, but it does not work (in 0.27, perhaps master as well).

This is Jonatan Lindblad's patch, he mentions

"It looks like an issue with the regular expression used to extract the fields. # is not a word character and therefore the matching fails. The attached patch should fix that by matching against non-whitespace characters."

The full thread is here http://www.mythtv.org/pipermail/mythtv-theming/2013-November/000894.html

Attachments (1)

SetTextFromMap.patch (1.2 KB ) - added by anonymous 12 years ago.

Download all attachments as: .zip

Change History (12)

by anonymous, 12 years ago

Attachment: SetTextFromMap.patch added

comment:1 by Jonatan Lindblad <jlindblad@…>, 11 years ago

Owner: set to Jonatan Lindblad <jlindblad@…>
Resolution: fixed
Status: newclosed

In 6eb4afbd48652a99a2ec4cddd774de2101aacc83/mythtv:

Error: Processor CommitTicketReference failed
GIT backend not available

comment:2 by paulh, 11 years ago

Milestone: unknown0.27.5

comment:3 by Frank Phillips <fphillips81@…>, 11 years ago

My problem is this commit causes the regex to capture parentheses because we went from word chacters (\w) to any non-whitespace char (\S). This creates a non-matching variable like "YEAR|)". Please revert this commit. If it is necessary to keep them around in 0.27 branch, you can change (\w+) to (\w+|##x##|s##e##).

To be specific, we are talking about the use of ##x##/s##e## as variables in template text (and only in video-ui, for historical reasons). It is documented in wiki:Video-ui.xml, but I doubt if this ever worked. The regex hasn't changed since 2010 [96df30] and the map was created in 2012 [34b933]. Why enable it now, backed by the 00x00/s00e00 alternatives in [d4e651]? The themes I have looked at only used ##x##/s##e## as textarea name attributes, which don't use the regex. I don't know if there has been any netvision/rss usage.

I've been using http://sourceforge.net/projects/qregexp-editor/ to visualize the captures.

comment:4 by Frank Phillips <fphillips81@…>, 11 years ago

Here is qregexp-editor output, for reference.

With \S:

% (|YEAR|)%" 
"--> Capture 1:  (|" 
"------> Pos:8" 
"--> Capture 2:  (" 
"------> Pos:8" 
"--> Capture 3: " 
"--> Capture 4: YEAR|)" 
"------> Pos:11" 
"--> Capture 5: " 
"--> Capture 6: " 

With commit reverted (\w):

% (|YEAR|)%" 
"--> Capture 1:  (|" 
"------> Pos:8" 
"--> Capture 2:  (" 
"------> Pos:8" 
"--> Capture 3: " 
"--> Capture 4: YEAR" 
"------> Pos:11" 
"--> Capture 5: |)" 
"------> Pos:15" 
"--> Capture 6: )" 
"------> Pos:16" 

comment:5 by Karl Egly, 11 years ago

Resolution: fixed
Status: closednew

reopening to track Frank's remark

this commit causes the regex to capture parentheses because we went from word chacters (\w) to any non-whitespace char (\S). This creates a non-matching variable like "YEAR|)". Please revert this commit. If it is necessary to keep them around in 0.27 branch, you can change (\w+) to (\w+|##x##|s##e##).

comment:6 by Stuart Auchterlonie, 10 years ago

Milestone: 0.27.50.27.6

comment:7 by Karl Dietz <dekarl@…>, 10 years ago

In bb6fe50f70e47b836bcc9752af32996fd114a15e/mythtv:

Error: Processor CommitTicketReference failed
GIT backend not available

comment:8 by Karl Egly, 10 years ago

Status: newinfoneeded_new

comment:9 by jpoet, 10 years ago

Thank you, Karl. After upgrading to master after 9 months, I discovered MythUI <template>s were very broken. This change fixes them.

in reply to:  7 comment:10 by Frank Phillips <fphillips81@…>, 10 years ago

Replying to Karl Dietz <dekarl@…>:

In bb6fe50f70e47b836bcc9752af32996fd114a15e/mythtv:

Error: Processor CommitTicketReference failed
GIT backend not available

I just rebuilt qregexp-editor following INSTALL from the 0.2.1 tarball on Arch. For usage, note that cpp wants double backslashes and the tool wants singles.

I tested the strings I use with it and they check out:

%DESCRIPTION%
%TITLE%% (|YEAR|)%
%LONGREPEAT%%(|STARS|) %%DESCRIPTION%
%##x##%
%s##e##%

I'll pull it into fixes/0.27 once I hear success reports.

Refs #12003 }}}

I'm not able to test 0.27 with the change at this time.

comment:11 by Karl Dietz <dekarl@…>, 10 years ago

Resolution: fixed
Status: infoneeded_newclosed

In e5e095bcb6d03f1edd107c04a8cd14c90145c079/mythtv:

Error: Processor CommitTicketReference failed
GIT backend not available
Note: See TracTickets for help on using tickets.