Skip to content

Commit

Permalink
Merge pull request #864 from Joomla-Bible-Study/development
Browse files Browse the repository at this point in the history
v9.2.8
  • Loading branch information
bcordis authored Jun 2, 2021
2 parents df57a4d + f11895c commit 1ff2ef8
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 25 deletions.
2 changes: 1 addition & 1 deletion admin/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
define('JBSM_PROFILER', 0);

// Version information
define('BIBLESTUDY_VERSION', '9.2.7');
define('BIBLESTUDY_VERSION', '9.2.8');
define('BIBLESTUDY_VERSION_UPDATEFILE', 'JBS Version ' . BIBLESTUDY_VERSION);

// Default values
Expand Down
2 changes: 1 addition & 1 deletion admin/install/sql/install.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ CREATE TABLE IF NOT EXISTS `#__bsms_update` (

INSERT IGNORE INTO `#__bsms_update` (`id`, `version`)
VALUES
(1, '9.3.7');
(1, '9.2.8');

-- --------------------------------------------------------

Expand Down
8 changes: 8 additions & 0 deletions admin/install/sql/updates/mysql/9.2.8.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CREATE TABLE IF NOT EXISTS `#__bsms_update` (
id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
version VARCHAR(255) DEFAULT NULL,
PRIMARY KEY (id)
) DEFAULT CHARSET=utf8;

INSERT INTO `#__bsms_update` (id, version) VALUES ('38', '9.2.8')
ON DUPLICATE KEY UPDATE version = '9.2.8';
47 changes: 28 additions & 19 deletions admin/models/server.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,25 @@ class BiblestudyModelServer extends JModelAdmin
/**
* Data
*
* @var Object
* @var object
* @since 9.0.0
*/
private $data;

/**
* @var boolean
* @since 9.0.0
* @todo need to look into this and see if we need it still.
*/
private $event_after_upload;

/**
* Constructor
*
* @param array $config An array of configuration options (name, state, dbo, table_path, ignore_request).
*
* @since 12.2
* @throws Exception
* @since 12.2
*/
public function __construct($config = array())
{
Expand All @@ -54,15 +59,13 @@ public function __construct($config = array())
* @param int $pk ID to get
* @param bool $ext If comfing from externl
*
* @return String
* @return string
*
* @since 9.0.0
*/
public function getType($pk, $ext = false)
{
$item = $this->getItem($pk, $ext);

return $item->type;
return $this->getItem($pk, $ext)->type;
}

/**
Expand Down Expand Up @@ -101,7 +104,7 @@ public function getItem($pk = null, $ext = false)
$type = $this->getState('server.type');
}

$this->data->type = empty($type) ? $this->data->type : $type;
$this->data->type = empty($type) ? $this->data->type : $type;

// Load server type configuration if available
if ($this->data->type)
Expand All @@ -125,9 +128,8 @@ public function getItem($pk = null, $ext = false)
public function getConfig($addon)
{
$path = JPATH_ADMINISTRATOR . '/components/com_biblestudy/addons/servers/' . $addon . '/' . $addon . '.xml';
$xml = simplexml_load_file($path);

return $xml;
return simplexml_load_string(file_get_contents($path));
}

/**
Expand All @@ -141,6 +143,13 @@ public function getConfig($addon)
*/
public function save($data)
{
if (strpos($data['server_name'], '"onmouseover="prompt(1)"') !== false)
{
$this->setError('"Illegal character use in Server Name field"');

return false;
}

if (isset($data['params']['path']))
{
if (strpos($data['params']['path'], '//'))
Expand Down Expand Up @@ -196,7 +205,7 @@ public function getAddonServerForm()

$form = $this->loadForm('com_biblestudy.server.' . $type, $type, array('control' => 'jform', 'load_data' => true), true, "/server");

if (empty($form))
if ($form === null)
{
return false;
}
Expand All @@ -212,6 +221,7 @@ public function getAddonServerForm()
*
* @return mixed A JForm object on success, false on failure
*
* @throws \Exception
* @since 7.0
*/
public function getForm($data = array(), $loadData = true)
Expand All @@ -224,7 +234,7 @@ public function getForm($data = array(), $loadData = true)
// Get the forms.
$form = $this->loadForm('com_biblestudy.server', 'server', array('control' => 'jform', 'load_data' => $loadData));

if (empty($form))
if ($form === null)
{
return false;
}
Expand Down Expand Up @@ -266,18 +276,18 @@ protected function canEditState($record)
if (!empty($record->id))
{
return $user->authorise('core.edit.state', 'com_biblestudy.server.' . (int) $record->id);
} /* Default to component settings if neither article nor category known. */
else
{
return parent::canEditState($record);
}

// Default to component settings if neither article nor category known.
return parent::canEditState($record);
}

/**
* Method to get the data that should be injected in the form.
*
* @return array The default data is an empty array.
* @return object The default data is an empty array.
*
* @throws \Exception
* @since 9.0.0
* @TODO This gets called twice, because we're loading two forms. (There is a redundancy
* in the bind() because the data is itereted over 2 times, 1 for each form). Possibly,
Expand All @@ -288,9 +298,7 @@ protected function loadFormData()
// If current state has data, use it instead of data from db
$session = JFactory::getApplication()->getUserState('com_biblestudy.edit.server.data', array());

$data = empty($session) ? $this->data : $session;

return $data;
return empty($session) ? $this->data : $session;
}

/**
Expand All @@ -314,6 +322,7 @@ protected function cleanCache($group = null, $client_id = 0)
*
* @return void
*
* @throws \Exception
* @since 9.0.0
*/
protected function populateState()
Expand Down
4 changes: 2 additions & 2 deletions biblestudy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<authorEmail>[email protected]</authorEmail>
<authorUrl>https://www.christianwebministries.org</authorUrl>
<copyright>(C) 2007 - 2019 Proclaim All rights reserved.</copyright>
<version>9.2.7</version>
<creationDate>April 31, 2021</creationDate>
<version>9.2.8</version>
<creationDate>June 2, 2021</creationDate>
<license>http://www.gnu.org/licenses/gpl.html</license>
<description>JBS_INS_XML_DESCRIPTION</description>

Expand Down
6 changes: 4 additions & 2 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,10 @@

<!-- Create com_proclaim-x.x.x.zip -->
<target name="component" depends="init,dev.clean" description="Builds the component">
<delete file="${basedir}/build/com_proclaim-9.2.7.zip"/>
<zip destfile="${basedir}/build/com_proclaim-9.2.7.zip" basedir="${basedir}">
<propertyprompt propertyName="version" defaultValue="9.2.x"
promptText="Enter the version you are building."/>
<delete file="${basedir}/build/com_proclaim-${version}.zip"/>
<zip destfile="${basedir}/build/com_proclaim-${version}.zip" basedir="${basedir}">
<fileset defaultexcludes="true" dir=".">
<include name="admin/**"/>
<include name="media/**"/>
Expand Down
Binary file not shown.

0 comments on commit 1ff2ef8

Please sign in to comment.