Skip to content

Commit

Permalink
Merge pull request #11 from richard67/4.0-dev-N6REJ-icon-mod-1
Browse files Browse the repository at this point in the history
[4.0] [PR 28075] Fix conflicts with base branch
  • Loading branch information
N6REJ authored May 11, 2020
2 parents e4ad3e2 + 72c7462 commit a7557c8
Show file tree
Hide file tree
Showing 448 changed files with 2,199 additions and 1,338 deletions.
29 changes: 28 additions & 1 deletion .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,35 @@ services:
POSTGRES_PASSWORD: joomla_ut
POSTGRES_DB: test_joomla

---
kind: pipeline
name: package

steps:
- name: packager
image: joomlaprojects/docker-images:packager
environment:
FTP_USERNAME:
from_secret: ftpusername
FTP_PASSWORD:
from_secret: ftppassword
FTP_HOSTNAME: ci.joomla.org
FTP_PORT: "21"
FTP_DEST_DIR: /artifacts
FTP_VERIFY: "false"
FTP_SECURE: "true"
HTTP_ROOT: "https://ci.joomla.org/artifacts"
DRONE_PULL_REQUEST: DRONE_PULL_REQUEST
DRONE_COMMIT: DRONE_COMMIT
GITHUB_TOKEN:
from_secret: github_token
commands:
- if [ $DRONE_REPO_NAME != 'joomla-cms' ]; then echo "The packager only runs on the joomla/joomla-cms repo"; exit 0; fi
- /bin/drone_build.sh


---
kind: signature
hmac: 06035b7ce5a946d486d499e71b5c80538ae5272929f072b03cfadf4bb3b1fc15
hmac: a0026c26e94c1443cb0de99edcd5c81a83981c99ea43e5254542c2e4214abe4e

...
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
github: joomla
custom: https://community.joomla.org/sponsorship-campaigns.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@
<field
name="extension"
type="extension"
label="COM_ACTIONLOGS_SELECT_EXTENSION"
label="COM_ACTIONLOGS_EXTENSION"
onchange="this.form.submit()"
>
<option value="">COM_ACTIONLOGS_SELECT_EXTENSION</option>
</field>
<field
name="dateRange"
type="logsdaterange"
label="COM_ACTIONLOGS_OPTION_FILTER_DATE"
label="COM_ACTIONLOGS_DATE"
onchange="this.form.submit();"
>
<option value="">COM_ACTIONLOGS_OPTION_FILTER_DATE</option>
</field>
<field
name="user"
type="logcreator"
label="COM_ACTIONLOGS_SELECT_USER"
label="COM_ACTIONLOGS_NAME"
onchange="this.form.submit();"
>
<option value="">COM_ACTIONLOGS_SELECT_USER</option>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace Joomla\Component\Actionlogs\Administrator\Field;

defined('JPATH_BASE') or die;
defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\Form\FormField;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
<?php else : ?>
<table class="table" id="logsList">
<caption id="captionTable" class="sr-only">
<?php echo Text::_('COM_ACTIONLOGS_TABLE_CAPTION'); ?>, <?php echo Text::_('JGLOBAL_SORTED_BY'); ?>
<?php echo Text::_('COM_ACTIONLOGS_TABLE_CAPTION'); ?>,
<span id="orderedBy"><?php echo Text::_('JGLOBAL_SORTED_BY'); ?> </span>,
<span id="filteredBy"><?php echo Text::_('JGLOBAL_FILTERED_BY'); ?></span>
</caption>
<thead>
<tr>
Expand Down
124 changes: 88 additions & 36 deletions administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -6254,11 +6254,13 @@ public function convertTablesToUtf8mb4($doDbFixMsg = false)
// Set required conversion status
if ($db->hasUTF8mb4Support())
{
$converted = 2;
$convertedStep1 = 2;
$convertedStep2 = 4;
}
else
{
$converted = 1;
$convertedStep1 = 1;
$convertedStep2 = 3;
}

// Check conversion status in database
Expand All @@ -6284,73 +6286,123 @@ public function convertTablesToUtf8mb4($doDbFixMsg = false)
return;
}

// Nothing to do, saved conversion status from DB is equal to required
if ($convertedDB == $converted)
// Nothing to do, saved conversion status from DB is equal to required final status
if ($convertedDB == $convertedStep2)
{
return;
}

// Step 1: Drop indexes later to be added again with column lengths limitations at step 2
$fileName1 = JPATH_ROOT . '/administrator/components/com_admin/sql/others/mysql/utf8mb4-conversion-01.sql';
$converted = $convertedDB;
$hasErrors = false;

if (is_file($fileName1))
// Steps 1 and 2: Convert core tables if necessary and not to be done at later steps
if ($convertedDB < $convertedStep1)
{
$fileContents1 = @file_get_contents($fileName1);
$queries1 = $db->splitSql($fileContents1);
// Step 1: Drop indexes later to be added again with column lengths limitations at step 2
$fileName1 = JPATH_ROOT . '/administrator/components/com_admin/sql/others/mysql/utf8mb4-conversion-01.sql';

if (!empty($queries1))
if (is_file($fileName1))
{
foreach ($queries1 as $query1)
$fileContents1 = @file_get_contents($fileName1);
$queries1 = $db->splitSql($fileContents1);

if (!empty($queries1))
{
try
foreach ($queries1 as $query1)
{
$db->setQuery($query1)->execute();
try
{
$db->setQuery($query1)->execute();
}
catch (Exception $e)
{
// If the query fails we will go on. It just means the index to be dropped does not exist.
}
}
catch (Exception $e)
}
}

// Step 2: Perform the index modifications and conversions
$fileName2 = JPATH_ROOT . '/administrator/components/com_admin/sql/others/mysql/utf8mb4-conversion-02.sql';

if (is_file($fileName2))
{
$fileContents2 = @file_get_contents($fileName2);
$queries2 = $db->splitSql($fileContents2);

if (!empty($queries2))
{
foreach ($queries2 as $query2)
{
// If the query fails we will go on. It just means the index to be dropped does not exist.
try
{
$db->setQuery($db->convertUtf8mb4QueryToUtf8($query2))->execute();
}
catch (Exception $e)
{
$hasErrors = true;

// Still render the error message from the Exception object
JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error');
}
}
}
}
}

// Step 2: Perform the index modifications and conversions
$fileName2 = JPATH_ROOT . '/administrator/components/com_admin/sql/others/mysql/utf8mb4-conversion-02.sql';
if (!$hasErrors)
{
$converted = $convertedStep1;
}
}

if (is_file($fileName2))
// Step 3: Convert action logs and privacy suite tables if necessary and conversion hasn't failed before
if (!$hasErrors && $convertedDB < $convertedStep2)
{
$fileContents2 = @file_get_contents($fileName2);
$queries2 = $db->splitSql($fileContents2);
$fileName3 = JPATH_ROOT . '/administrator/components/com_admin/sql/others/mysql/utf8mb4-conversion-03.sql';

if (!empty($queries2))
if (is_file($fileName3))
{
foreach ($queries2 as $query2)
$fileContents3 = @file_get_contents($fileName3);
$queries3 = $db->splitSql($fileContents3);

if (!empty($queries3))
{
try
foreach ($queries3 as $query3)
{
$db->setQuery($db->convertUtf8mb4QueryToUtf8($query2))->execute();
}
catch (Exception $e)
{
$converted = 0;
try
{
$db->setQuery($db->convertUtf8mb4QueryToUtf8($query3))->execute();
}
catch (Exception $e)
{
$hasErrors = true;

// Still render the error message from the Exception object
Factory::getApplication()->enqueueMessage($e->getMessage(), 'error');
// Still render the error message from the Exception object
JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error');
}
}
}
}

if (!$hasErrors)
{
$converted = $convertedStep2;
}
}

if ($doDbFixMsg && $converted == 0)
if ($doDbFixMsg && $hasErrors)
{
// Show an error message telling to check database problems
Factory::getApplication()->enqueueMessage(Text::_('JLIB_DATABASE_ERROR_DATABASE_UPGRADE_FAILED'), 'error');
}

// Set flag in database if the update is done.
$db->setQuery('UPDATE ' . $db->quoteName('#__utf8_conversion')
. ' SET ' . $db->quoteName('converted') . ' = ' . $converted . ';'
)->execute();
// Set flag in database if the conversion status has changed.
if ($converted != $convertedDB)
{
$db->setQuery('UPDATE ' . $db->quoteName('#__utf8_conversion')
. ' SET ' . $db->quoteName('converted') . ' = ' . $converted . ';'
)->execute();
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ ALTER TABLE `#__newsfeeds` MODIFY `alias` varchar(400) NOT NULL DEFAULT '';
ALTER TABLE `#__tags` MODIFY `path` varchar(400) NOT NULL DEFAULT '';
ALTER TABLE `#__tags` MODIFY `alias` varchar(400) NOT NULL DEFAULT '';
ALTER TABLE `#__ucm_content` MODIFY `core_type_alias` varchar(400) NOT NULL DEFAULT '' COMMENT 'FK to the content types table';
ALTER TABLE `#__ucm_content` MODIFY `core_title` varchar(400) NOT NULL;
ALTER TABLE `#__ucm_content` MODIFY `core_title` varchar(400) NOT NULL DEFAULT '';
ALTER TABLE `#__ucm_content` MODIFY `core_alias` varchar(400) NOT NULL DEFAULT '';
ALTER TABLE `#__users` MODIFY `name` varchar(400) NOT NULL DEFAULT '';

--
-- Step 2.2: Convert all tables to utf8mb4 chracter set with utf8mb4_unicode_ci collation
-- Step 2.2: Convert all tables to utf8mb4 character set with utf8mb4_unicode_ci collation
-- except #__finder_xxx tables, those will have utf8mb4_general_ci collation.
-- Note: The database driver for mysql will change utf8mb4 to utf8 if utf8mb4 is not supported
--
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
--
-- Step 3 of the UTF-8 Multibyte (utf8mb4) conversion for MySQL
--
-- Convert the tables for action logs and the privacy suite which have been
-- forgotten to be added to the utf8mb4 conversion before.
--
-- This file here will be processed with reporting exceptions, in opposite
-- to the file for step 1.
--

--
-- Step 3.1: Convert action logs and privacy suite tables to utf8mb4 character set with
-- utf8mb4_unicode_ci collation
-- Note: The database driver for mysql will change utf8mb4 to utf8 if utf8mb4 is not supported
--

ALTER TABLE `#__action_logs` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `#__action_logs_extensions` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `#__action_logs_users` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `#__action_log_config` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `#__privacy_consents` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `#__privacy_requests` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

--
-- Step 3.2: Set default character set and collation for previously converted tables
--

ALTER TABLE `#__action_logs` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `#__action_logs_extensions` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `#__action_logs_users` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `#__action_log_config` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `#__privacy_consents` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE `#__privacy_requests` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<field
name="state"
type="status"
label="JOPTION_SELECT_PUBLISHED"
label="JSTATUS"
onchange="this.form.submit();"
>
<option value="">JOPTION_SELECT_PUBLISHED</option>
Expand All @@ -42,7 +42,7 @@
<field
name="category_id"
type="category"
label="JOPTION_SELECT_CATEGORY"
label="JCATEGORY"
published="0,1,2"
extension="dynamic"
onchange="this.form.submit();"
Expand All @@ -53,7 +53,7 @@
<field
name="menutype"
type="menu"
label="COM_ASSOCIATIONS_SELECT_MENU"
label="COM_ASSOCIATIONS_HEADING_MENUTYPE"
clientid="0"
onchange="this.form.submit();"
>
Expand All @@ -63,7 +63,7 @@
<field
name="access"
type="accesslevel"
label="JOPTION_SELECT_ACCESS"
label="JGRID_HEADING_ACCESS"
onchange="this.form.submit();"
>
<option value="">JOPTION_SELECT_ACCESS</option>
Expand All @@ -72,7 +72,7 @@
<field
name="level"
type="integer"
label="JOPTION_SELECT_MAX_LEVELS"
label="JGLOBAL_MAXLEVEL_LABEL"
first="1"
last="10"
step="1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

defined('JPATH_BASE') or die;
defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace Joomla\Component\Associations\Administrator\Field;

defined('JPATH_BASE') or die;
defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\Form\Field\ListField;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace Joomla\Component\Associations\Administrator\Field;

defined('JPATH_BASE') or die;
defined('_JEXEC') or die;

use Joomla\CMS\Form\Field\GroupedlistField;
use Joomla\CMS\HTML\HTMLHelper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace Joomla\Component\Associations\Administrator\Field\Modal;

defined('JPATH_BASE') or die;
defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\Form\FormField;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ public static function getAssociationHtmlList($extensionName, $typeName, $itemId

$url = Route::_('index.php?' . http_build_query($options));
$url = $allow && $addLink ? $url : '';
$text = strtoupper($language->sef);
$text = $language->lang_code;

$tooltip = '<strong>' . htmlspecialchars($language->title, ENT_QUOTES, 'UTF-8') . '</strong><br>'
. htmlspecialchars($title, ENT_QUOTES, 'UTF-8') . '<br><br>' . $additional;
Expand Down
Loading

0 comments on commit a7557c8

Please sign in to comment.