Skip to content

Commit

Permalink
Merge branch '4.0-dev' into patch-126
Browse files Browse the repository at this point in the history
  • Loading branch information
alikon committed Jan 15, 2020
2 parents 0e3f135 + 78e51d2 commit 5138e73
Show file tree
Hide file tree
Showing 582 changed files with 9,794 additions and 4,263 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Expand Up @@ -42,7 +42,7 @@ install:
}
- appveyor-retry cinst -y sqlite
- cd C:\tools\php
# Get the MSSQL DLL's
# Get the MSSQL DLLs
- ps: >-
If ($env:PHP -eq "1") {
cd c:\tools\php\ext
Expand Down
14 changes: 13 additions & 1 deletion .drone.yml
Expand Up @@ -171,6 +171,8 @@ steps:
- name: javascript-cs
depends_on: [ npm ]
image: joomlaprojects/docker-images:systemtests
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- export DISPLAY=:0
- Xvfb -screen 0 1024x768x24 -ac +extension GLX +render -noreset > /dev/null 2>&1 &
Expand All @@ -181,6 +183,8 @@ steps:
- name: javascript-tests
depends_on: [ npm ]
image: joomlaprojects/docker-images:systemtests
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- export DISPLAY=:0
- Xvfb -screen 0 1024x768x24 -ac +extension GLX +render -noreset > /dev/null 2>&1 &
Expand All @@ -191,24 +195,32 @@ steps:
- name: system-tests-mysql
depends_on: [ javascript-tests ]
image: joomlaprojects/docker-images:systemtests
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/Codeception/drone-system-run.sh "$(pwd)" mysql

- name: system-tests-mysql8
depends_on: [ system-tests-mysql ]
image: joomlaprojects/docker-images:systemtests
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/Codeception/drone-system-run.sh "$(pwd)" mysql8

- name: system-tests-postgres
depends_on: [ system-tests-mysql8 ]
image: joomlaprojects/docker-images:systemtests
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/Codeception/drone-system-run.sh "$(pwd)" postgres

- name: api-tests
depends_on: [ system-tests-postgres ]
image: joomlaprojects/docker-images:systemtests
environment:
JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1
commands:
- bash tests/Codeception/drone-api-run.sh "$(pwd)"

Expand Down Expand Up @@ -297,6 +309,6 @@ services:

---
kind: signature
hmac: 9269cc571ec30d3d18ba3bb5f7dc132c36608b54ec777ae6d9c6dde224255fc8
hmac: bf9ea2d23f5b94fc80c2cb5fbd9b8c5f7b1423319c01a904b0b499233eb873f6

...
4 changes: 2 additions & 2 deletions administrator/components/com_actionlogs/actionlogs.xml
Expand Up @@ -27,8 +27,8 @@
<folder>View</folder>
</files>
<languages folder="admin">
<language tag="en-GB">language/en-GB.com_actionlogs.ini</language>
<language tag="en-GB">language/en-GB.com_actionlogs.sys.ini</language>
<language tag="en-GB">language/en-GB/com_actionlogs.ini</language>
<language tag="en-GB">language/en-GB/com_actionlogs.sys.ini</language>
</languages>
</administration>
</extension>
Expand Up @@ -4,6 +4,7 @@
<field
name="search"
type="text"
inputmode="search"
label="COM_ACTIONLOGS_FILTER_SEARCH_DESC"
description="COM_ACTIONLOGS_SEARCH_IN_NAME"
hint="JSEARCH_FILTER"
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_admin/admin.xml
Expand Up @@ -27,8 +27,8 @@
<folder>View</folder>
</files>
<languages folder="admin">
<language tag="en-GB">language/en-GB.com_admin.ini</language>
<language tag="en-GB">language/en-GB.com_admin.sys.ini</language>
<language tag="en-GB">language/en-GB/com_admin.ini</language>
<language tag="en-GB">language/en-GB/com_admin.sys.ini</language>
</languages>
</administration>
</extension>
259 changes: 218 additions & 41 deletions administrator/components/com_admin/script.php
Expand Up @@ -6104,6 +6104,68 @@ public function postflight($action, $installer)

$tableItem = new \Joomla\Component\Menus\Administrator\Table\MenuTable($db);

$contactItems = $this->contactItems($tableItem);
$finderItems = $this->finderItems($tableItem);

$menuItems = array_merge($contactItems, $finderItems);

foreach ($menuItems as $menuItem)
{
// Check an existing record
$keys = [
'menutype' => $menuItem['menutype'],
'type' => $menuItem['type'],
'title' => $menuItem['title'],
'parent_id' => $menuItem['parent_id'],
'client_id' => $menuItem['client_id'],
];

if ($tableItem->load($keys))
{
continue;
}

$newTableItem = new \Joomla\Component\Menus\Administrator\Table\MenuTable($db);

// Bind the data.
if (!$newTableItem->bind($menuItem))
{
return false;
}

$newTableItem->setLocation($menuItem['parent_id'], 'last-child');

// Check the data.
if (!$newTableItem->check())
{
return false;
}

// Store the data.
if (!$newTableItem->store())
{
return false;
}

// Rebuild the tree path.
if (!$newTableItem->rebuildPath($newTableItem->id))
{
return false;
}
}

return true;
}

/**
* Prepare the contact menu items
*
* @return array Menu items
*
* @since __DEPLOY_VERSION__
*/
private function contactItems(Table $tableItem): array
{
// Check for the Contact parent Id Menu Item
$keys = [
'menutype' => 'main',
Expand All @@ -6117,7 +6179,7 @@ public function postflight($action, $installer)

if (!$contactMenuitem)
{
return false;
return [];
}

$parentId = $tableItem->id;
Expand Down Expand Up @@ -6202,51 +6264,166 @@ public function postflight($action, $installer)
]
];

foreach ($menuItems as $menuItem)
{
// Check an existing record
$keys = [
'menutype' => $menuItem['menutype'],
'type' => $menuItem['type'],
'title' => $menuItem['title'],
'parent_id' => $menuItem['parent_id'],
'client_id' => $menuItem['client_id'],
];

if ($tableItem->load($keys))
{
continue;
}

$newTableItem = new \Joomla\Component\Menus\Administrator\Table\MenuTable($db);
return $menuItems;
}

// Bind the data.
if (!$newTableItem->bind($menuItem))
{
return false;
}
/**
* Prepare the finder menu items
*
* @return array Menu items
*
* @since __DEPLOY_VERSION__
*/
private function finderItems(Table $tableItem): array
{
// Check for the Finder parent Id Menu Item
$keys = [
'menutype' => 'main',
'type' => 'component',
'title' => 'com_finder',
'parent_id' => 1,
'client_id' => 1,
];

$newTableItem->setLocation($menuItem['parent_id'], 'last-child');
$finderMenuitem = $tableItem->load($keys);

// Check the data.
if (!$newTableItem->check())
{
return false;
}
if (!$finderMenuitem)
{
return [];
}

// Store the data.
if (!$newTableItem->store())
{
return false;
}
$parentId = $tableItem->id;
$componentId = ExtensionHelper::getExtensionRecord('com_finder')->extension_id;

// Rebuild the tree path.
if (!$newTableItem->rebuildPath($newTableItem->id))
{
return false;
}
}
// Add Finder Fields Menu Items.
$menuItems = [
[
'menutype' => 'main',
'title' => '-',
'alias' => microtime(true),
'note' => '',
'path' => '',
'link' => '#',
'type' => 'separator',
'published' => 1,
'parent_id' => $parentId,
'level' => 2,
'component_id' => $componentId,
'checked_out' => 0,
'checked_out_time' => null,
'browserNav' => 0,
'access' => 0,
'img' => '',
'template_style_id' => 0,
'params' => '{}',
'home' => 0,
'language' => '*',
'client_id' => 1,
'publish_up' => null,
'publish_down' => null,
],
[
'menutype' => 'main',
'title' => 'com_finder_index',
'alias' => 'Smart-Search-Index',
'note' => '',
'path' => 'Smart Search/Index',
'link' => 'index.php?option=com_finder&view=index',
'type' => 'component',
'published' => 1,
'parent_id' => $parentId,
'level' => 2,
'component_id' => $componentId,
'checked_out' => 0,
'checked_out_time' => null,
'browserNav' => 0,
'access' => 0,
'img' => '',
'template_style_id' => 0,
'params' => '{}',
'home' => 0,
'language' => '*',
'client_id' => 1,
'publish_up' => null,
'publish_down' => null,
],
[
'menutype' => 'main',
'title' => 'com_finder_maps',
'alias' => 'Smart-Search-Maps',
'note' => '',
'path' => 'Smart Search/Maps',
'link' => 'index.php?option=com_finder&view=maps',
'type' => 'component',
'published' => 1,
'parent_id' => $parentId,
'level' => 2,
'component_id' => $componentId,
'checked_out' => 0,
'checked_out_time' => null,
'browserNav' => 0,
'access' => 0,
'img' => '',
'template_style_id' => 0,
'params' => '{}',
'home' => 0,
'language' => '*',
'client_id' => 1,
'publish_up' => null,
'publish_down' => null,
],
[
'menutype' => 'main',
'title' => 'com_finder_filters',
'alias' => 'Smart-Search-Filters',
'note' => '',
'path' => 'Smart Search/Filters',
'link' => 'index.php?option=com_finder&view=filters',
'type' => 'component',
'published' => 1,
'parent_id' => $parentId,
'level' => 2,
'component_id' => $componentId,
'checked_out' => 0,
'checked_out_time' => null,
'browserNav' => 0,
'access' => 0,
'img' => '',
'template_style_id' => 0,
'params' => '{}',
'home' => 0,
'language' => '*',
'client_id' => 1,
'publish_up' => null,
'publish_down' => null,
],
[
'menutype' => 'main',
'title' => 'com_finder_searches',
'alias' => 'Smart-Search-Searches',
'note' => '',
'path' => 'Smart Search/Searches',
'link' => 'index.php?option=com_finder&view=searches',
'type' => 'component',
'published' => 1,
'parent_id' => $parentId,
'level' => 2,
'component_id' => $componentId,
'checked_out' => 0,
'checked_out_time' => null,
'browserNav' => 0,
'access' => 0,
'img' => '',
'template_style_id' => 0,
'params' => '{}',
'home' => 0,
'language' => '*',
'client_id' => 1,
'publish_up' => null,
'publish_down' => null,
]
];

return true;
return $menuItems;
}
}
Expand Up @@ -3,6 +3,10 @@ ALTER TABLE `#__ucm_content` MODIFY `core_modified_time` datetime NOT NULL;

ALTER TABLE `#__ucm_content` MODIFY `core_publish_up` datetime NULL DEFAULT NULL;
ALTER TABLE `#__ucm_content` MODIFY `core_publish_down` datetime NULL DEFAULT NULL;

-- Only on MySQL: Update empty strings to null date before converting the column from varchar to datetime
UPDATE `#__ucm_content` SET `core_checked_out_time` = '0000-00-00 00:00:00' WHERE `core_checked_out_time` = '';

ALTER TABLE `#__ucm_content` MODIFY `core_checked_out_time` datetime NULL DEFAULT NULL;

ALTER TABLE `#__ucm_history` MODIFY `save_date` datetime NOT NULL;

0 comments on commit 5138e73

Please sign in to comment.