Bug 21742 - Incorrect count of youtube videos
Summary: Incorrect count of youtube videos
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low major
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 14168
Blocks:
  Show dependency treegraph
 
Reported: 2018-10-31 20:18 UTC by Jonathan Druart
Modified: 2020-01-06 20:14 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 21742: Fix YouTube variable propagation (1.61 KB, patch)
2018-10-31 20:20 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2018-10-31 20:18:06 UTC
To recreate:
1 - Enable HTML5Media and HTML5MediaYouTube
2 - Add 856$u to record for a youtube vido and a pdf (sample record
        attached to bug)
3 - View the record, the Play media tab has two video boxes
4 - Play the second, it fails


From bug 21476 comment 9
Comment 1 Jonathan Druart 2018-10-31 20:20:37 UTC
Created attachment 81779 [details] [review]
Bug 21742: Fix YouTube variable propagation

The loop to find all media has an $isyoutube variable. This was declared
outside the loop and never reset. Once a YouTube video was encountered
all subsequent videos were considered as YouTube. This patch reduces the
scope of the variable and resets per loop.

To test:
1 - Enable HTML5Media and HTML5MediaYouTube
2 - Add 856$u to record for a youtube vido and a pdf (sample record
        attached to bug)
3 - View the record, the Play media tab has two video boxes
4 - Play the second, it fails
5 - Apply patch
6 - View record, Play media should include only one video link

Signed-off-by: Devinim <kohadevinim@devinim.com.tr>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 2 Nick Clemens (kidclamp) 2018-11-01 19:10:33 UTC
Awesome work all!

Pushed to master for 18.11
Comment 3 Martin Renvoize (ashimema) 2018-11-09 16:12:04 UTC
Pushed to 18.05.x for 18.05.06
Comment 4 Fridolin Somers 2018-11-26 06:33:38 UTC
Pushed to 17.11.x for 17.11.12