Opened 10 years ago
Closed 9 years ago
#12003 closed Patch - Bug Fix (fixed)
Episode info not usable in templates in themes
Reported by: | Owned by: | ||
---|---|---|---|
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)
Change History (12)
Changed 10 years ago by
Attachment: | SetTextFromMap.patch added |
---|
comment:1 Changed 9 years ago by
Owner: | set to Jonatan Lindblad <jlindblad@…> |
---|---|
Resolution: | → fixed |
Status: | new → closed |
comment:2 Changed 9 years ago by
Milestone: | unknown → 0.27.5 |
---|
comment:3 Changed 9 years ago by
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 Changed 9 years ago by
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 Changed 9 years ago by
Resolution: | fixed |
---|---|
Status: | closed → new |
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 Changed 9 years ago by
Milestone: | 0.27.5 → 0.27.6 |
---|
comment:8 Changed 9 years ago by
Status: | new → infoneeded_new |
---|
comment:9 Changed 9 years ago by
Thank you, Karl. After upgrading to master after 9 months, I discovered MythUI <template>s were very broken. This change fixes them.
comment:10 Changed 9 years ago by
Replying to Karl Dietz <dekarl@…>:
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 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | infoneeded_new → closed |
In 6eb4afbd48652a99a2ec4cddd774de2101aacc83/mythtv: