Skip to content

Commit

Permalink
Merge commit '8afc860' into 4.0-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonge committed Dec 28, 2018
2 parents ffe224e + 8afc860 commit 7794e96
Show file tree
Hide file tree
Showing 28 changed files with 71 additions and 74 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,16 @@ public function save()
// Validate the posted data.
$return = $model->validate($form, $data);

// Save the posted data in the session.
$this->app->setUserState('com_config.config.global.data', $data);

// Check for validation errors.
if ($return === false)
{
/*
* The validate method enqueued all messages for us, so we just need to redirect back.
*/

// Save the posted data in the session.
$this->app->setUserState('com_config.config.global.data', $data);

// Redirect back to the edit screen.
$this->setRedirect(Route::_('index.php?option=com_config', false));
}
Expand All @@ -126,9 +126,6 @@ public function save()
$data = $return;
$return = $model->save($data);

// Save the validated data in the session.
$this->app->setUserState('com_config.config.global.data', $data);

// Check the return value.
if ($return === false)
{
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_fields/Model/FieldModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ public function getItem($pk = null)
$result->context = Factory::getApplication()->input->getCmd('context', $this->getState('field.context'));
}

if (property_exists($result, 'fieldparams'))
if (property_exists($result, 'fieldparams') && $result->fieldparams !== null)
{
$registry = new Registry;

Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_finder/Model/IndexModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ protected function canEditState($record)
/**
* Method to delete one or more records.
*
* @param array &$pks An array of record primary keys.
* @param array $pks An array of record primary keys.
*
* @return boolean True if successful, false if an error occurs.
*
Expand Down Expand Up @@ -394,7 +394,7 @@ protected function populateState($ordering = 'l.title', $direction = 'asc')
/**
* Method to change the published state of one or more records.
*
* @param array &$pks A list of the primary keys to change.
* @param array $pks A list of the primary keys to change.
* @param integer $value The value of the published state. [optional]
*
* @return boolean True on success.
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_finder/Model/MapsModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ protected function canEditState($record)
/**
* Method to delete one or more records.
*
* @param array &$pks An array of record primary keys.
* @param array $pks An array of record primary keys.
*
* @return boolean True if successful, false if an error occurs.
*
Expand Down Expand Up @@ -330,7 +330,7 @@ protected function populateState($ordering = 'd.branch_title', $direction = 'ASC
/**
* Method to change the published state of one or more records.
*
* @param array &$pks A list of the primary keys to change.
* @param array $pks A list of the primary keys to change.
* @param integer $value The value of the published state. [optional]
*
* @return boolean True on success.
Expand Down
5 changes: 3 additions & 2 deletions administrator/components/com_finder/Table/FilterTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use Joomla\CMS\Application\ApplicationHelper;
use Joomla\CMS\Table\Table;
use Joomla\Database\DatabaseDriver;
use Joomla\Registry\Registry;
use Joomla\Utilities\ArrayHelper;

Expand All @@ -26,11 +27,11 @@ class FilterTable extends Table
/**
* Constructor
*
* @param \JDatabaseDriver $db \JDatabaseDriver connector object.
* @param DatabaseDriver $db Database Driver connector object.
*
* @since 2.5
*/
public function __construct(\JDatabaseDriver $db)
public function __construct(DatabaseDriver $db)
{
parent::__construct('#__finder_filters', 'filter_id', $db);
}
Expand Down
5 changes: 3 additions & 2 deletions administrator/components/com_finder/Table/LinkTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
namespace Joomla\Component\Finder\Administrator\Table;

use Joomla\CMS\Table\Table;
use Joomla\Database\DatabaseDriver;

defined('_JEXEC') or die;

Expand All @@ -22,11 +23,11 @@ class LinkTable extends Table
/**
* Constructor
*
* @param \JDatabaseDriver $db \JDatabaseDriver connector object.
* @param DatabaseDriver $db Database Driver connector object.
*
* @since 2.5
*/
public function __construct(\JDatabaseDriver $db)
public function __construct(DatabaseDriver $db)
{
parent::__construct('#__finder_links', 'link_id', $db);
}
Expand Down
5 changes: 3 additions & 2 deletions administrator/components/com_finder/Table/MapTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
defined('_JEXEC') or die;

use Joomla\CMS\Table\Table;
use Joomla\Database\DatabaseDriver;
use Joomla\Utilities\ArrayHelper;

/**
Expand All @@ -24,11 +25,11 @@ class MapTable extends Table
/**
* Constructor
*
* @param \JDatabaseDriver $db \JDatabaseDriver connector object.
* @param DatabaseDriver $db Database Driver connector object.
*
* @since 2.5
*/
public function __construct(\JDatabaseDriver $db)
public function __construct(DatabaseDriver $db)
{
parent::__construct('#__finder_taxonomy', 'id', $db);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ abstract class FinderIndexerAdapter extends JPlugin
/**
* Method to instantiate the indexer adapter.
*
* @param object &$subject The object to observe.
* @param array $config An array that holds the plugin configuration.
* @param object $subject The object to observe.
* @param array $config An array that holds the plugin configuration.
*
* @since 2.5
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ public static function getPrimaryLanguage($lang)
* Method to get extra data for a content before being indexed. This is how
* we add Comments, Tags, Labels, etc. that should be available to Finder.
*
* @param FinderIndexerResult &$item The item to index as a FinderIndexerResult object.
* @param FinderIndexerResult $item The item to index as a FinderIndexerResult object.
*
* @return boolean True on success, false on failure.
*
Expand Down
5 changes: 2 additions & 3 deletions administrator/components/com_finder/helpers/indexer/query.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,8 @@ public function __construct($options)
// Remove the temporary date storage.
unset($this->dates);

/*
* Lastly, determine whether this query can return a result set.
*/
// Lastly, determine whether this query can return a result set.

// Check if we have a query string.
if (!empty($this->input))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ protected function _getList($query, $limitstart = 0, $limit = 0)
/**
* Translate a list of objects
*
* @param array &$items The array of objects
* @param array $items The array of objects
*
* @return array The array of translated objects
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ protected function populateState($ordering = 'name', $direction = 'asc')
/**
* Enable/Disable an extension.
*
* @param array &$eid Extension ids to un/publish
* @param array $eid Extension ids to un/publish
* @param int $value Publish value
*
* @return boolean True on success
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ protected function getListQuery()
/**
* Translate a list of objects
*
* @param array &$items The array of objects
* @param array $items The array of objects
*
* @return array The array of translated objects
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ protected function populateState($ordering = 'name', $direction = 'asc')
/**
* Enable/Disable an extension.
*
* @param array &$eid Extension ids to un/publish
* @param array $eid Extension ids to un/publish
* @param int $value Publish value
*
* @return boolean True on success
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ protected function getGroups()
// Build the options array.
foreach ($menu->links as $link)
{
$levelPrefix = str_repeat('- ', $link->level - 1);
$levelPrefix = str_repeat('- ', max(0, $link->level - 1));

// Displays language code if not set to All
if ($link->language !== '*')
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_menus/Helper/MenusHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ public static function installPreset($preset, $menutype)
/**
* Method to install a preset menu item into database and link it to the given menutype
*
* @param \stdClass[] &$items The single menuitem instance with a list of its descendants
* @param \stdClass[] $items The single menuitem instance with a list of its descendants
* @param string $menutype The target menutype
* @param int $parent The parent id or object
*
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_menus/Model/ItemModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -1612,7 +1612,7 @@ public function saveorder($idArray = null, $lft_array = null)
/**
* Method to change the home state of one or more items.
*
* @param array &$pks A list of the primary keys to change.
* @param array $pks A list of the primary keys to change.
* @param integer $value The value of the home state.
*
* @return boolean True on success.
Expand Down Expand Up @@ -1699,7 +1699,7 @@ public function setHome(&$pks, $value = 1)
/**
* Method to change the published state of one or more records.
*
* @param array &$pks A list of the primary keys to change.
* @param array $pks A list of the primary keys to change.
* @param integer $value The value of the published state.
*
* @return boolean True on success.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ protected function addToolbar()
/**
* Method to add system link types to the link types array
*
* @param array &$types The list of link types
* @param array $types The list of link types
*
* @return void
*
Expand Down
4 changes: 2 additions & 2 deletions administrator/language/en-GB/en-GB.com_menus.ini
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ COM_MENUS_ITEM_FIELD_HIDE_UNPUBLISHED_LABEL="Unpublished Modules"
COM_MENUS_ITEM_FIELD_HOME_LABEL="Default Page"
COM_MENUS_ITEM_FIELD_LINK_LABEL="Link"
COM_MENUS_ITEM_FIELD_MENU_IMAGE_LABEL="Link Image"
COM_MENUS_ITEM_FIELD_MENU_IMAGE_CSS_DESC="An optional, custom style to apply to the image element."
COM_MENUS_ITEM_FIELD_MENU_IMAGE_CSS_LABEL="Image CSS Style"
COM_MENUS_ITEM_FIELD_MENU_IMAGE_CSS_DESC="An optional class to apply to the image."
COM_MENUS_ITEM_FIELD_MENU_IMAGE_CSS_LABEL="Image Class"
COM_MENUS_ITEM_FIELD_MENU_SHOW_DESC="Select 'No' if you want to hide this menu item. Note any submenu items will also be hidden."
COM_MENUS_ITEM_FIELD_MENU_SHOW_LABEL="Display in Menu"
COM_MENUS_ITEM_FIELD_MENU_TEXT_LABEL="Add Menu Title"
Expand Down
2 changes: 1 addition & 1 deletion administrator/language/en-GB/en-GB.mod_sampledata.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

MOD_SAMPLEDATA="Sample Data"
MOD_SAMPLEDATA_CONFIRM_START="Proceeding will install a sample data set into your Joomla website. This process can't be reverted once done."
MOD_SAMPLEDATA_INVALID_RESPONSE="There is an error in the sample data plugins. Response is invalid."
MOD_SAMPLEDATA_INVALID_RESPONSE="There is an error in a sample data plugin. Response is invalid."
MOD_SAMPLEDATA_ITEM_ALREADY_PROCESSED="This sample data set is already installed."
MOD_SAMPLEDATA_NOTAVAILABLE="Sample data can't be installed or no sample data available."
MOD_SAMPLEDATA_XML_DESCRIPTION="This Module allows to install sample data."
14 changes: 7 additions & 7 deletions administrator/modules/mod_feed/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,20 +92,20 @@
if (!$feed->offsetExists($i)) :
break;
endif;
$uri = (!empty($feed[$i]->uri) || !is_null($feed[$i]->uri)) ? $feed[$i]->uri : $feed[$i]->guid;
$uri = substr($uri, 0, 4) != 'http' ? $params->get('rsslink') : $uri;
$text = !empty($feed[$i]->content) || !is_null($feed[$i]->content) ? $feed[$i]->content : $feed[$i]->description;
$uri = $feed[$i]->uri || !$feed[$i]->isPermaLink ? trim($feed[$i]->uri) : trim($feed[$i]->guid);
$uri = !$uri || stripos($uri, 'http') !== 0 ? $params->get('rsslink') : $uri;
$text = $feed[$i]->content !== '' ? trim($feed[$i]->content) : '';
?>
<li class="list-group-item mb-2">
<?php if (!empty($uri)) : ?>
<h5 class="feed-link">
<a href="<?php echo $uri; ?>" target="_blank">
<?php echo $feed[$i]->title; ?></a></h5>
<?php echo trim($feed[$i]->title); ?></a></h5>
<?php else : ?>
<h5 class="feed-link"><?php echo $feed[$i]->title; ?></h5>
<?php endif; ?>
<h5 class="feed-link"><?php echo trim($feed[$i]->title); ?></h5>
<?php endif; ?>

<?php if ($params->get('rssitemdesc') && !empty($text)) : ?>
<?php if ($params->get('rssitemdesc') && $text !== '') : ?>
<div class="feed-item-description">
<?php
// Strip the images.
Expand Down
7 changes: 7 additions & 0 deletions build/phpcs/Joomla/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,13 @@
<exclude-pattern type="relative">templates/*</exclude-pattern>
<exclude-pattern type="relative">layouts/*</exclude-pattern>
<exclude-pattern type="relative">tests/*</exclude-pattern>
</rule>

<rule ref="Joomla.Commenting.FunctionComment.MissingParamTag">
<exclude-pattern type="relative">administrator/components/*</exclude-pattern>
</rule>

<rule ref="Joomla.Commenting.FunctionComment.ParamNameNoMatch">
<exclude-pattern type="relative">administrator/components/*</exclude-pattern>
</rule>

Expand Down
9 changes: 7 additions & 2 deletions components/com_banners/Model/BannerModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ class BannerModel extends BaseDatabaseModel
*/
public function click()
{
$item = $this->getItem();

if (empty($item))
{
throw new Exception(JText::_('JERROR_PAGE_NOT_FOUND'), 404);
}

$id = $this->getState('banner.id');

// Update click count
Expand All @@ -60,8 +67,6 @@ public function click()
throw new \Exception($e->getMessage(), 500);
}

$item = $this->getItem();

// Track clicks
$trackClicks = $item->track_clicks;

Expand Down
13 changes: 6 additions & 7 deletions components/com_newsfeeds/tmpl/newsfeed/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,22 +104,21 @@
<?php if (empty($this->rssDoc[$i])) : ?>
<?php break; ?>
<?php endif; ?>
<?php $uri = !empty($this->rssDoc[$i]->guid) || $this->rssDoc[$i]->guid !== null ? trim($this->rssDoc[$i]->guid) : trim($this->rssDoc[$i]->uri); ?>
<?php $uri = strpos($uri, 'http') !== 0 ? $this->item->link : $uri; ?>
<?php $text = !empty($this->rssDoc[$i]->content) || $this->rssDoc[$i]->content !== null ? trim($this->rssDoc[$i]->content) : trim($this->rssDoc[$i]->description); ?>
<?php $title = trim($this->rssDoc[$i]->title); ?>
<?php $uri = $this->rssDoc[$i]->uri || !$this->rssDoc[$i]->isPermaLink ? trim($this->rssDoc[$i]->uri) : trim($this->rssDoc[$i]->guid); ?>
<?php $uri = !$uri || stripos($uri, 'http') !== 0 ? $this->item->link : $uri; ?>
<?php $text = $this->rssDoc[$i]->content !== '' ? trim($this->rssDoc[$i]->content) : ''; ?>
<li>
<?php if (!empty($uri)) : ?>
<h3 class="feed-link">
<a href="<?php echo htmlspecialchars($uri); ?>" target="_blank">
<?php echo $title; ?>
<?php echo trim($this->rssDoc[$i]->title); ?>
</a>
</h3>
<?php else : ?>
<h3 class="feed-link"><?php echo $title; ?></h3>
<h3 class="feed-link"><?php echo trim($this->rssDoc[$i]->title); ?></h3>
<?php endif; ?>

<?php if ($this->params->get('show_item_description') && !empty($text)) : ?>
<?php if ($this->params->get('show_item_description') && $text !== '') : ?>
<div class="feed-item-description">
<?php if ($this->params->get('show_feed_image', 0) == 0) : ?>
<?php $text = OutputFilter::stripImages($text); ?>
Expand Down
1 change: 1 addition & 0 deletions libraries/src/Feed/Parser/RssParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ protected function processFeedEntry(FeedEntry $entry, \SimpleXMLElement $el)
$entry->updatedDate = (string) $el->pubDate;
$entry->content = (string) $el->description;
$entry->guid = (string) $el->guid;
$entry->isPermaLink = $entry->guid === '' || (string) $el->guid['isPermaLink'] === 'false' ? false : true;
$entry->comments = (string) $el->comments;

// Add the feed entry author if available.
Expand Down
14 changes: 1 addition & 13 deletions libraries/src/Table/Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,7 @@ public function __construct(DatabaseDriver $db)
*/
public function loadByName($name)
{
$query = $this->_db->getQuery(true)
->select($this->_db->quoteName('id'))
->from($this->_db->quoteName('#__assets'))
->where($this->_db->quoteName('name') . ' = ' . $this->_db->quote($name));
$this->_db->setQuery($query);
$assetId = (int) $this->_db->loadResult();

if (empty($assetId))
{
return false;
}

return $this->load($assetId);
return $this->load(array('name' => $name));
}

/**
Expand Down

0 comments on commit 7794e96

Please sign in to comment.