Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
UPDATE `#__update_sites`
SET `location` = 'https://update.joomla.org/language/translationlist_6.xml'
WHERE `location` = 'https://update.joomla.org/language/translationlist_5.xml';
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
-- Update content types for lookup tags

UPDATE `#__content_types`
SET `content_history_options` = JSON_ARRAY_APPEND(
`content_history_options`,
'$.displayLookup',
JSON_OBJECT(
'sourceColumn', 'tags',
'targetTable', '#__tags',
'targetColumn', 'id',
'displayColumn', 'title'
)
)
WHERE `type_alias` IN (
'com_content.article',
'com_contact.contact',
'com_newsfeeds.newsfeed',
'com_content.category',
'com_contact.category',
'com_newsfeeds.category',
'com_banners.category',
'com_users.category'
)
AND NOT JSON_CONTAINS(
JSON_EXTRACT(`content_history_options`, '$.displayLookup'),
JSON_OBJECT(
'sourceColumn', 'tags',
'targetTable', '#__tags',
'targetColumn', 'id',
'displayColumn', 'title'
)
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ALTER TABLE `#__history`
ADD COLUMN `is_current` TINYINT NOT NULL DEFAULT 0 /** CAN FAIL **/;
ALTER TABLE `#__history`
ADD COLUMN `is_legacy` TINYINT NOT NULL DEFAULT 0 /** CAN FAIL **/;
UPDATE `#__history` SET `is_legacy` = 1;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
UPDATE "#__update_sites"
SET "location" = 'https://update.joomla.org/language/translationlist_6.xml'
WHERE "location" = 'https://update.joomla.org/language/translationlist_5.xml';
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
-- Update content types for lookup tags

UPDATE "#__content_types"
SET "content_history_options" = jsonb_set(
"content_history_options"::jsonb,
'{displayLookup}',
"content_history_options"::jsonb->'displayLookup' ||
jsonb_build_object(
'sourceColumn', 'tags',
'targetTable', '#__tags',
'targetColumn', 'id',
'displayColumn', 'title'
)
)
WHERE "type_alias" IN (
'com_content.article',
'com_contact.contact',
'com_newsfeeds.newsfeed',
'com_content.category',
'com_contact.category',
'com_newsfeeds.category',
'com_banners.category',
'com_users.category'
)
AND NOT EXISTS (
SELECT * FROM jsonb_array_elements("content_history_options"::jsonb->'displayLookup')
WHERE value = jsonb_build_object(
'sourceColumn', 'tags',
'targetTable', '#__tags',
'targetColumn', 'id',
'displayColumn', 'title'
)
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- Remove wrong unique constraint from "#__ucm_content" table
ALTER TABLE "#__ucm_content" DROP CONSTRAINT "#__ucm_content_idx_type_alias_item_id" /** CAN FAIL **/;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ALTER TABLE "#__history"
ADD COLUMN "is_current" SMALLINT NOT NULL DEFAULT 0 /** CAN FAIL **/;
ALTER TABLE "#__history"
ADD COLUMN "is_legacy" SMALLINT NOT NULL DEFAULT 0 /** CAN FAIL **/;
UPDATE "#__history" SET "is_legacy" = 1;
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Table\Table;
use Joomla\CMS\Versioning\VersionableTableInterface;
use Joomla\Database\DatabaseInterface;
use Joomla\Database\ParameterType;
use Joomla\Event\DispatcherInterface;
Expand All @@ -31,7 +30,7 @@
*
* @since 1.5
*/
class BannerTable extends Table implements VersionableTableInterface
class BannerTable extends Table
{
/**
* Indicates that columns fully support the NULL value in the database
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,12 @@ public function save($data)

$this->setState($this->getName() . '.id', $table->id);

/**
* Save the version history. We need to call saveHistory method manually because category model does not
* call parent::save()
*/
$this->saveHistory($data, $this->typeAlias);

if (Factory::getApplication()->getInput()->get('task') == 'editAssociations') {
return $this->redirectToAssociations($data);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
use Joomla\CMS\Tag\TaggableTableTrait;
use Joomla\CMS\User\CurrentUserInterface;
use Joomla\CMS\User\CurrentUserTrait;
use Joomla\CMS\Versioning\VersionableTableInterface;
use Joomla\Database\DatabaseInterface;
use Joomla\Event\DispatcherInterface;
use Joomla\String\StringHelper;
Expand All @@ -34,7 +33,7 @@
*
* @since 1.0
*/
class ContactTable extends Table implements VersionableTableInterface, TaggableTableInterface, CurrentUserInterface
class ContactTable extends Table implements TaggableTableInterface, CurrentUserInterface
{
use TaggableTableTrait;
use CurrentUserTrait;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
use Joomla\CMS\Table\ContentHistory;
use Joomla\CMS\Table\ContentType;
use Joomla\CMS\Table\Table;
use Joomla\CMS\Versioning\VersionableModelInterface;
use Joomla\Database\ParameterType;
use Joomla\Database\QueryInterface;

Expand Down Expand Up @@ -306,7 +305,6 @@ protected function populateState($ordering = 'h.save_date', $direction = 'DESC')
$itemId = $input->get('item_id', '', 'string');

$this->setState('item_id', $itemId);
$this->setState('sha1_hash', $this->getSha1Hash());

// Load the parameters.
$params = ComponentHelper::getParams('com_contenthistory');
Expand Down Expand Up @@ -344,6 +342,7 @@ protected function getListQuery()
$db->quoteName('h.sha1_hash'),
$db->quoteName('h.version_data'),
$db->quoteName('h.keep_forever'),
$db->quoteName('h.is_current'),
]
)
)
Expand Down Expand Up @@ -374,25 +373,27 @@ protected function getListQuery()
*
* @since 3.2
*/
protected function getSha1Hash()
public function getSha1Hash()
{
$result = false;
$item_id = Factory::getApplication()->getInput()->getCmd('item_id', '');

[$extension, $type, $id] = explode('.', $item_id);

$app = Factory::getApplication();

$model = $app->bootComponent($extension)->getMVCFactory()->createModel($type, 'Administrator');
/**
* From Joomla 6, we use is_current field to determine the current version, so no need to calculate sha1 hash
* if there is already a current version
*/

if ($model instanceof VersionableModelInterface) {
$item = $model->getItem($id);
$result = $model->getSha1($item);
$items = $this->getItems();

return $result;
foreach ($items as $item) {
if ($item->is_current == 1) {
return $item->sha1_hash;
}
}

// Legacy code for history concept before 6.0.0, deprecated 6.0.0 will be removed with 8.0.0
$result = false;
$item_id = $this->state->get('item_id', '');

[$extension, $type, $id] = explode('.', $item_id);

Table::addIncludePath(JPATH_ADMINISTRATOR . '/components/' . $extension . '/tables');
$typeTable = $this->getTable('ContentType');
$typeTable->load(['type_alias' => $extension . '.' . $type]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ class HtmlView extends BaseHtmlView
*/
protected $toolbar;

/**
* The SHA1 hash of the current version of the item being viewed
*
* @var string
*/
protected $currentVersionHash;

/**
* Method to display the view.
*
Expand All @@ -74,9 +81,10 @@ public function display($tpl = null)
$model = $this->getModel();
$model->setUseExceptions(true);

$this->state = $model->getState();
$this->items = $model->getItems();
$this->pagination = $model->getPagination();
$this->state = $model->getState();
$this->items = $model->getItems();
$this->pagination = $model->getPagination();
$this->currentVersionHash = $model->getSha1Hash();

$this->toolbar = $this->addToolbar();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
<td class="original">
<?php if (isset($value1['value'][$key])) : ?>
<?php $currentvalue1 = $value1['value'][$key]; ?>
<?php if (is_array($value1['value'][$key])) : ?>
<?php $currentvalue1 = implode(' | ', $value1['value'][$key]); ?>
<?php if (is_array($currentvalue1)) : ?>
<?php $currentvalue1 = ArrayHelper::isAssociative($currentvalue1) ? json_encode($currentvalue1) : implode(' | ', $currentvalue1); ?>
<?php echo htmlspecialchars($key . ': ' . $currentvalue1, ENT_COMPAT, 'UTF-8'); ?>
<?php else : ?>
<?php echo htmlspecialchars($key . ': ' . $currentvalue1, ENT_COMPAT, 'UTF-8'); ?>
Expand All @@ -79,8 +79,8 @@
<td class="changed">
<?php if (isset($value2['value'][$key])) : ?>
<?php $currentvalue2 = $value2['value'][$key]; ?>
<?php if (is_array($value2['value'][$key])) : ?>
<?php $currentvalue2 = implode(' | ', $value2['value'][$key]); ?>
<?php if (is_array($currentvalue2)) : ?>
<?php $currentvalue2 = ArrayHelper::isAssociative($currentvalue2) ? json_encode($currentvalue2) : implode(' | ', $currentvalue2); ?>
<?php echo htmlspecialchars($key . ': ' . $currentvalue2, ENT_COMPAT, 'UTF-8'); ?>
<?php else : ?>
<?php echo htmlspecialchars($key . ': ' . $currentvalue2, ENT_COMPAT, 'UTF-8'); ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

Session::checkToken('get') or die(Text::_('JINVALID_TOKEN'));

$hash = $this->state->get('sha1_hash');
$hash = $this->currentVersionHash;
$formUrl = 'index.php?option=com_contenthistory&view=history&layout=modal&tmpl=component&item_id=' . $this->state->get('item_id') . '&' . Session::getFormToken() . '=1';

Text::script('COM_CONTENTHISTORY_BUTTON_SELECT_ONE_VERSION', true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ protected function getLanguages()
if (empty($updateSite)) {
Factory::getApplication()->enqueueMessage(Text::_('COM_INSTALLER_MSG_WARNING_NO_LANGUAGES_UPDATESERVER'), 'warning');

return;
return [];
}

try {
Expand All @@ -143,15 +143,15 @@ protected function getLanguages()
if ($response === null || $response->getStatusCode() !== 200) {
Factory::getApplication()->enqueueMessage(Text::sprintf('COM_INSTALLER_MSG_ERROR_CANT_CONNECT_TO_UPDATESERVER', $updateSite), 'error');

return;
return [];
}

$updateSiteXML = simplexml_load_string((string) $response->getBody());

if (!$updateSiteXML) {
Factory::getApplication()->enqueueMessage(Text::sprintf('COM_INSTALLER_MSG_ERROR_CANT_RETRIEVE_XML', $updateSite), 'error');

return;
return [];
}

$languages = [];
Expand Down
6 changes: 5 additions & 1 deletion administrator/components/com_tags/src/Model/TagModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Joomla\CMS\Factory;
use Joomla\CMS\MVC\Model\AdminModel;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Versioning\VersionableModelInterface;
use Joomla\CMS\Versioning\VersionableModelTrait;
use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
Expand All @@ -28,7 +29,7 @@
*
* @since 3.1
*/
class TagModel extends AdminModel
class TagModel extends AdminModel implements VersionableModelInterface
{
use VersionableModelTrait;

Expand Down Expand Up @@ -307,6 +308,9 @@ public function save($data)
$this->setState($this->getName() . '.id', $table->id);
$this->setState($this->getName() . '.new', $isNew);

// Save version history.
$this->saveHistory($data, $context);

// Clear the cache
$this->cleanCache();

Expand Down
3 changes: 1 addition & 2 deletions administrator/components/com_tags/src/Table/TagTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
use Joomla\CMS\Table\Nested;
use Joomla\CMS\User\CurrentUserInterface;
use Joomla\CMS\User\CurrentUserTrait;
use Joomla\CMS\Versioning\VersionableTableInterface;
use Joomla\Database\DatabaseInterface;
use Joomla\Event\DispatcherInterface;
use Joomla\String\StringHelper;
Expand All @@ -31,7 +30,7 @@
*
* @since 3.1
*/
class TagTable extends Nested implements VersionableTableInterface, CurrentUserInterface
class TagTable extends Nested implements CurrentUserInterface
{
use CurrentUserTrait;

Expand Down
2 changes: 1 addition & 1 deletion administrator/language/en-GB/com_cpanel.ini
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ COM_CPANEL_MSG_TEXTFILTER3919_TITLE="Updated Text Filter Recommendations"
COM_CPANEL_TITLE_SYSTEM_PANEL="System Panel"
COM_CPANEL_UNPUBLISH_MODULE_ERROR="Error unpublishing the module"
COM_CPANEL_UNPUBLISH_MODULE_SUCCESS="Module unpublished"
COM_CPANEL_WELCOME_BEGINNERS_MESSAGE="<p>Community resources are available for new users.</p><ul><li><a href=\"https://docs.joomla.org/Special:MyLanguage/Portal:Beginners\" target=\"_blank\" rel=\"noopener noreferrer\">Joomla! Beginners Guide</a></li><li><a href=\"https://forum.joomla.org/viewforum.php?f=834\" target=\"_blank\" rel=\"noopener noreferrer\">New to Joomla! Forum</a></li></ul>"
COM_CPANEL_WELCOME_BEGINNERS_MESSAGE="<p>Community resources are available for new users.</p><ul><li><a href=\"https://docs.joomla.org/Special:MyLanguage/Portal:Beginners\" target=\"_blank\" rel=\"noopener noreferrer\">Joomla! Beginners Guide</a></li><li><a href=\"https://forum.joomla.org/viewforum.php?f=860\" target=\"_blank\" rel=\"noopener noreferrer\">New to Joomla! Forum</a></li></ul>"
COM_CPANEL_WELCOME_BEGINNERS_TITLE="Welcome to Joomla!"
COM_CPANEL_XML_DESCRIPTION="Home Dashboard component"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,6 @@ window.customElements.define('joomla-field-fancy-select', class extends HTMLElem

this.isDisconnected = false;

// Add placeholder option for multiple mode,
// Because it not supported as parameter by Choices for <select> https://github.com/jshjohnson/Choices#placeholder
if (this.select.multiple && this.placeholder) {
const option = document.createElement('option');
option.setAttribute('placeholder', '');
option.textContent = this.placeholder;
this.select.appendChild(option);
}

// Init Choices
this.choicesInstance = new Choices(this.select, {
placeholderValue: this.placeholder,
Expand Down
4 changes: 2 additions & 2 deletions installation/language/cs-CZ/joomla.ini
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ JHIDEPASSWORD="Skrýt heslo"
JINVALID_TOKEN="Nejnovější požadavek byl odmítnut, protože obsahuje neplatný bezpečnostní symbol. Obnovte stránku a zkuste to znovu."
JINVALID_TOKEN_NOTICE="Bezpečnostní token se neshodoval. Požadavek byl přerušen, aby se zabránilo jakémukoli narušení bezpečnosti. Zkuste to znovu."
JNEXT="Následující"
JNO="Nikdy neodesílat"
JNOTICE="Oznámení"
JNO="Ne"
JNOTICE="Upozornění"
JOFF="Vypnuto"
JON="Zapnuto"
JPREVIOUS="Stránky"
Expand Down
8 changes: 8 additions & 0 deletions installation/language/fr-CA/joomla.ini
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ BUILD_MIN_PHP_ERROR_TEXT="Votre serveur a besoin d'utiliser la version {{phpvers
BUILD_MIN_PHP_ERROR_URL_TEXT="Aidez-moi à résoudre ceci"

; Main Config
INSTL_CHANGE_INSTALL_LANG="Changer la langue d'installation"
INSTL_CHANGE_INSTALL_LANG_SHORT="Sélectionnez la position"
INSTL_SELECTED_INSTALL_LANGUAGE="Langue actuelle : %s"
INSTL_SELECT_INSTALL_LANG="Choix de la langue d’installation"
INSTL_SELECT_LANGUAGE_TITLE="Choix de la langue"
INSTL_SETUP_LOGIN_DATA="Configuration des données de connexion"
Expand Down Expand Up @@ -90,6 +92,7 @@ INSTL_DATABASE_NO_SCHEMA="Aucun schéma de base de données n'existe pour ce typ
INSTL_DATABASE_PASSWORD_DESC="Saisissez le mot de passe d'accès à la base de données."
INSTL_DATABASE_PREFIX_DESC="Saisissez un préfixe de table ou utilisez celui généré aléatoirement"
INSTL_DATABASE_PREFIX_DUPLICATE_DESC="Si vous utilisez une base de données existante avec des tables ayant le même préfixe, Joomla renommera les tables existantes en leur ajoutant le préfixe \"bak_\"."
INSTL_DATABASE_PREFIX_MSG="Le préfixe de la table doit commencer par une lettre, éventuellement suivie de caractères alphanumériques et d'un trait de soulignement."
INSTL_DATABASE_RESPONSE_ERROR="Le processus d'installation a échoué."
INSTL_DATABASE_TYPE_DESC="Sélectionnez le type de base de données à utiliser"
INSTL_DATABASE_USER_DESC="Saisissez le nom d'utilisateur de la base de données."
Expand Down Expand Up @@ -141,6 +144,11 @@ INSTL_LANGUAGES_WARNING_NO_INTERNET="Le système d'installation ne peut pas se c
INSTL_LANGUAGES_WARNING_NO_INTERNET2="Note : vous pourrez installer d’autres langues plus tard depuis l’administration de Joomla."

; Automated Updates Opt Out
INSTL_AUTOMATED_UPDATES="Mises à jour automatisées"
INSTL_AUTOMATED_UPDATES_DESC="Joomla se met à jour automatiquement pour les versions mineures et les correctifs.<br><br><strong>Veuillez noter que :</strong> les mises à jour automatisées enregistrent votre site auprès du service fourni par le projet Joomla! L'inscription permet au projet Joomla d'accéder aux informations suivantes sur votre site et votre environnement serveur : Url du site, version PHP, type de base de données et version, version CMS et type et version du système d'exploitation du serveur. Ces informations ne sont utilisées que pour améliorer le service.<br><br>Si vous ne souhaitez pas communiquer ces informations, vous pouvez désactiver les mises à jour automatisées en cliquant sur le bouton ci-dessous."
INSTL_AUTOMATED_UPDATES_DISABLE="Désactiver les mises à jour automatisées"
INSTL_COMPLETE_ERROR_AUTOMATED_UPDATES_DISABLE="Impossible de désactiver les mises à jour automatisées."
INSTL_DISABLE_AUTOUPDATE="Êtes-vous sûr de vouloir désactiver les mises à jour automatisées ?"

; Default language view
INSTL_DEFAULTLANGUAGE_ADMINISTRATOR="Langue par défaut de l'interface d'administration"
Expand Down
Loading