Skip to content

Commit 220240c

Browse files
committed
Merge remote-tracking branch 'Joomla/4.4-dev' into 5.0-dev
2 parents 14b5a58 + 0aba9c8 commit 220240c

File tree

6 files changed

+73
-9
lines changed

6 files changed

+73
-9
lines changed

administrator/components/com_finder/src/Helper/LanguageHelper.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ public static function branchSingular($branchName)
5858
{
5959
$return = preg_replace('/[^a-zA-Z0-9]+/', '_', strtoupper($branchName));
6060
$language = Factory::getApplication()->getLanguage();
61+
$debug = Factory::getApplication()->get('debug_lang');
6162

62-
if ($language->hasKey('PLG_FINDER_QUERY_FILTER_BRANCH_S_' . $return) || JDEBUG) {
63+
if ($language->hasKey('PLG_FINDER_QUERY_FILTER_BRANCH_S_' . $return) || $debug) {
6364
return 'PLG_FINDER_QUERY_FILTER_BRANCH_S_' . $return;
6465
}
6566

administrator/components/com_menus/src/Controller/DisplayController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class DisplayController extends BaseController
4848
public function display($cachable = false, $urlparams = false)
4949
{
5050
// Verify menu
51-
$menuType = $this->input->post->getCmd('menutype', '');
51+
$menuType = $this->input->post->getString('menutype', '');
5252

5353
if ($menuType !== '') {
5454
$uri = Uri::getInstance();

components/com_finder/tmpl/search/default_result.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@
7171
<figure class="<?php echo htmlspecialchars($imageClass, ENT_COMPAT, 'UTF-8'); ?> result__image">
7272
<?php if ($this->params->get('link_image') && $this->result->route) : ?>
7373
<a href="<?php echo Route::_($this->result->route); ?>">
74-
<?php echo HTMLHelper::_('image', $this->result->imageUrl, $this->result->imageAlt, $extraAttr); ?>
74+
<?php echo HTMLHelper::_('image', $this->result->imageUrl, $this->result->imageAlt, $extraAttr, false, -1); ?>
7575
</a>
7676
<?php else : ?>
77-
<?php echo HTMLHelper::_('image', $this->result->imageUrl, $this->result->imageAlt, $extraAttr); ?>
77+
<?php echo HTMLHelper::_('image', $this->result->imageUrl, $this->result->imageAlt, $extraAttr, false, -1); ?>
7878
<?php endif; ?>
7979
</figure>
8080
<?php endif; ?>

libraries/src/Table/Nested.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -872,10 +872,11 @@ public function publish($pks = null, $state = 1, $userId = 0)
872872
{
873873
$k = $this->_tbl_key;
874874

875-
$query = $this->_db->getQuery(true);
876-
$table = $this->_db->quoteName($this->_tbl);
877-
$published = $this->_db->quoteName($this->getColumnAlias('published'));
878-
$key = $this->_db->quoteName($k);
875+
$query = $this->_db->getQuery(true);
876+
$table = $this->_db->quoteName($this->_tbl);
877+
$published = $this->_db->quoteName($this->getColumnAlias('published'));
878+
$checkedOut = $this->_db->quoteName($this->getColumnAlias('checked_out'));
879+
$key = $this->_db->quoteName($k);
879880

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

923924
// Check for checked out children.

plugins/content/fields/src/Extension/Fields.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ public function onContentPrepare($context, &$item, &$params, $page = 0)
6666
if (property_exists($item, 'introtext') && \is_string($item->introtext) && strpos($item->introtext, 'field') !== false) {
6767
$item->introtext = $this->prepare($item->introtext, $context, $item);
6868
}
69+
70+
// Prepare the full text
71+
if (!empty($item->fulltext) && strpos($item->fulltext, 'field') !== false) {
72+
$item->fulltext = $this->prepare($item->fulltext, $context, $item);
73+
}
6974
}
7075

7176
/**
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
describe('Test that menu items site API endpoint', () => {
2+
afterEach(() => cy.task('queryDB', "DELETE FROM #__menu WHERE title = 'automated test site menu item' "));
3+
4+
it('can deliver a list of site menu items types', () => {
5+
cy.api_get('/menus/site/items/types')
6+
.then((response) => cy.wrap(response).its('body').its('data.0').its('type')
7+
.should('include', 'menutypes'));
8+
});
9+
10+
it('can deliver a list of site menu items', () => {
11+
cy.db_createMenuItem({ title: 'automated test site menu item' })
12+
.then(() => cy.api_get('/menus/site/items'))
13+
.then((response) => cy.api_responseContains(response, 'title', 'automated test site menu item'));
14+
});
15+
16+
it('can deliver a single site menu item', () => {
17+
cy.db_createMenuItem({ title: 'automated test site menu item' })
18+
.then((id) => cy.api_get(`/menus/site/items/${id}`))
19+
.then((response) => cy.wrap(response).its('body').its('data').its('attributes')
20+
.its('title')
21+
.should('include', 'automated test site menu item'));
22+
});
23+
24+
it('can create a site menu item', () => {
25+
cy.api_post('/menus/site/items', {
26+
title: 'automated test site menu item',
27+
menutype: 'main-menu',
28+
access: '1',
29+
parent_id: '1',
30+
publish_down: '',
31+
publish_up: '',
32+
published: '1',
33+
template_style_id: '0',
34+
toggle_modules_assigned: '1',
35+
toggle_modules_published: '1',
36+
type: 'component',
37+
alias: '',
38+
link: '',
39+
})
40+
.then((response) => cy.wrap(response).its('body').its('data').its('attributes')
41+
.its('title')
42+
.should('include', 'automated test site menu item'));
43+
});
44+
45+
it('can update a site menu item', () => {
46+
cy.db_createMenuItem({ title: 'automated test site menu item', type: 'component' })
47+
.then((id) => cy.api_patch(`/menus/site/items/${id}`, { title: 'updated automated test site menu item', type: 'component' }))
48+
.then((response) => cy.wrap(response).its('body').its('data').its('attributes')
49+
.its('title')
50+
.should('include', 'updated automated test site menu item'));
51+
});
52+
53+
it('can delete a site menu item', () => {
54+
cy.db_createMenuItem({ title: 'automated test site menu item', published: -2 })
55+
.then((id) => cy.api_delete(`/menus/site/items/${id}`));
56+
});
57+
});

0 commit comments

Comments
 (0)