openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #28508
[Merge] lp:~suutari-olli/openlp/prevent-shorter-than-3-char-bible-search into lp:openlp
Azaziah has proposed merging lp:~suutari-olli/openlp/prevent-shorter-than-3-char-bible-search into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
For more details, see:
https://code.launchpad.net/~suutari-olli/openlp/prevent-shorter-than-3-char-bible-search/+merge/283726
At the moment Bible text search feature allows to search keywords of any length.
For an example search “A” will make OpenLP unresponsive for several minutes and
and may lead to crashing of the program.
This branch fixes this situation by adding a minimum
keyword length of 3 characters for "Quick text" search.
--------------------------------
lp:~suutari-olli/openlp/prevent-shorter-than-3-char-bible-search (revision 2610)
[←[1;32mSUCCESS←[1;m] https://ci.openlp.io/job/Branch-01-Pull/1271/
[←[1;32mSUCCESS←[1;m] https://ci.openlp.io/job/Branch-02-Functional-Tests/1195/
[←[1;32mSUCCESS←[1;m] https://ci.openlp.io/job/Branch-03-Interface-Tests/1134/
[←[1;32mSUCCESS←[1;m] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/970/
[←[1;31mFAILURE←[1;m] https://ci.openlp.io/job/Branch-04b-Windows_Interface_Tests/562/
Stopping after failure
--
Your team OpenLP Core is requested to review the proposed merge of lp:~suutari-olli/openlp/prevent-shorter-than-3-char-bible-search into lp:openlp.
=== modified file 'openlp/plugins/bibles/lib/manager.py'
--- openlp/plugins/bibles/lib/manager.py 2015-12-31 22:46:06 +0000
+++ openlp/plugins/bibles/lib/manager.py 2016-01-23 19:35:03 +0000
@@ -344,7 +344,15 @@
translate('BiblesPlugin.BibleManager', 'Text Search is not available with Web Bibles.')
)
return None
- if text:
+
+ if len(text) < 3:
+ self.main_window.information_message(
+ translate('BiblesPlugin.BibleManager', 'Keyword is too short'),
+ translate('BiblesPlugin.BibleManager', 'The keyword you have entered is shorter '
+ 'than 3 characters long.\nPlease try again with '
+ 'a longer keyword.')
+ )
+ elif text:
return self.db_cache[bible].verse_search(text)
else:
self.main_window.information_message(