Skip to content

Commit

Permalink
[RELEASE] Version 12.5.5 Fixes & Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
dhoffmann1979 committed Oct 9, 2024
2 parents 39748c5 + b44a095 commit 24df45c
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 23 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# In2publish Core Change Log

15.5.4:
12.5.5:
- [BUGFIX] Correct Response of Compare Tool
- [BUGFIX] Make ResolverService public
- [BUGFIX] Fix cache clear task
- [BUGFIX] Fix filters in file module
- [TASK] Make search in file module case-insensitive

12.5.4:
- [BUGFIX] Enable Logging in Command on foreign
- [BUGFIX] LogLevel is evaluated correctly

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,13 @@ protected function getDataHandler(): DataHandler
$dataHandler = GeneralUtility::makeInstance(DataHandler::class);
/** @var CommandLineUserAuthentication $user */
$user = $GLOBALS['BE_USER'];
$user->authenticate();

if (!$user->user) {
$user->authenticate();
}

$dataHandler->BE_USER = $user;

/** @psalm-suppress InternalProperty */
$dataHandler->admin = true;
return $dataHandler;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public function compareAction(ComparisonRequest $comparisonRequest = null): Resp
* @SuppressWarnings(PHPMD.NPathComplexity) PR welcome
* @SuppressWarnings(PHPMD.ExcessiveMethodLength) PR welcome
*/
public function transferAction(string $table, int $uid, string $expected): void
public function transferAction(string $table, int $uid, string $expected): ResponseInterface
{
$localQuery = $this->localDatabase->createQueryBuilder();
$localQuery->getRestrictions()->removeAll();
Expand All @@ -202,8 +202,14 @@ public function transferAction(string $table, int $uid, string $expected): void

if (empty($localRow) && empty($foreignRow)) {
$this->addFlashMessage(
LocalizationUtility::translate('compare_database.transfer.record_missing', 'in2publish_core'),
LocalizationUtility::translate('compare_database.transfer.error', 'in2publish_core'),
LocalizationUtility::translate(
'LLL:EXT:in2publish_core/Resources/Private/Language/locallang_mod4.xlf:compare_database.transfer.record_missing',
'in2publish_core'
),
LocalizationUtility::translate(
'LLL:EXT:in2publish_core/Resources/Private/Language/locallang_mod4.xlf:compare_database.transfer.error',
'in2publish_core'
),
AbstractMessage::ERROR,
);
$this->redirect('index');
Expand All @@ -212,8 +218,14 @@ public function transferAction(string $table, int $uid, string $expected): void
if ($expected === 'only_foreign') {
if (!(empty($localRow) && !empty($foreignRow))) {
$this->addFlashMessage(
LocalizationUtility::translate('compare_database.transfer.exists_on_foreign', 'in2publish_core'),
LocalizationUtility::translate('compare_database.transfer.error', 'in2publish_core'),
LocalizationUtility::translate(
'LLL:EXT:in2publish_core/Resources/Private/Language/locallang_mod4.xlf:compare_database.transfer.exists_on_foreign',
'in2publish_core'
),
LocalizationUtility::translate(
'LLL:EXT:in2publish_core/Resources/Private/Language/locallang_mod4.xlf:compare_database.transfer.error',
'in2publish_core'
),
AbstractMessage::ERROR,
);
$this->redirect('index');
Expand All @@ -225,20 +237,29 @@ public function transferAction(string $table, int $uid, string $expected): void
if (1 === $foreignResult) {
$this->addFlashMessage(
LocalizationUtility::translate(
'compare_database.transfer.deleted_from_foreign',
'LLL:EXT:in2publish_core/Resources/Private/Language/locallang_mod4.xlf:compare_database.transfer.deleted_from_foreign',
'in2publish_core',
[$table, $uid],
),
LocalizationUtility::translate('compare_database.transfer.success', 'in2publish_core'),
LocalizationUtility::translate(
'LLL:EXT:in2publish_core/Resources/Private/Language/locallang_mod4.xlf:compare_database.transfer.success',
'in2publish_core'
),
);
}
}

if ($expected === 'only_local') {
if (!(!empty($localRow) && empty($foreignRow))) {
$this->addFlashMessage(
LocalizationUtility::translate('compare_database.transfer.exists_on_local', 'in2publish_core'),
LocalizationUtility::translate('compare_database.transfer.error', 'in2publish_core'),
LocalizationUtility::translate(
'LLL:EXT:in2publish_core/Resources/Private/Language/locallang_mod4.xlf:compare_database.transfer.exists_on_local',
'in2publish_core'
),
LocalizationUtility::translate(
'LLL:EXT:in2publish_core/Resources/Private/Language/locallang_mod4.xlf:compare_database.transfer.error',
'in2publish_core'
),
AbstractMessage::ERROR,
);
$this->redirect('index');
Expand All @@ -250,11 +271,14 @@ public function transferAction(string $table, int $uid, string $expected): void
if (1 === $foreignResult) {
$this->addFlashMessage(
LocalizationUtility::translate(
'compare_database.transfer.transferred_to_foreign',
'LLL:EXT:in2publish_core/Resources/Private/Language/locallang_mod4.xlf:compare_database.transfer.transferred_to_foreign',
'in2publish_core',
[$table, $uid],
),
LocalizationUtility::translate('compare_database.transfer.success', 'in2publish_core'),
LocalizationUtility::translate(
'LLL:EXT:in2publish_core/Resources/Private/Language/locallang_mod4.xlf:compare_database.transfer.success',
'in2publish_core'
),
);
}
}
Expand All @@ -263,10 +287,13 @@ public function transferAction(string $table, int $uid, string $expected): void
if (!(!empty($localRow) && !empty($foreignRow))) {
$this->addFlashMessage(
LocalizationUtility::translate(
'compare_database.transfer.does_not_exists_on_both',
'LLL:EXT:in2publish_core/Resources/Private/Language/locallang_mod4.xlf:compare_database.transfer.does_not_exists_on_both',
'in2publish_core',
),
LocalizationUtility::translate('compare_database.transfer.error', 'in2publish_core'),
LocalizationUtility::translate(
'LLL:EXT:in2publish_core/Resources/Private/Language/locallang_mod4.xlf:compare_database.transfer.error',
'in2publish_core'
),
AbstractMessage::ERROR,
);
$this->redirect('index');
Expand All @@ -283,16 +310,19 @@ public function transferAction(string $table, int $uid, string $expected): void
if (1 === $foreignResult) {
$this->addFlashMessage(
LocalizationUtility::translate(
'compare_database.transfer.updated_on_foreign',
'LLL:EXT:in2publish_core/Resources/Private/Language/locallang_mod4.xlf:compare_database.transfer.updated_on_foreign',
'in2publish_core',
[$table, $uid],
),
LocalizationUtility::translate('compare_database.transfer.success', 'in2publish_core'),
LocalizationUtility::translate(
'LLL:EXT:in2publish_core/Resources/Private/Language/locallang_mod4.xlf:compare_database.transfer.success',
'in2publish_core'
),
);
}
}

$this->redirect('index');
return $this->redirect('index');
}

protected function getAllNonExcludedTables(): array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

use Doctrine\DBAL\Result;
use In2code\In2publishCore\CommonInjection\LocalDatabaseInjection;
use TYPO3\CMS\Core\Authentication\CommandLineUserAuthentication;
use TYPO3\CMS\Core\DataHandling\DataHandler;
use TYPO3\CMS\Core\Utility\GeneralUtility;

Expand Down Expand Up @@ -142,11 +143,29 @@ protected function resolveRecordsToPages(RecordCollection $recordCollection): vo

protected function clearCachesForPages(RecordCollection $recordCollection): void
{
$dataHandler = GeneralUtility::makeInstance(DataHandler::class);
$dataHandler = $this->getDataHandler();
$dataHandler->start([], []);
$pages = $recordCollection->getPages();
foreach ($pages as $page) {
$dataHandler->clear_cacheCmd($page);
}
}

protected function getDataHandler(): DataHandler
{
/** @var DataHandler $dataHandler */
$dataHandler = GeneralUtility::makeInstance(DataHandler::class);
/** @var CommandLineUserAuthentication $user */
$user = $GLOBALS['BE_USER'];

if (!$user->user) {
$user->authenticate();
}

$dataHandler->BE_USER = $user;

/** @psalm-suppress InternalProperty */
$dataHandler->admin = true;
return $dataHandler;
}
}
3 changes: 3 additions & 0 deletions Configuration/Component/Core/Services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ services:
In2code\In2publishCore\Component\Core\Publisher\PublisherService:
public: true
shared: true

In2code\In2publishCore\Component\Core\Service\ResolverService:
public: true
8 changes: 5 additions & 3 deletions Resources/Public/JavaScript/BackendModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ define([
'TYPO3/CMS/In2publishCore/ConfirmationModal',
], function ($, DebounceEvent, Modal, LoadingOverlay, ConfirmationModal) {
var In2publishCoreModule = {
isPublishFilesModule: (document.querySelector('.module[data-module-name="file_In2publishCoreM3"]') !== null),
isPublishFilesModule: (document.querySelector('.module[data-module-name="in2publish_core_m3"]') !== null)
// TYPO3 v11
|| (document.querySelector('.module[data-module-name="file_In2publishCoreM3"]') !== null),
unchangedFilter: false,
changedFilter: false,
addedFilter: false,
Expand Down Expand Up @@ -167,12 +169,12 @@ define([
const searchForm = document.querySelector('.js-form-search');
if (searchForm) {
new DebounceEvent('input', function (event) {
const searchValue = event.target.value;
const searchValue = event.target.value.toLowerCase();
const elements = document.querySelectorAll('.in2publish-stagelisting__item');

(Array.from(elements)).forEach(function (item) {
if (searchValue !== '') {
const searchable = item.getAttribute('data-searchable');
const searchable = item.getAttribute('data-searchable').toLowerCase();

if (!searchable.includes(searchValue)) {
item.classList.add('d-none');
Expand Down
2 changes: 1 addition & 1 deletion ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
'title' => 'in2publish Core',
'description' => 'Content publishing extension to connect stage and production server',
'category' => 'plugin',
'version' => '12.5.4',
'version' => '12.5.5',
'state' => 'stable',
'clearCacheOnLoad' => true,
'author' => 'Alex Kellner, Oliver Eglseder, Thomas Scheibitz, Stefan Busemann',
Expand Down

0 comments on commit 24df45c

Please sign in to comment.