Stable release of v2.0.22

Fixed search redirect bug.
This commit is contained in:
Robot 2023-08-21 18:31:01 +02:00
parent 91264e8511
commit 0a434aa6f0
Signed by: Robot
GPG Key ID: 14DECD44E7E1BB95
14 changed files with 48 additions and 36 deletions

View File

@ -108,4 +108,8 @@
- Adds Tags meta data to tag pages
- Adds option to share a tag
- Improve the URL creation, and return URL feature for search and tag pages
- Improve the URL creation, and return URL feature for search and tag pages
# v2.0.22
- Fixed search redirect bug

View File

@ -1,4 +1,4 @@
# Get Bible (2.0.21)
# Get Bible (2.0.22)
![Get Bible image](https://git.vdm.dev/getBible/joomla-component/raw/branch/master/admin/assets/images/vdm-component.jpg "GetBible")
@ -19,7 +19,7 @@ In essence, The Bible for Joomla is designed to transform how the Word of God is
+ *Name*: [Get Bible](https://getbible.net)
+ *First Build*: 3rd December, 2015
+ *Last Build*: 21st August, 2023
+ *Version*: 2.0.21
+ *Version*: 2.0.22
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
@ -31,8 +31,8 @@ due to [Automated Component Builder](https://www.joomlacomponentbuilder.com))
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
> never making one mistake or taking any coffee break.)
+ *Line count*: **199323**
+ *File count*: **1721**
+ *Line count*: **199334**
+ *File count*: **1722**
+ *Folder count*: **163**
**367 Hours** or **45 Eight Hour Days** (the actual time the author spent)

View File

@ -1,4 +1,4 @@
# Get Bible (2.0.21)
# Get Bible (2.0.22)
![Get Bible image](https://git.vdm.dev/getBible/joomla-component/raw/branch/master/admin/assets/images/vdm-component.jpg "GetBible")
@ -19,7 +19,7 @@ In essence, The Bible for Joomla is designed to transform how the Word of God is
+ *Name*: [Get Bible](https://getbible.net)
+ *First Build*: 3rd December, 2015
+ *Last Build*: 21st August, 2023
+ *Version*: 2.0.21
+ *Version*: 2.0.22
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
@ -31,8 +31,8 @@ due to [Automated Component Builder](https://www.joomlacomponentbuilder.com))
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
> never making one mistake or taking any coffee break.)
+ *Line count*: **199323**
+ *File count*: **1721**
+ *Line count*: **199334**
+ *File count*: **1722**
+ *Folder count*: **163**
**367 Hours** or **45 Eight Hour Days** (the actual time the author spent)

View File

@ -0,0 +1 @@

View File

@ -7,9 +7,9 @@
<authorUrl>https://getbible.net</authorUrl>
<copyright>Copyright (C) 2015. All Rights Reserved</copyright>
<license>GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html</license>
<version>2.0.21</version>
<version>2.0.22</version>
<description><![CDATA[
<h1>Get Bible (v.2.0.21)</h1>
<h1>Get Bible (v.2.0.22)</h1>
<div style="clear: both;"></div>
<p>Welcome to the next level of scripture engagement - The Bible for Joomla! Our purpose is to bring the Word of God to every person, in their native language, entirely free. This isn't just a typical extension; it's a groundbreaking tool developed to span language divides and deliver a rich, customizable Bible study experience to users worldwide.

View File

@ -1539,7 +1539,7 @@ class com_getbibleInstallerScript
echo '<a target="_blank" href="https://getbible.net" title="Get Bible">
<img src="components/com_getbible/assets/images/vdm-component.jpg"/>
</a>
<h3>Upgrade to Version 2.0.21 Was Successful! Let us know if anything is not working as expected.</h3>';
<h3>Upgrade to Version 2.0.22 Was Successful! Let us know if anything is not working as expected.</h3>';
// Set db if not set already.
if (!isset($db))

View File

@ -39,16 +39,6 @@ const handleSearch = async () => {
}
};
/**
* JS Function to update the URL of the browser with the search query
*/
const updateUrlQuery = async () => {
if (!urlCurrent.includes(urlSearch)) {
// update the url query
// window.history.pushState({}, '', urlSearch);
}
};
/**
* JS Function to redirect to new search
*/

View File

@ -60,6 +60,7 @@ class GetbibleController extends BaseController
'tag' => 'STRING',
'linker' => 'STRING',
'return' => 'BASE64',
'bibleurl' => 'BASE64',
'layout' => 'STRING',
'format' => 'STRING',
'Itemid' => 'INT'

View File

@ -446,7 +446,7 @@ class GetbibleModelAjax extends ListModel
$return = '';
if ($book > 0 && $chapter > 0)
{
$return = '&return=' . urlencode(base64_encode((string) JRoute::_('index.php?option=com_getbible&view=app&t=' . $translation . '&Itemid=' . $this->app_params->get('app_menu', 0) . '&book=' . $book . '&chapter=' . $chapter)));
$return = '&bibleurl=' . urlencode(base64_encode(trim(JUri::base(), '/') . JRoute::_('index.php?option=com_getbible&view=app&t=' . $translation . '&Itemid=' . $this->app_params->get('app_menu', 0) . '&book=' . $book . '&chapter=' . $chapter)));
}
return ['url' => trim(trim(JUri::base(), '/') . JRoute::_('index.php?option=com_getbible&view=search&Itemid=' . $this->app_params->get('app_menu', 0) . $return . '&t=' . $translation . '&words=' . $words . '&match=' . $match . '&case=' . $case . '&target=' . $target . '&search=' . $search ?? ''))];
@ -486,7 +486,7 @@ class GetbibleModelAjax extends ListModel
$return = urlencode(base64_encode((string) JRoute::_('index.php?option=com_getbible&view=app&t=' . $translation . '&Itemid=' . $this->app_params->get('app_menu', 0) . '&book=' . $book . '&chapter=' . $chapter)));
// we return the AI url
return ['url' => trim(trim(JUri::base(), '/') . JRoute::_('index.php?option=com_getbible&view=openai&t=' . $translation . '&Itemid=' . $this->app_params->get('app_menu', 0) . '&return=' . $return . '&guid=' . $guid . '&book=' . $book . '&chapter=' . $chapter . '&verse=' . $verse . '&words=' . $words))];
return ['url' => trim(trim(JUri::base(), '/') . JRoute::_('index.php?option=com_getbible&view=openai&t=' . $translation . '&Itemid=' . $this->app_params->get('app_menu', 0) . '&bibleurl=' . $return . '&guid=' . $guid . '&book=' . $book . '&chapter=' . $chapter . '&verse=' . $verse . '&words=' . $words))];
}
return ['error' => 'There was an error please try again.'];

View File

@ -203,7 +203,7 @@ class GetbibleViewApp extends HtmlView
{
$this->setReturnUrl();
}
return '&return=' . $this->url_return;
return '&bibleurl=' . $this->url_return;
}
/**

View File

@ -24,7 +24,6 @@ defined('_JEXEC') or die('Restricted access');
<?php echo $this->loadTemplate('getbiblesearchoptions'); ?>
</div>
<script type="text/javascript">
const urlCurrent = window.location.href;
// set the options and form triggers
const searchField = document.getElementById('getbible-search-field');
const searchFieldTranslation = document.getElementById('getbible-search-translation');
@ -32,8 +31,6 @@ defined('_JEXEC') or die('Restricted access');
const searchFieldMatch = document.getElementById('getbible-search-match');
const searchFieldCase = document.getElementById('getbible-search-case');
const searchFieldTarget = document.getElementById('getbible-search-target');
// keep URL in sync with the given
updateUrlQuery();
// Event listeners for the search field and options
searchField.addEventListener('keydown', function(event) {
if (event.key === 'Enter') {

View File

@ -257,7 +257,7 @@ class GetbibleViewSearch extends HtmlView
if (!empty($this->url_return_value))
{
return '&return=' . $this->url_return_value;
return '&bibleurl=' . $this->url_return_value;
}
return '';
@ -595,7 +595,7 @@ class GetbibleViewSearch extends HtmlView
*/
protected function setReturnUrl(): void
{
$encodedUrl = $this->input->get('return', null, 'base64');
$encodedUrl = $this->input->get('bibleurl', null, 'base64');
if ($encodedUrl === null)
{
@ -642,8 +642,8 @@ class GetbibleViewSearch extends HtmlView
protected function setSearchUrl()
{
// set the current search URL
$this->url_search = JRoute::_('index.php?option=com_getbible&view=search&t=' .
$this->translation->abbreviation . $this->getReturnUrlValue() .
$this->url_search = JRoute::_('index.php?option=com_getbible&view=search&Itemid=' . $this->params->get('app_menu', 0) .
'&t=' . $this->translation->abbreviation . $this->getReturnUrlValue() .
'&words=' . $this->getWords() . '&match=' . $this->getMatch() .
'&case=' . $this->getCase() . '&target=' . $this->getTarget() . '&search=' . $this->getSearch());
}
@ -657,8 +657,9 @@ class GetbibleViewSearch extends HtmlView
protected function setCanonicalUrl()
{
// set the current search URL
$this->url_canonical = trim($this->getBaseUrl(), '/') . JRoute::_('index.php?option=com_getbible&view=search&t=' .
$this->translation->abbreviation . '&words=' . $this->getWords() .
$this->url_canonical = trim($this->getBaseUrl(), '/') .
JRoute::_('index.php?option=com_getbible&view=search&Itemid=' . $this->params->get('app_menu', 0) .
'&t=' . $this->translation->abbreviation . '&words=' . $this->getWords() .
'&match=' . $this->getMatch() . '&case=' . $this->getCase() .
'&target=' . $this->getTarget() . '&search=' . $this->getSearch());
}

View File

@ -271,7 +271,7 @@ class GetbibleViewTag extends HtmlView
if (!empty($this->url_return_value))
{
return '&return=' . $this->url_return_value;
return '&bibleurl=' . $this->url_return_value;
}
return '';
@ -317,7 +317,7 @@ class GetbibleViewTag extends HtmlView
*/
protected function setReturnUrl(): void
{
$encodedUrl = $this->input->get('return', null, 'base64');
$encodedUrl = $this->input->get('bibleurl', null, 'base64');
if ($encodedUrl === null)
{

View File

@ -359,4 +359,22 @@
<maintainerurl>https://getbible.net</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
<update>
<name>Get Bible</name>
<description>The Bible for Joomla</description>
<element>pkg_getbible</element>
<type>package</type>
<client>site</client>
<version>2.0.22</version>
<infourl title="Get Bible!">https://getbible.net</infourl>
<downloads>
<downloadurl type="full" format="zip">https://git.vdm.dev/api/v1/repos/getBible/joomla-pkg/archive/v2.0.22.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>https://getbible.net</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
</updates>