From bd6dfb43beb7d97f663ba305ecfad8bee2556904 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sun, 5 Sep 2021 22:29:43 -0700 Subject: [PATCH] Fix #912 by using the correct argument; Also fix the tests on macOS (and now my machine) where some version of libxml2 has an error that causes syntax errors in the resulting XML --- openlp/core/lib/mediamanageritem.py | 2 +- openlp/plugins/songs/lib/openlyricsxml.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 5c651a74d..d82ef8ffb 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -594,7 +594,7 @@ class MediaManagerItem(QtWidgets.QWidget, RegistryProperties, LogMixin): # multiple service items? if self.single_service_item: self.log_debug('{plugin} Add requested'.format(plugin=self.plugin.name)) - self.add_to_service(replace=self.remote_triggered) + self.add_to_service(remote=self.remote_triggered) else: items = self.list_view.selectedIndexes() drop_position = self.service_manager.get_drop_position() diff --git a/openlp/plugins/songs/lib/openlyricsxml.py b/openlp/plugins/songs/lib/openlyricsxml.py index 0230b710c..83d40e54e 100644 --- a/openlp/plugins/songs/lib/openlyricsxml.py +++ b/openlp/plugins/songs/lib/openlyricsxml.py @@ -675,8 +675,10 @@ class OpenLyrics(object): """ text = '' # Convert lxml.objectify to lxml.etree representation. - lines = etree.tostring(lines) - element = etree.XML(lines) + string_lines = etree.tostring(lines) + # lxml 4.6.x or some recent version of libxml2 seems to add the left-over tags in + string_lines = string_lines.replace('', '').replace('', '').replace('') + element = etree.XML(string_lines) # OpenLyrics 0.8 uses
for new lines. Append text from "lines" element to verse text. if version > '0.7':