Skip to content

Commit

Permalink
Merge branch '4.0-dev' of github.com:joomla/joomla-cms into 4.0-dev-f…
Browse files Browse the repository at this point in the history
…ix-todo

* '4.0-dev' of github.com:joomla/joomla-cms:
  Fixing com_fields integration in com_contact (#20413)
  [com_contenthistory] - fix for not delete keep forever items (#20430)
  [com_tags] Images in Tagged Items view (#20601)
  Additional Escaping Of Paths In com_media (#20616)
  Respect access of editor plugin inside profile form (#20713)
  Better mode autoloading. (#20746)
  Mouse over edit - rename (#20743)
  Login to view the article redirect fix (#20732)
  Add UTF-8 encoding to phpcs in .drone.yml (#20769)
  Com_finder meta data (#20772)
  [mod_tags_similar] Link cleanup (#20730)
  [com_tags] Tagged item link in feed (#20723)
  Put all build packages in one directory (#20745)
  • Loading branch information
dgrammatiko committed Dec 29, 2018
2 parents 53a40bf + ac94eda commit cc38f14
Show file tree
Hide file tree
Showing 20 changed files with 87 additions and 246 deletions.
2 changes: 1 addition & 1 deletion .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pipeline:
image: joomlaprojects/docker-phpcs
commands:
- echo $(date)
- /root/.composer/vendor/bin/phpcs --report=full --extensions=php -p --encoding=utf-8 --standard=build/phpcs/Joomla .
- /root/.composer/vendor/bin/phpcs --report=full --encoding=utf-8 --extensions=php -p --standard=build/phpcs/Joomla .
- echo $(date)

restore-cache:
Expand Down
1 change: 1 addition & 0 deletions administrator/components/com_admin/forms/profile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
type="plugins"
label="COM_ADMIN_USER_FIELD_EDITOR_LABEL"
folder="editors"
useaccess="true"
>
<option value="">JOPTION_USE_DEFAULT</option>
</field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ public function delete(&$pks)
{
if ($table->load($pk))
{
if ($table->keep_forever === "1")
{
unset($pks[$i]);
continue;
}

if ($this->canEdit($table))
{
if (!$table->delete($pk))
Expand Down
2 changes: 1 addition & 1 deletion administrator/language/en-GB/en-GB.com_config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ COM_CONFIG_FIELD_FILTERS_CUSTOM_BLACK_LIST="Custom Blacklist"
COM_CONFIG_FIELD_FILTERS_NO_HTML="No HTML"
COM_CONFIG_FIELD_FILTERS_NO_FILTER="No Filtering"
COM_CONFIG_FIELD_FILTERS_WHITE_LIST="Whitelist"
COM_CONFIG_FRONTEDITING_LABEL="Mouse-over Edit Icons for"
COM_CONFIG_FRONTEDITING_LABEL="Inline Editing"
COM_CONFIG_FRONTEDITING_MENUSANDMODULES="Modules & Menus"
COM_CONFIG_FRONTEDITING_MODULES="Modules"
COM_CONFIG_FIELD_FORCE_SSL_LABEL="Force HTTPS"
Expand Down
15 changes: 0 additions & 15 deletions build/media_src/system/js/slider-button.es6.js

This file was deleted.

6 changes: 6 additions & 0 deletions components/com_contact/Model/ContactModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ protected function loadFormData()
$data['language'] = Factory::getLanguage()->getTag();
}

// Add contact id to contact form data, so fields plugin can work properly
if (empty($data['catid']))
{
$data['catid'] = $this->getItem()->catid;
}

$this->preprocessData('com_contact.contact', $data);

return $data;
Expand Down
2 changes: 1 addition & 1 deletion components/com_content/View/Article/HtmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public function display($tpl = null)
if ($this->user->get('guest'))
{
$return = base64_encode(Uri::getInstance());
$login_url_with_return = Route::_('index.php?option=com_users&return=' . $return);
$login_url_with_return = Route::_('index.php?option=com_users&view=login&return=' . $return);
$app->enqueueMessage(Text::_('JERROR_ALERTNOAUTHOR'), 'notice');
$app->redirect($login_url_with_return, 403);
}
Expand Down
10 changes: 9 additions & 1 deletion components/com_finder/View/Search/HtmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,16 +312,24 @@ protected function prepareDocument($query)
$explained = $this->escape(html_entity_decode(strip_tags($this->explained), ENT_QUOTES, 'UTF-8'));
$this->document->setDescription($explained);
}
elseif ($this->params->get('menu-meta_description'))
{
$this->document->setDescription($this->params->get('menu-meta_description'));
}

// Configure the document meta-keywords.
if (!empty($query->highlight))
{
$this->document->setMetaData('keywords', implode(', ', $query->highlight));
}
elseif ($this->params->get('menu-meta_keywords'))
{
$this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords'));
}

if ($this->params->get('robots'))
{
$this->document->setMetaData('robots', $this->params->get('robots'));
$this->document->setMetadata('robots', $this->params->get('robots'));
}

// Check for OpenSearch
Expand Down
11 changes: 8 additions & 3 deletions components/com_tags/Model/TagModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,14 @@ public function getItems()
{
foreach ($items as $item)
{
$explodedTypeAlias = explode('.', $item->type_alias);
$item->link = 'index.php?option=' . $explodedTypeAlias[0] . '&view=' . $explodedTypeAlias[1] . '&id='
. $item->content_item_id . ':' . $item->core_alias;
$item->link = TagsHelperRoute::getItemRoute(
$item->content_item_id,
$item->core_alias,
$item->core_catid,
$item->core_language,
$item->type_alias,
$item->router
);

// Get display date
switch ($this->state->params->get('tag_list_show_date'))
Expand Down
6 changes: 1 addition & 5 deletions components/com_tags/View/Tag/FeedView.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ public function display($tpl = null)
$title = $this->escape($item->core_title);
$title = html_entity_decode($title, ENT_COMPAT, 'UTF-8');

// URL link to tagged item
// Change to new routing once it is merged
$link = Route::_($item->link);

// Strip HTML from feed item description text
$description = $item->core_body;
$author = $item->core_created_by_alias ?: $item->author;
Expand All @@ -71,7 +67,7 @@ public function display($tpl = null)
// Load individual item creator class
$feeditem = new FeedItem;
$feeditem->title = $title;
$feeditem->link = $link;
$feeditem->link = Route::_($item->link);
$feeditem->description = $description;
$feeditem->date = $date;
$feeditem->category = $title;
Expand Down
15 changes: 6 additions & 9 deletions components/com_tags/View/Tag/HtmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,13 @@ public function display($tpl = null)
{
$itemElement->core_body = $itemElement->text;
}
}
}

// Categories store the images differently so lets re-map it so the display is correct
if ($items && $items[0]->type_alias === 'com_content.category')
{
foreach ($items as $row)
{
$core_params = json_decode($row->core_params);
$row->core_images = json_encode(array('image_intro' => $core_params->image, 'image_intro_alt' => $core_params->image_alt));
// Categories store the images differently so lets re-map it so the display is correct
if ($itemElement->type_alias === 'com_content.category')
{
$coreParams = json_decode($itemElement->core_params);
$itemElement->core_images = json_encode(array('image_intro' => $coreParams->image, 'image_intro_alt' => $coreParams->image_alt));
}
}
}

Expand Down
25 changes: 10 additions & 15 deletions components/com_tags/tmpl/tag/default_items.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
$canEdit = $user->authorise('core.edit', 'com_tags');
$canCreate = $user->authorise('core.create', 'com_tags');
$canEditState = $user->authorise('core.edit.state', 'com_tags');
$items = $this->items;
$n = count($this->items);
?>
<form action="<?php echo htmlspecialchars(Uri::getInstance()->toString()); ?>" method="post" name="adminForm" id="adminForm" class="com-tags-tag__items">
<?php if ($this->params->get('show_headings') || $this->params->get('filter_field') || $this->params->get('show_pagination_limit')) : ?>
Expand Down Expand Up @@ -66,26 +64,23 @@
</fieldset>
<?php endif; ?>

<?php if ($this->items === false || $n === 0) : ?>
<?php if (empty($this->items)) : ?>
<p><?php echo Text::_('COM_TAGS_NO_ITEMS'); ?></p>
<?php else : ?>
<ul class="com-tags-tag__category category list-group" itemscope itemtype="http://schema.org/ItemList">
<?php foreach ($items as $i => $item) : ?>
<?php foreach ($this->items as $i => $item) : ?>
<?php if ($item->core_state == 0) : ?>
<li class="list-group-item-danger" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
<?php else : ?>
<li class="list-group-item list-group-item-action" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
<?php if (($item->type_alias === 'com_users.category') || ($item->type_alias === 'com_banners.category')) : ?>
<h3 class="mb-0" itemprop="name">
<?php echo $this->escape($item->core_title); ?>
</h3>
<?php else : ?>
<h3 class="mb-0" itemprop="name">
<a href="<?php echo Route::_(TagsHelperRoute::getItemRoute($item->content_item_id, $item->core_alias, $item->core_catid, $item->core_language, $item->type_alias, $item->router)); ?>" itemprop="url">
<?php echo $this->escape($item->core_title); ?>
</a>
</h3>
<?php endif; ?>
<?php endif; ?>
<?php if (($item->type_alias === 'com_users.category') || ($item->type_alias === 'com_banners.category')) : ?>
<h3 itemprop="name">
<?php echo $this->escape($item->core_title); ?>
</h3>
<?php else : ?>
<h3 itemprop="name">
<a href="<?php echo JRoute::_($item->link); ?>" itemprop="url">
<?php endif; ?>
<?php // Content is generated by content plugin event "onContentAfterTitle" ?>
<?php echo $item->event->afterDisplayTitle; ?>
Expand Down
12 changes: 4 additions & 8 deletions components/com_tags/tmpl/tag/list_items.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

HTMLHelper::_('script', 'com_tags/tag-list.js', ['version' => 'auto', 'relative' => true]);

$n = count($this->items);
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
?>
Expand Down Expand Up @@ -57,7 +56,7 @@
</fieldset>
<?php endif; ?>

<?php if ($this->items === false || $n === 0) : ?>
<?php if (empty($this->items)) : ?>
<p><?php echo Text::_('COM_TAGS_NO_ITEMS'); ?></p>
<?php else : ?>
<table class="com-tags-tag-list__category category table table-striped table-bordered table-hover">
Expand All @@ -84,13 +83,13 @@
<?php endif; ?>
<tbody>
<?php foreach ($this->items as $i => $item) : ?>
<?php if ($this->items[$i]->core_state == 0) : ?>
<?php if ($item->core_state == 0) : ?>
<tr class="table-danger">
<?php else : ?>
<tr>
<?php endif; ?>
<td <?php if ($this->params->get('show_headings')) echo "headers=\"categorylist_header_title\""; ?> class="list-title">
<a href="<?php echo Route::_(TagsHelperRoute::getItemRoute($item->content_item_id, $item->core_alias, $item->core_catid, $item->core_language, $item->type_alias, $item->router)); ?>">
<a href="<?php echo Route::_($item->link); ?>">
<?php echo $this->escape($item->core_title); ?>
</a>
<?php if ($item->core_state == 0) : ?>
Expand All @@ -113,10 +112,7 @@
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>

<?php // Add pagination links ?>
<?php if (!empty($this->items)) : ?>
<?php // Add pagination links ?>
<?php if (($this->params->def('show_pagination', 2) == 1 || ($this->params->get('show_pagination') == 2)) && ($this->pagination->pagesTotal > 1)) : ?>
<div class="com-tags-tag-list__pagination w-100">
<?php if ($this->params->def('show_pagination_results', 1)) : ?>
Expand Down
1 change: 1 addition & 0 deletions components/com_users/forms/frontend.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
type="plugins"
label="COM_USERS_USER_FIELD_EDITOR_LABEL"
folder="editors"
useaccess="true"
>
<option value="">JOPTION_USE_DEFAULT</option>
</field>
Expand Down
26 changes: 0 additions & 26 deletions layouts/joomla/toolbar/slider.php

This file was deleted.

1 change: 0 additions & 1 deletion libraries/classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@
JLoader::registerAlias('JToolbarButtonLink', '\\Joomla\\CMS\\Toolbar\\Button\\LinkButton', '5.0');
JLoader::registerAlias('JToolbarButtonPopup', '\\Joomla\\CMS\\Toolbar\\Button\\PopupButton', '5.0');
JLoader::registerAlias('JToolbarButtonSeparator', '\\Joomla\\CMS\\Toolbar\\Button\\SeparatorButton', '5.0');
JLoader::registerAlias('JToolbarButtonSlider', '\\Joomla\\CMS\\Toolbar\\Button\\SliderButton', '5.0');
JLoader::registerAlias('JToolbarButtonStandard', '\\Joomla\\CMS\\Toolbar\\Button\\StandardButton', '5.0');
JLoader::registerAlias('JToolbarHelper', '\\Joomla\\CMS\\Toolbar\\ToolbarHelper', '5.0');
JLoader::registerAlias('JButton', '\\Joomla\\CMS\\Toolbar\\ToolbarButton', '5.0');
Expand Down
6 changes: 6 additions & 0 deletions libraries/src/Form/Field/PluginsField.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ protected function getOptions()
->where('enabled = 1')
->order('ordering, name');

if ((string) $this->element['useaccess'] === 'true')
{
$groups = implode(',', JFactory::getUser()->getAuthorisedViewLevels());
$query->where($db->quoteName('access') . ' IN (' . $groups . ')');
}

$options = $db->setQuery($query)->loadObjectList();
$lang = Factory::getLanguage();
$useGlobal = $this->element['useglobal'];
Expand Down

0 comments on commit cc38f14

Please sign in to comment.