Skip to content

Commit

Permalink
Merge pull request #14050 from Elgg/4.2
Browse files Browse the repository at this point in the history
upmerge 4.2.2 into 4.x
  • Loading branch information
jeabakker committed Jun 17, 2022
2 parents 3fa7e51 + 3de907e commit 6cc557d
Show file tree
Hide file tree
Showing 51 changed files with 353 additions and 261 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,23 @@
<a name="4.2.2"></a>
### 4.2.2 (2022-06-17)

#### Contributors

* Jeroen Dalsem (8)
* Jerôme Bakker (5)

#### Bug Fixes

* **cache:** make sure the CLI and webserver use the same cache path ([fda6463e](https://github.com/Elgg/Elgg/commit/fda6463ea413b094eced9d7aa5357ed9347a3192))
* **db:** support passing relationship guid when sorting by relationship ([21b9f1e6](https://github.com/Elgg/Elgg/commit/21b9f1e6a9cbc50e585bec98e957fbf069d573f4))
* **groups:** groupprofile rss feed should show recent searchable content ([54353859](https://github.com/Elgg/Elgg/commit/54353859cacfdefe368afe63df23d59acd9c2233))
* **icons:** check filesize when checking if entity has icon ([50989148](https://github.com/Elgg/Elgg/commit/509891486e4dc7dd42992083f413ca42f6831c19))
* **menus:**
* allow detecting selected sorting parent from view var ([822ac99c](https://github.com/Elgg/Elgg/commit/822ac99cab6386459d8ac84960bd2c1ecaf18283))
* sorting parent detection should respect menu item priority ([19fbbcb7](https://github.com/Elgg/Elgg/commit/19fbbcb71dc61726ea09efbc8e0b8e1efdd6b887))
* **search:** improved search result presentation ([8959c933](https://github.com/Elgg/Elgg/commit/8959c933ce0ad3223966977ab2083f225582c337))


<a name="4.2.1"></a>
### 4.2.1 (2022-05-31)

Expand Down
2 changes: 1 addition & 1 deletion composer.json
@@ -1,6 +1,6 @@
{
"name": "elgg/elgg",
"version": "4.2.1",
"version": "4.2.2",
"description": "Elgg is an award-winning social networking engine, delivering the building blocks that enable businesses, schools, universities and associations to create their own fully-featured social networks and applications.",
"license": "GPL-2.0-only",
"minimum-stability": "dev",
Expand Down
323 changes: 161 additions & 162 deletions composer.lock

Large diffs are not rendered by default.

Binary file modified docs/locale/fr/LC_MESSAGES/admin.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/locale/fr/LC_MESSAGES/admin.po
Expand Up @@ -13,7 +13,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Elgg master\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-05-12 13:45+0200\n"
"POT-Creation-Date: 2022-05-31 14:24+0200\n"
"PO-Revision-Date: 2021-06-09 13:31+0000\n"
"Last-Translator: Florian DANIEL aka Facyla <i.daniel.florian@gmail.com>, 2021\n"
"Language-Team: French (https://www.transifex.com/elgg/teams/11337/fr/)\n"
Expand Down
Binary file modified docs/locale/fr/LC_MESSAGES/appendix.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/locale/fr/LC_MESSAGES/appendix.po
Expand Up @@ -13,7 +13,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Elgg master\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-05-12 13:45+0200\n"
"POT-Creation-Date: 2022-05-31 14:24+0200\n"
"PO-Revision-Date: 2021-06-09 13:32+0000\n"
"Last-Translator: Florian DANIEL aka Facyla <i.daniel.florian@gmail.com>, 2022\n"
"Language-Team: French (https://www.transifex.com/elgg/teams/11337/fr/)\n"
Expand Down
Binary file modified docs/locale/fr/LC_MESSAGES/contribute.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/locale/fr/LC_MESSAGES/contribute.po
Expand Up @@ -13,7 +13,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Elgg master\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-05-12 13:45+0200\n"
"POT-Creation-Date: 2022-05-31 14:24+0200\n"
"PO-Revision-Date: 2021-06-09 13:32+0000\n"
"Last-Translator: Florian DANIEL aka Facyla <i.daniel.florian@gmail.com>, 2022\n"
"Language-Team: French (https://www.transifex.com/elgg/teams/11337/fr/)\n"
Expand Down
Binary file modified docs/locale/fr/LC_MESSAGES/design.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/locale/fr/LC_MESSAGES/design.po
Expand Up @@ -12,7 +12,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Elgg master\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-05-12 13:45+0200\n"
"POT-Creation-Date: 2022-05-31 14:24+0200\n"
"PO-Revision-Date: 2021-06-09 13:32+0000\n"
"Last-Translator: Florian DANIEL aka Facyla <i.daniel.florian@gmail.com>, 2022\n"
"Language-Team: French (https://www.transifex.com/elgg/teams/11337/fr/)\n"
Expand Down
Binary file modified docs/locale/fr/LC_MESSAGES/guides.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/locale/fr/LC_MESSAGES/guides.po
Expand Up @@ -14,7 +14,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Elgg master\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-05-12 13:45+0200\n"
"POT-Creation-Date: 2022-05-31 14:24+0200\n"
"PO-Revision-Date: 2021-06-09 13:32+0000\n"
"Last-Translator: Florian DANIEL aka Facyla <i.daniel.florian@gmail.com>, 2022\n"
"Language-Team: French (https://www.transifex.com/elgg/teams/11337/fr/)\n"
Expand Down
Binary file modified docs/locale/fr/LC_MESSAGES/index.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/locale/fr/LC_MESSAGES/index.po
Expand Up @@ -12,7 +12,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Elgg master\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-05-12 13:45+0200\n"
"POT-Creation-Date: 2022-05-31 14:24+0200\n"
"PO-Revision-Date: 2021-06-09 13:31+0000\n"
"Last-Translator: Florian DANIEL aka Facyla <i.daniel.florian@gmail.com>, 2021\n"
"Language-Team: French (https://www.transifex.com/elgg/teams/11337/fr/)\n"
Expand Down
Binary file modified docs/locale/fr/LC_MESSAGES/intro.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/locale/fr/LC_MESSAGES/intro.po
Expand Up @@ -13,7 +13,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Elgg master\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-05-12 13:45+0200\n"
"POT-Creation-Date: 2022-05-31 14:24+0200\n"
"PO-Revision-Date: 2021-06-09 13:32+0000\n"
"Last-Translator: Florian DANIEL aka Facyla <i.daniel.florian@gmail.com>, 2022\n"
"Language-Team: French (https://www.transifex.com/elgg/teams/11337/fr/)\n"
Expand Down
Binary file modified docs/locale/fr/LC_MESSAGES/plugins.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/locale/fr/LC_MESSAGES/plugins.po
Expand Up @@ -12,7 +12,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Elgg master\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-05-12 13:45+0200\n"
"POT-Creation-Date: 2022-05-31 14:24+0200\n"
"PO-Revision-Date: 2021-06-09 13:32+0000\n"
"Last-Translator: Florian DANIEL aka Facyla <i.daniel.florian@gmail.com>, 2021\n"
"Language-Team: French (https://www.transifex.com/elgg/teams/11337/fr/)\n"
Expand Down
Binary file modified docs/locale/fr/LC_MESSAGES/tutorials.mo
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/locale/fr/LC_MESSAGES/tutorials.po
Expand Up @@ -13,7 +13,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Elgg master\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-05-12 13:45+0200\n"
"POT-Creation-Date: 2022-05-31 14:24+0200\n"
"PO-Revision-Date: 2021-06-09 13:32+0000\n"
"Last-Translator: Jeroen Dalsem, 2021\n"
"Language-Team: French (https://www.transifex.com/elgg/teams/11337/fr/)\n"
Expand Down
2 changes: 1 addition & 1 deletion docs/locale/pot/admin.pot
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Elgg master\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-05-31 14:24+0200\n"
"POT-Creation-Date: 2022-06-17 09:48+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down
2 changes: 1 addition & 1 deletion docs/locale/pot/appendix.pot
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Elgg master\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-05-31 14:24+0200\n"
"POT-Creation-Date: 2022-06-17 09:48+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down
2 changes: 1 addition & 1 deletion docs/locale/pot/contribute.pot
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Elgg master\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-05-31 14:24+0200\n"
"POT-Creation-Date: 2022-06-17 09:48+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down
2 changes: 1 addition & 1 deletion docs/locale/pot/design.pot
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Elgg master\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-05-31 14:24+0200\n"
"POT-Creation-Date: 2022-06-17 09:48+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down
2 changes: 1 addition & 1 deletion docs/locale/pot/guides.pot
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Elgg master\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-05-31 14:24+0200\n"
"POT-Creation-Date: 2022-06-17 09:48+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down
2 changes: 1 addition & 1 deletion docs/locale/pot/index.pot
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Elgg master\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-05-31 14:24+0200\n"
"POT-Creation-Date: 2022-06-17 09:48+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down
2 changes: 1 addition & 1 deletion docs/locale/pot/intro.pot
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Elgg master\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-05-31 14:24+0200\n"
"POT-Creation-Date: 2022-06-17 09:48+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down
2 changes: 1 addition & 1 deletion docs/locale/pot/plugins.pot
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Elgg master\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-05-31 14:24+0200\n"
"POT-Creation-Date: 2022-06-17 09:48+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down
2 changes: 1 addition & 1 deletion docs/locale/pot/tutorials.pot
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Elgg master\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-05-31 14:24+0200\n"
"POT-Creation-Date: 2022-06-17 09:48+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down
1 change: 1 addition & 0 deletions engine/classes/Elgg/Cache/Config/Files.php
Expand Up @@ -32,6 +32,7 @@ public static function fromElggConfig(\Elgg\Config $config): ?self {
'preventCacheSlams' => true,
'useStaticItemCaching' => true,
'itemDetailedDate' => true,
'securityKey' => 'elgg', // to make sure cli and webserver use the same folder
]);
}
}
1 change: 1 addition & 0 deletions engine/classes/Elgg/Cache/Config/LocalFiles.php
Expand Up @@ -32,6 +32,7 @@ public static function fromElggConfig(\Elgg\Config $config): ?self {
'secureFileManipulation' => true,
'useStaticItemCaching' => true,
'itemDetailedDate' => true,
'securityKey' => 'elgg', // to make sure cli and webserver use the same folder
]);
}
}
9 changes: 9 additions & 0 deletions engine/classes/Elgg/Database/Clauses/EntitySortByClause.php
Expand Up @@ -35,6 +35,11 @@ class EntitySortByClause extends OrderByClause {
* @var bool
*/
public $inverse_relationship;

/**
* @var int
*/
public $relationship_guid;

/**
* {@inheritdoc}
Expand Down Expand Up @@ -92,6 +97,10 @@ public function prepare(QueryBuilder $qb, $table_alias = null) {
case 'relationship':
if ($qb->getTableName() !== QueryBuilder::TABLE_RELATIONSHIPS) {
$er_alias = $qb->joinRelationshipTable($table_alias, $from_column, $this->property, $this->inverse_relationship, $this->join_type);
if (!empty($this->relationship_guid)) {
$guid_column = $this->inverse_relationship ? 'guid_two' : 'guid_one';
$qb->andWhere($qb->compare("{$er_alias}.{$guid_column}", '=', $this->relationship_guid, ELGG_VALUE_GUID));
}
} else {
$er_alias = $table_alias;
}
Expand Down
3 changes: 2 additions & 1 deletion engine/classes/Elgg/EntityIconService.php
Expand Up @@ -603,7 +603,8 @@ public function getIconLastChange(\ElggEntity $entity, $size, $type = 'icon') {
* @return bool
*/
public function hasIcon(\ElggEntity $entity, $size, $type = 'icon') {
return $this->getIcon($entity, $size, $type)->exists();
$icon = $this->getIcon($entity, $size, $type);
return $icon->exists() && $icon->getSize() > 0;
}

/**
Expand Down
36 changes: 22 additions & 14 deletions engine/classes/Elgg/Menus/FilterSortItems.php
Expand Up @@ -218,23 +218,31 @@ public static function registerSortingDropdown(\Elgg\Hook $hook): ?MenuItems {
/* @var $result MenuItems */
$result = $hook->getValue();

$first_menu_name = null;
/* @var $menu_item \ElggMenuItem */
foreach ($result as $menu_item) {
if ($menu_item->getParentName() !== 'sort:parent') {
continue;
}
$first_menu_name = $hook->getParam('filter_sorting_selected');
if (isset($first_menu_name) && !$result->has($first_menu_name)) {
$first_menu_name = null;
}

if (!isset($first_menu_name)) {
$result->sort([\ElggMenuBuilder::class, 'compareByPriority']);

if (!isset($first_menu_name)) {
/* @var $menu_item \ElggMenuItem */
foreach ($result as $menu_item) {
if ($menu_item->getParentName() !== 'sort:parent') {
continue;
}

if (!isset($first_menu_name)) {
$first_menu_name = $menu_item->getID();
}

if (!$menu_item->getSelected()) {
continue;
}

$first_menu_name = $menu_item->getID();
break;
}

if (!$menu_item->getSelected()) {
continue;
}

$first_menu_name = $menu_item->getID();
break;
}

if (!empty($first_menu_name)) {
Expand Down
2 changes: 1 addition & 1 deletion engine/classes/Elgg/Menus/Page.php
Expand Up @@ -306,7 +306,7 @@ public static function registerAdminPluginSettings(\Elgg\Hook $hook) {
continue;
}
$plugin_name = $plugin->getDisplayName();
$plugins_with_settings[$plugin_name] = [
$plugins_with_settings[strtolower($plugin_name)] = [
'name' => "plugin:settings:{$plugin_id}",
'href' => elgg_generate_url('admin:plugin_settings', [
'plugin_id' => $plugin_id,
Expand Down
Expand Up @@ -1092,6 +1092,7 @@ protected function normalizeOrderByClauses(array $options = []) {
$clause->direction = elgg_extract('direction', $sort_spec);
$clause->signed = elgg_extract('signed', $sort_spec);
$clause->inverse_relationship = elgg_extract('inverse_relationship', $sort_spec);
$clause->relationship_guid = elgg_extract('relationship_guid', $sort_spec);

$options['order_by'][] = $clause;
}
Expand Down
Expand Up @@ -4,6 +4,7 @@

use Elgg\EntityDirLocator;
use Elgg\IntegrationTestCase;
use Elgg\Project\Paths;
use ElggFile;

/**
Expand Down Expand Up @@ -69,4 +70,8 @@ function testElggFileDelete() {
$this->assertTrue($file->delete());
$this->assertFileDoesNotExist($filepath);
}

function testGetDirSize() {
$this->assertNotEmpty(get_dir_size(Paths::elgg() . "/engine/tests/test_files/actions/"));
}
}
Expand Up @@ -113,7 +113,15 @@ public function testSaveThrowsException() {
}

public function testLibFunctionToGetTempFile() {

$this->assertInstanceOf(ElggTempFile::class, elgg_get_temp_file());
}

public function testTempFilestore() {
$filestore = _elgg_services()->temp_filestore;

$this->assertFalse($filestore->setParameters(['unique_sub_dir' => 'foo']));

$params = $filestore->getParameters();
$this->assertEquals('foo', $params['unique_sub_dir']);
}
}
25 changes: 23 additions & 2 deletions engine/tests/phpunit/unit/Elgg/Menu/MenuServiceTest.php
Expand Up @@ -68,9 +68,30 @@ public function testCanGetPreparedMenu() {
$this->assertEquals(1, count($menu->getSection('default')->getItems()));

$prepare_hook->assertNumberOfCalls(1);

}


public function testCanUnregisterMenuItem() {
$this->assertTrue(elgg_register_menu_item('test', [
'name' => 'test1',
'text' => 'test1',
'href' => 'test1',
]));
$this->assertTrue(elgg_register_menu_item('test', [
'name' => 'test2',
'text' => 'test2',
'href' => 'test2',
]));

$items = elgg()->menus->getUnpreparedMenu('test')->getItems();
$this->assertTrue($items->has('test1'));
$this->assertTrue($items->has('test2'));

$this->assertNotEmpty(elgg_unregister_menu_item('test', 'test1'));

$items = elgg()->menus->getUnpreparedMenu('test')->getItems();
$this->assertFalse($items->has('test1'));
$this->assertTrue($items->has('test2'));
}

public function testCanSortMenuByName() {

Expand Down
2 changes: 2 additions & 0 deletions languages/fr.php
Expand Up @@ -960,6 +960,8 @@
'admin:server:requirements:database:client' => "Client de la base de données",
'admin:server:requirements:database:client:required' => "Elgg a besoin de pdo_mysql pour se connecter au serveur de base de données",

'admin:server:requirements:webp' => "Support WebP",

'admin:server:requirements:gc' => "Ramasse-miettes des déchets de session - garbage collection",
'admin:server:requirements:gc:info' => "Si le ramasse-miettes n'est pas configuré, la table de session ne sera pas nettoyée. Configurez session.gc_divisor et session.gc_probability dans votre php.ini.",

Expand Down

0 comments on commit 6cc557d

Please sign in to comment.