Skip to content

Commit

Permalink
Merge branch '5.1-dev' of https://github.com/joomla/joomla-cms into m…
Browse files Browse the repository at this point in the history
…od_title
  • Loading branch information
joomlaweby committed Feb 11, 2024
2 parents 6a7c247 + 6c636c9 commit 5d01f7a
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 11 deletions.
3 changes: 3 additions & 0 deletions administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -2204,6 +2204,9 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
'/administrator/components/com_newsfeeds/tmpl/newsfeeds/default_batch_footer.php',
'/administrator/components/com_tags/tmpl/tags/default_batch_footer.php',
'/administrator/components/com_users/tmpl/users/default_batch_footer.php',
// From 5.1.0-alpha3 to 5.1.0-alpha4
'/administrator/components/com_redirect/tmpl/links/default_batch_footer.php',
'/modules/mod_banners/mod_banners.php',
];

$folders = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ public static function branchSingular($branchName)
{
$return = preg_replace('/[^a-zA-Z0-9]+/', '_', strtoupper($branchName));
$language = Factory::getApplication()->getLanguage();
$debug = Factory::getApplication()->get('debug_lang');

if ($language->hasKey('PLG_FINDER_QUERY_FILTER_BRANCH_S_' . $return) || JDEBUG) {
if ($language->hasKey('PLG_FINDER_QUERY_FILTER_BRANCH_S_' . $return) || $debug) {
return 'PLG_FINDER_QUERY_FILTER_BRANCH_S_' . $return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class DisplayController extends BaseController
public function display($cachable = false, $urlparams = false)
{
// Verify menu
$menuType = $this->input->post->getCmd('menutype', '');
$menuType = $this->input->post->getString('menutype', '');

if ($menuType !== '') {
$uri = Uri::getInstance();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
use Joomla\CMS\Factory;
use Joomla\CMS\Form\Field\ModalSelectField;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\Component\Menus\Administrator\Helper\MenusHelper;
use Joomla\Utilities\ArrayHelper;

Expand Down Expand Up @@ -59,7 +58,7 @@ public function setup(\SimpleXMLElement $element, $value, $group = null)
$recordId = (int) $this->form->getValue('id');
$clientId = (int) $this->element['clientid'] ?: 0;

$url = Route::_('index.php?option=com_menus&view=menutypes&tmpl=component&client_id=' . $clientId . '&recordId=' . $recordId, false);
$url = 'index.php?option=com_menus&view=menutypes&tmpl=component&client_id=' . $clientId . '&recordId=' . $recordId;

$this->urls['select'] = $url;
$this->canDo['clear'] = false;
Expand Down
4 changes: 2 additions & 2 deletions components/com_finder/tmpl/search/default_result.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@
<figure class="<?php echo htmlspecialchars($imageClass, ENT_COMPAT, 'UTF-8'); ?> result__image">
<?php if ($this->params->get('link_image') && $this->result->route) : ?>
<a href="<?php echo Route::_($this->result->route); ?>">
<?php echo HTMLHelper::_('image', $this->result->imageUrl, $this->result->imageAlt, $extraAttr); ?>
<?php echo HTMLHelper::_('image', $this->result->imageUrl, $this->result->imageAlt, $extraAttr, false, -1); ?>
</a>
<?php else : ?>
<?php echo HTMLHelper::_('image', $this->result->imageUrl, $this->result->imageAlt, $extraAttr); ?>
<?php echo HTMLHelper::_('image', $this->result->imageUrl, $this->result->imageAlt, $extraAttr, false, -1); ?>
<?php endif; ?>
</figure>
<?php endif; ?>
Expand Down
11 changes: 6 additions & 5 deletions libraries/src/Table/Nested.php
Original file line number Diff line number Diff line change
Expand Up @@ -872,10 +872,11 @@ public function publish($pks = null, $state = 1, $userId = 0)
{
$k = $this->_tbl_key;

$query = $this->_db->getQuery(true);
$table = $this->_db->quoteName($this->_tbl);
$published = $this->_db->quoteName($this->getColumnAlias('published'));
$key = $this->_db->quoteName($k);
$query = $this->_db->getQuery(true);
$table = $this->_db->quoteName($this->_tbl);
$published = $this->_db->quoteName($this->getColumnAlias('published'));
$checkedOut = $this->_db->quoteName($this->getColumnAlias('checked_out'));
$key = $this->_db->quoteName($k);

// Sanitize input.
$pks = ArrayHelper::toInteger($pks);
Expand Down Expand Up @@ -917,7 +918,7 @@ public function publish($pks = null, $state = 1, $userId = 0)
->select('COUNT(' . $k . ')')
->from($this->_tbl)
->where('lft BETWEEN ' . (int) $node->lft . ' AND ' . (int) $node->rgt)
->where('(checked_out <> 0 AND checked_out <> ' . (int) $userId . ')');
->where('(' . $checkedOut . ' <> 0 AND ' . $checkedOut . ' <> ' . (int) $userId . ')');
$this->_db->setQuery($query);

// Check for checked out children.
Expand Down
5 changes: 5 additions & 0 deletions plugins/content/fields/src/Extension/Fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ public function onContentPrepare($context, &$item, &$params, $page = 0)
if (property_exists($item, 'introtext') && \is_string($item->introtext) && strpos($item->introtext, 'field') !== false) {
$item->introtext = $this->prepare($item->introtext, $context, $item);
}

// Prepare the full text
if (!empty($item->fulltext) && strpos($item->fulltext, 'field') !== false) {
$item->fulltext = $this->prepare($item->fulltext, $context, $item);
}
}

/**
Expand Down
57 changes: 57 additions & 0 deletions tests/System/integration/api/com_menus/SiteMenuItems.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
describe('Test that menu items site API endpoint', () => {
afterEach(() => cy.task('queryDB', "DELETE FROM #__menu WHERE title = 'automated test site menu item' "));

it('can deliver a list of site menu items types', () => {
cy.api_get('/menus/site/items/types')
.then((response) => cy.wrap(response).its('body').its('data.0').its('type')
.should('include', 'menutypes'));
});

it('can deliver a list of site menu items', () => {
cy.db_createMenuItem({ title: 'automated test site menu item' })
.then(() => cy.api_get('/menus/site/items'))
.then((response) => cy.api_responseContains(response, 'title', 'automated test site menu item'));
});

it('can deliver a single site menu item', () => {
cy.db_createMenuItem({ title: 'automated test site menu item' })
.then((id) => cy.api_get(`/menus/site/items/${id}`))
.then((response) => cy.wrap(response).its('body').its('data').its('attributes')
.its('title')
.should('include', 'automated test site menu item'));
});

it('can create a site menu item', () => {
cy.api_post('/menus/site/items', {
title: 'automated test site menu item',
menutype: 'main-menu',
access: '1',
parent_id: '1',
publish_down: '',
publish_up: '',
published: '1',
template_style_id: '0',
toggle_modules_assigned: '1',
toggle_modules_published: '1',
type: 'component',
alias: '',
link: '',
})
.then((response) => cy.wrap(response).its('body').its('data').its('attributes')
.its('title')
.should('include', 'automated test site menu item'));
});

it('can update a site menu item', () => {
cy.db_createMenuItem({ title: 'automated test site menu item', type: 'component' })
.then((id) => cy.api_patch(`/menus/site/items/${id}`, { title: 'updated automated test site menu item', type: 'component' }))
.then((response) => cy.wrap(response).its('body').its('data').its('attributes')
.its('title')
.should('include', 'updated automated test site menu item'));
});

it('can delete a site menu item', () => {
cy.db_createMenuItem({ title: 'automated test site menu item', published: -2 })
.then((id) => cy.api_delete(`/menus/site/items/${id}`));
});
});

0 comments on commit 5d01f7a

Please sign in to comment.