Skip to content

Commit

Permalink
Merge branch '4.4-dev' into providers/plugins/system
Browse files Browse the repository at this point in the history
  • Loading branch information
laoneo committed Apr 13, 2023
2 parents 3294aaa + f6c73ec commit 147da9d
Show file tree
Hide file tree
Showing 12 changed files with 180 additions and 28 deletions.
2 changes: 1 addition & 1 deletion administrator/components/com_finder/src/Indexer/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ public static function getContentExtras(Result $item)
*
* @param string $text The content to process.
* @param Registry $params The parameters object. [optional]
* @param Result $item The item which get prepared. [optional]
* @param ?Result $item The item which get prepared. [optional]
*
* @return string The processed content.
*
Expand Down
18 changes: 9 additions & 9 deletions administrator/components/com_finder/src/Indexer/Indexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class Indexer
/**
* Indexer constructor.
*
* @param DatabaseInterface $db The database
* @param ?DatabaseInterface $db The database
*
* @since 3.8.0
*/
Expand Down Expand Up @@ -147,7 +147,7 @@ public function __construct(DatabaseInterface $db = null)
/**
* Method to get the indexer state.
*
* @return object The indexer state object.
* @return CMSObject The indexer state object.
*
* @since 2.5
*/
Expand Down Expand Up @@ -776,7 +776,7 @@ public function optimize()
/**
* Method to get a content item's signature.
*
* @param object $item The content item to index.
* @param Result $item The content item to index.
*
* @return string The content item's signature.
*
Expand All @@ -800,12 +800,12 @@ protected static function getSignature($item)
/**
* Method to parse input, tokenize it, and then add it to the database.
*
* @param mixed $input String or resource to use as input. A resource input will automatically be chunked to conserve
* memory. Strings will be chunked if longer than 2K in size.
* @param integer $context The context of the input. See context constants.
* @param string $lang The language of the input.
* @param string $format The format of the input.
* @param integer $count Number of words indexed so far.
* @param string|resource $input String or resource to use as input. A resource input will automatically be chunked to conserve
* memory. Strings will be chunked if longer than 2K in size.
* @param integer $context The context of the input. See context constants.
* @param string $lang The language of the input.
* @param string $format The format of the input.
* @param integer $count Number of terms indexed so far.
*
* @return integer The number of tokens extracted from the input.
*
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_finder/src/Indexer/Taxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ public static function removeOrphanNodes()
*
* @param integer $id Id of the taxonomy
*
* @return object|array A taxonomy object or an array of all taxonomies
* @return object|object[] A taxonomy object or an array of all taxonomies
*
* @since 4.0.0
*/
Expand Down Expand Up @@ -474,7 +474,7 @@ public static function getTaxonomy($id = 0)
*
* @param string $title Title of the branch
*
* @return object|array The object with the branch data or an array of all branches
* @return object|object[] The object with the branch data or an array of all branches
*
* @since 4.0.0
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ protected function loadFormData()
/**
* Method to get the total indexed items
*
* @return number the number of indexed items
* @return integer The count of indexed items
*
* @since 3.5
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class FiltersModel extends ListModel
/**
* Constructor.
*
* @param array $config An optional associative array of configuration settings.
* @param MVCFactoryInterface $factory The factory.
* @param array $config An optional associative array of configuration settings.
* @param ?MVCFactoryInterface $factory The factory.
*
* @see \Joomla\CMS\MVC\Model\BaseDatabaseModel
* @since 3.7
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_finder/src/Model/IndexModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ class IndexModel extends ListModel
/**
* Constructor.
*
* @param array $config An optional associative array of configuration settings.
* @param MVCFactoryInterface $factory The factory.
* @param array $config An optional associative array of configuration settings.
* @param ?MVCFactoryInterface $factory The factory.
*
* @see \Joomla\CMS\MVC\Model\BaseDatabaseModel
* @since 3.7
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_finder/src/Model/MapsModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class MapsModel extends ListModel
/**
* Constructor.
*
* @param array $config An optional associative array of configuration settings.
* @param MVCFactoryInterface $factory The factory.
* @param array $config An optional associative array of configuration settings.
* @param ?MVCFactoryInterface $factory The factory.
*
* @see \Joomla\CMS\MVC\Model\BaseDatabaseModel
* @since 3.7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class SearchesModel extends ListModel
/**
* Constructor.
*
* @param array $config An optional associative array of configuration settings.
* @param MVCFactoryInterface $factory The factory.
* @param array $config An optional associative array of configuration settings.
* @param ?MVCFactoryInterface $factory The factory.
*
* @see \Joomla\CMS\MVC\Model\BaseDatabaseModel
* @since 4.0.0
Expand Down
12 changes: 6 additions & 6 deletions administrator/components/com_finder/src/Service/HTML/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,10 @@ public function slider($options = [])
/**
* Method to generate filters using select box dropdown controls.
*
* @param Query $idxQuery A Query object.
* @param array $options An array of options.
* @param Query $idxQuery A Query object.
* @param Registry $options An array of options.
*
* @return mixed A rendered HTML widget on success, null otherwise.
* @return string|null A rendered HTML widget on success, null otherwise.
*
* @since 2.5
*/
Expand Down Expand Up @@ -400,10 +400,10 @@ public function select($idxQuery, $options)
/**
* Method to generate fields for filtering dates
*
* @param Query $idxQuery A Query object.
* @param array $options An array of options.
* @param Query $idxQuery A Query object.
* @param Registry $options An array of options.
*
* @return mixed A rendered HTML widget on success, null otherwise.
* @return string A rendered HTML widget.
*
* @since 2.5
*/
Expand Down
2 changes: 1 addition & 1 deletion components/com_finder/src/Model/SearchModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ protected function populateState($ordering = null, $direction = null)
$input = $app->getInput();
$params = $app->getParams();
$user = $this->getCurrentUser();
$language = Factory::getLanguage();
$language = $app->getLanguage();

$this->setState('filter.language', Multilanguage::isEnabled());

Expand Down
125 changes: 125 additions & 0 deletions tests/System/data/com_newsfeeds/joomla.org.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- generator="Joomla! - Open Source Content Management" -->
<?xml-stylesheet href="/plugins/system/jce/css/content.css?badb4208be409b1335b815dde676300e" type="text/css"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Joomla! Official News</title>
<description><![CDATA[Joomla! - the dynamic portal engine and content management system]]></description>
<link>https://www.joomla.org/announcements.html</link>
<lastBuildDate>Wed, 12 Apr 2023 19:48:43 +0000</lastBuildDate>
<generator>Joomla! - Open Source Content Management</generator>
<atom:link rel="self" type="application/rss+xml" href="https://www.joomla.org/announcements.feed?type=rss"/>
<language>en-gb</language>
<managingEditor>noreply@joomla.org (Joomla!)</managingEditor>
<item>
<title>Joomla 4.3.0 Release Candidate 3 - test the final package</title>
<link>https://www.joomla.org/announcements/release-news/5883-joomla-4-3-0-release-candidate-3-test-the-final-package.html</link>
<guid isPermaLink="true">https://www.joomla.org/announcements/release-news/5883-joomla-4-3-0-release-candidate-3-test-the-final-package.html</guid>
<description><![CDATA[
<p class="lead">The Joomla Project is pleased to announce the availability of Joomla 4.3.0 Release Candidate 3 for testing.</p>
]]></description>
<author>feed@example.com (Joomla)</author>
<category>Project Release News</category>
<pubDate>Wed, 12 Apr 2023 06:56:30 +0000</pubDate>
</item>
<item>
<title>Joomla 4.3.0 Release Candidate 2 - test the final package</title>
<link>https://www.joomla.org/announcements/release-news/5881-joomla-4-3-0-release-candidate-2-test-the-final-package.html</link>
<guid isPermaLink="true">https://www.joomla.org/announcements/release-news/5881-joomla-4-3-0-release-candidate-2-test-the-final-package.html</guid>
<description><![CDATA[
<p class="lead">The Joomla Project is pleased to announce the availability of Joomla 4.3.0 Release Candidate 2 for testing.</p>
]]></description>
<author>feed@example.com (Joomla)</author>
<category>Project Release News</category>
<pubDate>Sun, 02 Apr 2023 06:56:30 +0000</pubDate>
</item>
<item>
<title>Joomla 4.3.0 Release Candidate 1 - test the final package</title>
<link>https://www.joomla.org/announcements/release-news/5880-joomla-4-3-0-release-candidate-1-test-the-final-package.html</link>
<guid isPermaLink="true">https://www.joomla.org/announcements/release-news/5880-joomla-4-3-0-release-candidate-1-test-the-final-package.html</guid>
<description><![CDATA[
<p class="lead">The Joomla Project is pleased to announce the availability of Joomla 4.3.0 Release Candidate 1 for testing.</p>
]]></description>
<author>feed@example.com (Joomla)</author>
<category>Project Release News</category>
<pubDate>Mon, 20 Mar 2023 06:56:30 +0000</pubDate>
</item>
<item>
<title>Joomla 4.2.9 Bug Fix Release</title>
<link>https://www.joomla.org/announcements/release-news/5879-joomla-4-2-9-bug-fix-release.html</link>
<guid isPermaLink="true">https://www.joomla.org/announcements/release-news/5879-joomla-4-2-9-bug-fix-release.html</guid>
<description><![CDATA[
<p class="lead">Joomla! 4.2.9 is now available. This is a Bug Fix release for the 4.x series of Joomla!</p>
]]></description>
<author>feed@example.com (Joomla)</author>
<category>Project Release News</category>
<pubDate>Tue, 14 Mar 2023 06:56:30 +0000</pubDate>
</item>
<item>
<title>Joomla 4.2.8 Security Release</title>
<link>https://www.joomla.org/announcements/release-news/5878-joomla-4-2-8-security-release.html</link>
<guid isPermaLink="true">https://www.joomla.org/announcements/release-news/5878-joomla-4-2-8-security-release.html</guid>
<description><![CDATA[
<p class="lead">Joomla! 4.2.8 is now available. This is a security release for the 4.x series of Joomla! which addresses a critical security vulnerability in the web services API. We strongly recommend that you update your sites immediately.</p>
]]></description>
<author>feed@example.com (Joomla)</author>
<category>Project Release News</category>
<pubDate>Thu, 16 Feb 2023 07:56:30 +0000</pubDate>
</item>
<item>
<title>Joomla! 4.2.8 - Important Security Announcement - Patch Available Soon</title>
<link>https://www.joomla.org/announcements/release-news/5877-joomla-4-2-8-important-security-announcement-patch-available-soon.html</link>
<guid isPermaLink="true">https://www.joomla.org/announcements/release-news/5877-joomla-4-2-8-important-security-announcement-patch-available-soon.html</guid>
<description><![CDATA[
<p class="lead">A Joomla 4.2.8 release containing a security fix will be published on Thursday, 16th February at approximately 16:00 UTC</p>
]]></description>
<author>feed@example.com (Joomla)</author>
<category>Project Release News</category>
<pubDate>Mon, 13 Feb 2023 17:00:00 +0000</pubDate>
</item>
<item>
<title>Joomla 4.2.7 Security and Bug Fix Release</title>
<link>https://www.joomla.org/announcements/release-news/5876-joomla-4-2-7-security-and-bug-fix-release.html</link>
<guid isPermaLink="true">https://www.joomla.org/announcements/release-news/5876-joomla-4-2-7-security-and-bug-fix-release.html</guid>
<description><![CDATA[
<p class="lead">Joomla 4.2.7 is now available. This is a security and bug fix release for the 4.x series of Joomla.</p>
]]></description>
<author>feed@example.com (Joomla)</author>
<category>Project Release News</category>
<pubDate>Tue, 31 Jan 2023 07:56:30 +0000</pubDate>
</item>
<item>
<title>Joomla 4.2.6 Bug Fix Release </title>
<link>https://www.joomla.org/announcements/release-news/5875-joomla-4-2-6-bug-fix-release.html</link>
<guid isPermaLink="true">https://www.joomla.org/announcements/release-news/5875-joomla-4-2-6-bug-fix-release.html</guid>
<description><![CDATA[
<p class="lead">Joomla 4.2.6 is now available. This is a bug fix release for the 4.x series of Joomla.</p>
]]></description>
<author>feed@example.com (Joomla)</author>
<category>Project Release News</category>
<pubDate>Tue, 13 Dec 2022 07:56:30 +0000</pubDate>
</item>
<item>
<title>Joomla 4.2.5 Security and Bug Fix release</title>
<link>https://www.joomla.org/announcements/release-news/5873-joomla-4-2-5-security-and-bug-fix-release.html</link>
<guid isPermaLink="true">https://www.joomla.org/announcements/release-news/5873-joomla-4-2-5-security-and-bug-fix-release.html</guid>
<description><![CDATA[
<p class="lead">Joomla 4.2.5 is now available. This is a security and bug fix release for the 4.x series of Joomla which addresses 1 security vulnerability.</p>
]]></description>
<author>feed@example.com (The Joomla! Project)</author>
<category>Project Release News</category>
<pubDate>Tue, 08 Nov 2022 06:00:00 +0000</pubDate>
</item>
<item>
<title>Sunset on GLIP as Joomla welcomes Mattermost</title>
<link>https://www.joomla.org/announcements/release-news/5874-sunset-on-glip-as-joomla-welcomes-mattermost.html</link>
<guid isPermaLink="true">https://www.joomla.org/announcements/release-news/5874-sunset-on-glip-as-joomla-welcomes-mattermost.html</guid>
<description><![CDATA[
<p class="lead" style="margin: 10px 0;">We all have a new home for our daily communication.</p>
]]></description>
<author>feed@example.com (Operations Department)</author>
<category>Project Release News</category>
<pubDate>Mon, 07 Nov 2022 06:59:32 +0000</pubDate>
</item>
</channel>
</rss>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
describe('Test that the feed view ', () => {
['joomla.org'].forEach((file) => {
it(`can display a feed in menu item from ${file}`, () => {
cy.db_createNewsFeed({ name: 'automated test feed 1', link: `${Cypress.config('baseUrl')}/tests/System/data/com_newsfeeds/${file}.xml` })
.then((id) => cy.db_createMenuItem({ title: 'automated test feeds', link: `index.php?option=com_newsfeeds&view=newsfeed&id=${id}` }))
.then(() => {
cy.visit('/');
cy.get('a:contains(automated test feed)').click();

cy.contains('automated test feed 1');
cy.get('.com-newsfeeds-newsfeed__items').should('exist');
cy.get('.com-newsfeeds-newsfeed__items').children().should('have.length', 5);
});
});

it('can display a feed without menu item', () => {
cy.db_createNewsFeed({ name: 'automated test feed 1', link: `${Cypress.config('baseUrl')}/tests/System/data/com_newsfeeds/${file}.xml` })
.then((id) => {
cy.visit(`index.php?option=com_newsfeeds&view=newsfeed&id=${id}`);

cy.contains('automated test feed 1');
cy.get('.com-newsfeeds-newsfeed__items').should('exist');
cy.get('.com-newsfeeds-newsfeed__items').children().should('have.length', 5);
});
});
});
});

0 comments on commit 147da9d

Please sign in to comment.