Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '4.2-dev' into 4.2-finder-optimise
Browse files Browse the repository at this point in the history
Hackwar authored May 22, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 2c39ac7 + 9ee1dd3 commit 49576c6
Showing 171 changed files with 2,646 additions and 511 deletions.
4 changes: 2 additions & 2 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ steps:
- echo $(date)

- name: npm
image: node:14-alpine
image: node:16-alpine
depends_on: [ phpcs ]
commands:
- npm ci --unsafe-perm
@@ -420,6 +420,6 @@ steps:

---
kind: signature
hmac: adfaa112f82d0487b292e9b22400b04abfbf56eb44516bc764abc1804a6f472b
hmac: 24b9cf86c8dcb5efc6b7c0dfc7bd774410f81907d228eb63931224449953d9fe

...
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ Build Status
---------------------
| Drone-CI | AppVeyor | PHP | Node | npm |
| ------------- | ------------- | ------------- | ------------- | ------------- |
| [![Build Status](https://ci.joomla.org/api/badges/joomla/joomla-cms/status.svg?branch=4.1-dev)](https://ci.joomla.org/joomla/joomla-cms) | [![Build status](https://ci.appveyor.com/api/projects/status/ru6sxal8jmfckvjc/branch/4.1-dev?svg=true)](https://ci.appveyor.com/project/release-joomla/joomla-cms) | [![PHP](https://img.shields.io/badge/PHP-V7.2.5-green)](https://www.php.net/) | [![node-lts](https://img.shields.io/badge/Node-V12.0-green)](https://nodejs.org/en/) | [![npm](https://img.shields.io/badge/npm-v6.13.4-green)](https://nodejs.org/en/) |
| [![Build Status](https://ci.joomla.org/api/badges/joomla/joomla-cms/status.svg?branch=4.1-dev)](https://ci.joomla.org/joomla/joomla-cms) | [![Build status](https://ci.appveyor.com/api/projects/status/ru6sxal8jmfckvjc/branch/4.1-dev?svg=true)](https://ci.appveyor.com/project/release-joomla/joomla-cms) | [![PHP](https://img.shields.io/badge/PHP-V7.2.5-green)](https://www.php.net/) | [![node-lts](https://img.shields.io/badge/Node-V16.0-green)](https://nodejs.org/en/) | [![npm](https://img.shields.io/badge/npm-v8.6.0-green)](https://nodejs.org/en/) |

Overview
---------------------
93 changes: 89 additions & 4 deletions administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
@@ -6387,6 +6387,73 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
'/administrator/components/com_users/src/Field/PrimaryauthprovidersField.php',
// From 4.1.2 to 4.1.3
'/libraries/vendor/webmozart/assert/.php_cs',
// From 4.1.3 to 4.1.4
'/libraries/vendor/maximebf/debugbar/.bowerrc',
'/libraries/vendor/maximebf/debugbar/bower.json',
'/libraries/vendor/maximebf/debugbar/build/namespaceFontAwesome.php',
'/libraries/vendor/maximebf/debugbar/demo/ajax.php',
'/libraries/vendor/maximebf/debugbar/demo/ajax_exception.php',
'/libraries/vendor/maximebf/debugbar/demo/bootstrap.php',
'/libraries/vendor/maximebf/debugbar/demo/bridge/cachecache/index.php',
'/libraries/vendor/maximebf/debugbar/demo/bridge/doctrine/bootstrap.php',
'/libraries/vendor/maximebf/debugbar/demo/bridge/doctrine/build.sh',
'/libraries/vendor/maximebf/debugbar/demo/bridge/doctrine/cli-config.php',
'/libraries/vendor/maximebf/debugbar/demo/bridge/doctrine/index.php',
'/libraries/vendor/maximebf/debugbar/demo/bridge/doctrine/src/Demo/Product.php',
'/libraries/vendor/maximebf/debugbar/demo/bridge/monolog/index.php',
'/libraries/vendor/maximebf/debugbar/demo/bridge/propel/build.properties',
'/libraries/vendor/maximebf/debugbar/demo/bridge/propel/build.sh',
'/libraries/vendor/maximebf/debugbar/demo/bridge/propel/index.php',
'/libraries/vendor/maximebf/debugbar/demo/bridge/propel/runtime-conf.xml',
'/libraries/vendor/maximebf/debugbar/demo/bridge/propel/schema.xml',
'/libraries/vendor/maximebf/debugbar/demo/bridge/slim/index.php',
'/libraries/vendor/maximebf/debugbar/demo/bridge/swiftmailer/index.php',
'/libraries/vendor/maximebf/debugbar/demo/bridge/twig/foobar.html',
'/libraries/vendor/maximebf/debugbar/demo/bridge/twig/hello.html',
'/libraries/vendor/maximebf/debugbar/demo/bridge/twig/index.php',
'/libraries/vendor/maximebf/debugbar/demo/dump_assets.php',
'/libraries/vendor/maximebf/debugbar/demo/index.php',
'/libraries/vendor/maximebf/debugbar/demo/open.php',
'/libraries/vendor/maximebf/debugbar/demo/pdo.php',
'/libraries/vendor/maximebf/debugbar/demo/stack.php',
'/libraries/vendor/maximebf/debugbar/docs/ajax_and_stack.md',
'/libraries/vendor/maximebf/debugbar/docs/base_collectors.md',
'/libraries/vendor/maximebf/debugbar/docs/bridge_collectors.md',
'/libraries/vendor/maximebf/debugbar/docs/data_collectors.md',
'/libraries/vendor/maximebf/debugbar/docs/data_formatter.md',
'/libraries/vendor/maximebf/debugbar/docs/http_drivers.md',
'/libraries/vendor/maximebf/debugbar/docs/javascript_bar.md',
'/libraries/vendor/maximebf/debugbar/docs/manifest.json',
'/libraries/vendor/maximebf/debugbar/docs/openhandler.md',
'/libraries/vendor/maximebf/debugbar/docs/rendering.md',
'/libraries/vendor/maximebf/debugbar/docs/screenshot.png',
'/libraries/vendor/maximebf/debugbar/docs/storage.md',
'/libraries/vendor/maximebf/debugbar/docs/style.css',
'/libraries/vendor/maximebf/debugbar/tests/DebugBar/Tests/DataCollector/AggregatedCollectorTest.php',
'/libraries/vendor/maximebf/debugbar/tests/DebugBar/Tests/DataCollector/ConfigCollectorTest.php',
'/libraries/vendor/maximebf/debugbar/tests/DebugBar/Tests/DataCollector/MessagesCollectorTest.php',
'/libraries/vendor/maximebf/debugbar/tests/DebugBar/Tests/DataCollector/MockCollector.php',
'/libraries/vendor/maximebf/debugbar/tests/DebugBar/Tests/DataCollector/Propel2CollectorTest.php',
'/libraries/vendor/maximebf/debugbar/tests/DebugBar/Tests/DataCollector/TimeDataCollectorTest.php',
'/libraries/vendor/maximebf/debugbar/tests/DebugBar/Tests/DataFormatter/DataFormatterTest.php',
'/libraries/vendor/maximebf/debugbar/tests/DebugBar/Tests/DataFormatter/DebugBarVarDumperTest.php',
'/libraries/vendor/maximebf/debugbar/tests/DebugBar/Tests/DebugBarTest.php',
'/libraries/vendor/maximebf/debugbar/tests/DebugBar/Tests/DebugBarTestCase.php',
'/libraries/vendor/maximebf/debugbar/tests/DebugBar/Tests/JavascriptRendererTest.php',
'/libraries/vendor/maximebf/debugbar/tests/DebugBar/Tests/MockHttpDriver.php',
'/libraries/vendor/maximebf/debugbar/tests/DebugBar/Tests/OpenHandlerTest.php',
'/libraries/vendor/maximebf/debugbar/tests/DebugBar/Tests/Storage/FileStorageTest.php',
'/libraries/vendor/maximebf/debugbar/tests/DebugBar/Tests/Storage/MockStorage.php',
'/libraries/vendor/maximebf/debugbar/tests/DebugBar/Tests/TracedStatementTest.php',
'/libraries/vendor/maximebf/debugbar/tests/DebugBar/Tests/full_init.html',
'/libraries/vendor/maximebf/debugbar/tests/bootstrap.php',
// From 4.1 to 4.2.0
'/libraries/src/Service/Provider/ApiRouter.php',
'/libraries/vendor/nyholm/psr7/doc/final.md',
'/modules/mod_articles_news/mod_articles_news.php',
'/plugins/api-authentication/basic/basic.php',
'/plugins/api-authentication/token/token.php',
'/plugins/system/cache/cache.php',
);

$folders = array(
@@ -7720,10 +7787,28 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
'/libraries/vendor/tobscure/json-api/.git/hooks',
'/libraries/vendor/tobscure/json-api/.git/branches',
'/libraries/vendor/tobscure/json-api/.git',
// From 4.1.1 to 4.1.2
'/administrator/components/com_users/src/Field/PrimaryauthprovidersField.php',
// From 4.1.1 to 4.2.0
'/libraries/src/Service/Provider/ApiRouter.php'
// From 4.1.3 to 4.1.4
'/libraries/vendor/maximebf/debugbar/tests/DebugBar/Tests/Storage',
'/libraries/vendor/maximebf/debugbar/tests/DebugBar/Tests/DataFormatter',
'/libraries/vendor/maximebf/debugbar/tests/DebugBar/Tests/DataCollector',
'/libraries/vendor/maximebf/debugbar/tests/DebugBar/Tests',
'/libraries/vendor/maximebf/debugbar/tests/DebugBar',
'/libraries/vendor/maximebf/debugbar/tests',
'/libraries/vendor/maximebf/debugbar/docs',
'/libraries/vendor/maximebf/debugbar/demo/bridge/twig',
'/libraries/vendor/maximebf/debugbar/demo/bridge/swiftmailer',
'/libraries/vendor/maximebf/debugbar/demo/bridge/slim',
'/libraries/vendor/maximebf/debugbar/demo/bridge/propel',
'/libraries/vendor/maximebf/debugbar/demo/bridge/monolog',
'/libraries/vendor/maximebf/debugbar/demo/bridge/doctrine/src/Demo',
'/libraries/vendor/maximebf/debugbar/demo/bridge/doctrine/src',
'/libraries/vendor/maximebf/debugbar/demo/bridge/doctrine',
'/libraries/vendor/maximebf/debugbar/demo/bridge/cachecache',
'/libraries/vendor/maximebf/debugbar/demo/bridge',
'/libraries/vendor/maximebf/debugbar/demo',
'/libraries/vendor/maximebf/debugbar/build',
// From 4.1 to 4.2.0
'/libraries/vendor/nyholm/psr7/doc',
);

$status['files_checked'] = $files;
3 changes: 3 additions & 0 deletions administrator/components/com_config/forms/application.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<form>
<config>
<inlinehelp button="show"/>
</config>
<fieldset
name="cache"
label="COM_CONFIG_CACHE_SETTINGS_LABEL">
Original file line number Diff line number Diff line change
@@ -228,6 +228,9 @@
echo (new TransitionButton($options))
->render(0, $i);
?>
<div class="small">
<?php echo Text::_($item->stage_title); ?>
</div>
</td>
<?php endif; ?>
<td class="text-center d-none d-md-table-cell">
Original file line number Diff line number Diff line change
@@ -232,6 +232,9 @@
echo (new TransitionButton($options))
->render(0, $i);
?>
<div class="small">
<?php echo Text::_($item->stage_title); ?>
</div>
</td>
<?php endif; ?>
<td class="text-center d-none d-md-table-cell">
14 changes: 14 additions & 0 deletions administrator/components/com_fields/forms/field.xml
Original file line number Diff line number Diff line change
@@ -328,6 +328,20 @@
<option value="0">JNO</option>
</field>
</fieldset>
<fieldset name="smartsearchoptions" label="COM_FIELDS_FIELD_SMARTSEARCHOPTIONS_HEADING">
<field
name="searchindex"
type="list"
label="COM_FIELDS_FIELD_SEARCHINDEX_LABEL"
default="0"
validate="options"
>
<option value="0">COM_FIELDS_FIELD_SEARCHINDEX_DONT</option>
<option value="1">COM_FIELDS_FIELD_SEARCHINDEX_SEARCHABLE</option>
<option value="2">COM_FIELDS_FIELD_SEARCHINDEX_TAXONOMY</option>
<option value="3">COM_FIELDS_FIELD_SEARCHINDEX_BOTH</option>
</field>
</fieldset>
</fieldset>
</fields>
</form>
1 change: 1 addition & 0 deletions administrator/components/com_fields/tmpl/field/edit.php
Original file line number Diff line number Diff line change
@@ -77,6 +77,7 @@
<legend><?php echo Text::_('JGLOBAL_FIELDSET_PUBLISHING'); ?></legend>
<div>
<?php echo LayoutHelper::render('joomla.edit.publishingdata', $this); ?>
<?php echo $this->form->renderField('searchindexing'); ?>
</div>
</fieldset>
<?php echo HTMLHelper::_('uitab.endTab'); ?>
38 changes: 38 additions & 0 deletions administrator/components/com_finder/src/Indexer/Helper.php
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@
use Joomla\CMS\Language\Multilanguage;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Table\Table;
use Joomla\Component\Fields\Administrator\Helper\FieldsHelper;
use Joomla\Registry\Registry;
use Joomla\String\StringHelper;

@@ -432,6 +433,43 @@ public static function getContentExtras(Result $item)
return true;
}

/**
* Add custom fields for the item to the Result object
*
* @param Result $item Result object to add the custom fields to
* @param string $context Context of the item in the custom fields
*
* @return void
*
* @since __DEPLOY_VERSION__
*/
public static function addCustomFields(Result $item, $context)
{
$obj = new \stdClass;
$obj->id = $item->id;

$fields = FieldsHelper::getFields($context, $obj, true);

foreach ($fields as $field)
{
$searchindex = $field->params->get('searchindex', 0);

// We want to add this field to the search index
if ($searchindex == 1 || $searchindex == 3)
{
$name = 'jsfield_' . $field->name;
$item->$name = $field->value;
$item->addInstruction(Indexer::META_CONTEXT, $name);
}

// We want to add this field as a taxonomy
if (($searchindex == 2 || $searchindex == 3) && $field->value)
{
$item->addTaxonomy($field->title, $field->value, $field->state, $field->access, $field->language);
}
}
}

/**
* Method to process content text using the onContentPrepare event trigger.
*
Original file line number Diff line number Diff line change
@@ -91,6 +91,12 @@ public function refresh()
// Parse all found ini files and add the strings to the database cache.
foreach ($files as $file)
{
// Only process if language file is for selected language
if (strpos($file, $language, strlen($base)) === false)
{
continue;
}

$strings = LanguageHelper::parseIniFile($file);

if ($strings)
9 changes: 9 additions & 0 deletions administrator/components/com_menus/presets/alternate.xml
Original file line number Diff line number Diff line change
@@ -348,6 +348,7 @@
class="class:component"
permission="core.manage;com_joomlaupdate"
/>

<menuitem
title="COM_POSTINSTALL"
type="component"
@@ -363,6 +364,14 @@
link="index.php?option=com_redirect&amp;view=links"
permission="core.manage;com_redirect"
/>

<menuitem
title="MOD_MENU_MANAGE_SCHEDULED_TASKS"
type="component"
element="com_scheduler"
link="index.php?option=com_scheduler&amp;view=tasks"
permission="core.manage;com_scheduler"
/>
</menuitem>

<menuitem
25 changes: 18 additions & 7 deletions administrator/components/com_menus/src/Model/ItemModel.php
Original file line number Diff line number Diff line change
@@ -1433,8 +1433,8 @@ public function rebuild()
*/
public function save($data)
{
$pk = isset($data['id']) ? $data['id'] : (int) $this->getState('item.id');
$isNew = true;
$pk = isset($data['id']) ? $data['id'] : (int) $this->getState('item.id');
$isNew = true;
$db = $this->getDbo();
$query = $db->getQuery(true);
$table = $this->getTable();
@@ -1512,13 +1512,24 @@ public function save($data)
return false;
}

// Alter the title & alias for save as copy. Also, unset the home record.
if (!$isNew && $data['id'] == 0)
// Alter the title & alias for save2copy when required. Also, unset the home record.
if (Factory::getApplication()->input->get('task') === 'save2copy' && $data['id'] === 0)
{
list($title, $alias) = $this->generateNewTitle($table->parent_id, $table->alias, $table->title);
$origTable = $this->getTable();
$origTable->load($this->getState('item.id'));

if ($table->title === $origTable->title)
{
list($title, $alias) = $this->generateNewTitle($table->parent_id, $table->alias, $table->title);
$table->title = $title;
$table->alias = $alias;
}

if ($table->alias === $origTable->alias)
{
$table->alias = '';
}

$table->title = $title;
$table->alias = $alias;
$table->published = 0;
$table->home = 0;
}
21 changes: 14 additions & 7 deletions administrator/components/com_plugins/src/Model/PluginModel.php
Original file line number Diff line number Diff line change
@@ -161,13 +161,20 @@ public function getItem($pk = null)
{
$pk = (!empty($pk)) ? $pk : (int) $this->getState('plugin.id');

if (!isset($this->_cache[$pk]))
$cacheId = $pk;

if (\is_array($cacheId))
{
$cacheId = serialize($cacheId);
}

if (!isset($this->_cache[$cacheId]))
{
// Get a row instance.
$table = $this->getTable();

// Attempt to load the row.
$return = $table->load(array('extension_id' => $pk, 'type' => 'plugin'));
$return = $table->load(\is_array($pk) ? $pk : ['extension_id' => $pk, 'type' => 'plugin']);

// Check for a table object error.
if ($return === false)
@@ -177,26 +184,26 @@ public function getItem($pk = null)

// Convert to the \Joomla\CMS\Object\CMSObject before adding other data.
$properties = $table->getProperties(1);
$this->_cache[$pk] = ArrayHelper::toObject($properties, CMSObject::class);
$this->_cache[$cacheId] = ArrayHelper::toObject($properties, CMSObject::class);

// Convert the params field to an array.
$registry = new Registry($table->params);
$this->_cache[$pk]->params = $registry->toArray();
$this->_cache[$cacheId]->params = $registry->toArray();

// Get the plugin XML.
$path = Path::clean(JPATH_PLUGINS . '/' . $table->folder . '/' . $table->element . '/' . $table->element . '.xml');

if (file_exists($path))
{
$this->_cache[$pk]->xml = simplexml_load_file($path);
$this->_cache[$cacheId]->xml = simplexml_load_file($path);
}
else
{
$this->_cache[$pk]->xml = null;
$this->_cache[$cacheId]->xml = null;
}
}

return $this->_cache[$pk];
return $this->_cache[$cacheId];
}

/**
Original file line number Diff line number Diff line change
@@ -45,7 +45,7 @@
type="list"
label="JGLOBAL_SORT_BY"
onchange="this.form.submit();"
default="a.title DESC"
default="a.title ASC"
validate="options"
>
<option value="">JGLOBAL_SORT_BY</option>
Loading

0 comments on commit 49576c6

Please sign in to comment.