Skip to content

Commit

Permalink
Show file tree
Hide file tree
Showing 253 changed files with 6,266 additions and 4,813 deletions.
4 changes: 2 additions & 2 deletions .phpstorm.meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
expectedArguments(
\In2code\In2publishCore\Component\RemoteProcedureCall\Envelope::__construct(),
0,
\In2code\In2publishCore\Component\RemoteProcedureCall\EnvelopeDispatcher::CMD_FOLDER_EXISTS,
\In2code\In2publishCore\Component\RemoteProcedureCall\EnvelopeDispatcher::CMD_GET_FOLDER_INFO,
\In2code\In2publishCore\Component\RemoteProcedureCall\EnvelopeDispatcher::CMD_GET_FILE_INFO,
\In2code\In2publishCore\Component\RemoteProcedureCall\EnvelopeDispatcher::CMD_FILE_EXISTS,
\In2code\In2publishCore\Component\RemoteProcedureCall\EnvelopeDispatcher::CMD_LIST_FOLDER_CONTENTS,
);
expectedArguments(
\In2code\In2publishCore\Component\ConfigContainer\Builder::addNode(),
Expand Down
1 change: 0 additions & 1 deletion .project/qa/phpmd.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
\In2code\In2publishCore\Utility\LogUtility,
\In2code\In2publishCore\Utility\StorageDriverExtractor,
\In2code\In2publishCore\Utility\UriUtility,
\Spyc
</value>
</property>
</properties>
Expand Down
1 change: 0 additions & 1 deletion .project/qa/psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
</InternalClass>
<UndefinedClass>
<errorLevel type="suppress">
<referencedClass name="Spyc"/>
<referencedClass name="CoStack\Logs\Controller\LogController"/>
</errorLevel>
</UndefinedClass>
Expand Down
117 changes: 117 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,122 @@
# In2publish Core Change Log

12.3.0:

- [DOCS] Update Changelog.md
- [META] Set the EM conf version number to 12.3.0
- [CLEANUP] Remove redundant PHP version constraints
- [DOCS] Add known issue about missing file links
- [DOCS] Remove section about Typoscript paths for templates in UPGRADING.md
- [DOCS] Add upgrading information for version 12.3.0
- [BUGFIX] Revert making file publisher reversible, they aren't!
- [TEST] Fix FileSystemPublisherTests
- [DOCS] Add instruction to quote asterisks in YAML for admins
- [BUGFIX] Show reasons why files are not publishable in the filelist
- [FEATURE] Adds another test return to get more specific testresult
- [BUGFIX] Increase max depth when dumping compatible TCA
- [FEATURE] Add LinkProcessor for TYPO3 v12
- [DOCS] Add admin changelog for YAML
- [BUGFIX] Add PreProcessor for TCA type file
- [BUGFIX] Corrects Loading of Middleware
- [DOCS] Adjust Feature List
- [BUGFIX] Restore the confirmation modal for file and folder publishing
- [BUGFIX] Ignore _file.publicUrl because it will always be different and is a computed property
- [BUGFIX] Fix ignoring ctrl.versioningWS
- [BUGFIX] Try to build absolute URLs to files for the preview buttons in the filelist module
- [BUGFIX] Redirect to the previous page after publishing, not the published page
- [BUGFIX] Restore context menu publishing for TYPO3 v12
- [BUGFIX] Validate the resolver cache
- [BUGFIX] Query sys_file_reference.table_local only in TYPO3 v11 as it was removed
- [BUGFIX] Use middleware to inject the loading overlay, split JS into specific modules
- [BUGFIX] Allow passing nodes directly to JS overlay and modal functions
- [BUGFIX] Use Connection::PARAM_STR_ARRAY instead of ArrayParameterType
- [REFACTOR] Extract $GLOBALS access to method
- [BUGFIX] Overwrite toString for PageTreeRootRecord to return the "sitename"
- [BUGFIX] Make PublisherService::publishRecordTree internal to force everyone to use the PublishingContext
- [BUGFIX] Correctly exclude folders and files for the recursiveState of Folder Records
- [BUGFIX] Resolve storage for StorageRootFolderRecords
- [BUGFIX] Access correct property to set the name attribute of folders
- [REFACTOR] Rename ResolverService::getResolversForTable to getResolversForClassification
- [BUGFIX] Introduce a special class for folders which are file storage roots and display the correct icon
- [FEATURE] Add some Injection Traits
- [BUGFIX] Close modals in TYPO3 v12 via new API
- [CLEANUP] Remove unused imports from FileController
- [BUGFIX] Fix multiple errors that occur when calling publishRecordTree more than once
- [FEATURE] Change Order of Modules in Publish Tools
- [CODESTYLE] Add Annotations for Exceptions
- [BUGFIX] Fix Database Compare Table View
- [CLEANUP] Remove Logs Integration
- [BUGFIX] Correct Caption of english Labels
- [FEATURE] Moved all Labels from Publish Tools Module to locallang_mod4.xlf
- [WIP] Changed all Templates of Publish Tools Module
- Revert "[DOC] Add documentation for changed ext_typoscript_template suffix"
- [BUGFIX] Fetch folder records with demand/resolver structure
- [DOC] Add documentation for changed ext_typoscript_template suffix
- [BUGFIX] Corrects styling of redirects module
- [BUGFIX] Add Padding at the Top of the module
- [BUGFIX] Jumpmenu Label is now rendered inline
- [BUGFIX] Change order of flashmessage container
- [REFACTOR] Remove outdated overlay div
- [REFACTOR] Replace version_compare calls with TYPO3_V11 constant
- [BUGFIX] Define (namespaced) constants for TYPO3 version for easier up/down-compatibility
- [BUGFIX] Tighten Colors between v11 & v12
- [BUGFIX] Show colors of badges in file module again
- [REFACTOR] Removes deprecated QueryBuilder methods
- [BUGFIX] Removes deprecated getSchemamanager call
- [BUGFIX] Removes check for directory typo3conf in TYPO3v12
- [REFACTOR] Use be.infobox viewhelper instead of own markup
- [REFACTOR] Simplifies the generation of an controller alias
- [FEATURE] Changes AdminButton to show primary styling correct
- [BUGFIX] Remove deprecations from RegistryController
- [BUGFIX] Remove deprecations from LetterBox
- [REFACTOR] Remove deprecations fomr LogsExporter
- [REFACTOR] Remove deprecated execute from GarbageCollectorTest
- [BUGFIX] Return ResponseInterface in publishFile and publishFolder action
- [REFACTOR] Removes unnecessary Event & Middleware
- [BUGFIX] Add correct hrefs to Buttons on Publish Tools
- [FEATURE] Register Publish Tools Menu in Modules.php
- [REFACTOR] Module Registration for Publish Tools Module refactored
- [REFACTOR] Changes backend module registration for m1, m3, m5
- [BUGFIX] Make the PageTsProvider a Singleton to unlock it globally
- [BUGFIX] Return the RedirectResponse in TYPO3 v12
- [BUGFIX] Rename ext_typoscript_setup suffix to typoscript
- [CLEANUP] Remove superfluous empty lines from ext_tables.php
- [BUGFIX] Enable autowiring of the dynamic PageTypeService
- [BUGFIX] Allow deserialization of TYPO3 v12 Site objects
- [BUGFIX] Create a TYPO3 version aware service to replace TcaService::getTablesAllowedOnPage
- [BUGFIX] Overwrite callActionMethod instead of initializeView to prevent version issues
- [BUGFIX] Implement TYPO3 version specific code to translate the label of the Publish Overview Module shortcut button
- [BUGFIX] Use withRequest to alter immutable request objects
- [BUGFIX] Use the objects view property instead of initializeView arguments
- [REFACTOR] Changes Icon from Tools Module to IconFactory
- [REFACTOR] Change compare of version
- [BUGFIX] Removes trailing slash in Module Configuration
- [REFACTOR] Changes backend module registration for m1, m3, m5
- [BUGFIX] Do not register the BackendRouteInitialization XCLASS in TYPO3 v12
- [BUGFIX] Replace deprecated EventManager::getListeners with getAllListeners
- [TASK] Remove deprecated TYPO3 constants
- [BUGFIX] Set correct narrowed return type hint for ConnectionFactory
- [BUGFIX] Handle constructor differences in PublishItemProvider between t3v11 and t3v12
- [FEATURE] Cache the TcaPreProcessing result
- [CLEANUP] Remove unused import/empty line
- [BUGFIX] Reduce resolver meta info to required keys class and args
- [BUGFIX] Replace Spyc with symfony/yaml
- [TASK] Update composer requirements
- [TASK] Add new branch aliases for develop branch
- [TASK] Allow PHP8.1 as requirement and remove outdated branch-aliases
- [BUGFIX] Inherit the base Exception from in2publish_core, not in2publish
- [BUGFIX] Show debugged queries in separate tab for each request
- [BUGFIX] Show the sum of query duration when debugging queries
- [BUGFIX] Sort grouped queries by amount of calls
- [REFACTOR] Use the CachedRuntimeCache instead of the custom implementation in ForeignSiteFinder
- [BUGFIX] Use runtime cache to prevent multiple cache hits
- [BUGFIX] Increment logged SQL queries statically
- [TESTS] Update unit tests for PublishFileInstructions
- [BUGFIX] Disable the function bar if publishing is not available
- [BUGFIX] Ignore table tx_in2publishcore_filepublisher_instruction by default
- [BUGFIX] Require table tx_in2publishcore_filepublisher_instruction instead of _task
- [DOCS] Update changelog

12.2.0:

- [META] Set the EM conf version number to 12.2.0
Expand Down
17 changes: 15 additions & 2 deletions Classes/Backend/Button/ModuleShortcutButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,36 @@
*/

use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Backend\Module\ExtbaseModule;
use TYPO3\CMS\Backend\Template\Components\Buttons\Action\ShortcutButton;
use TYPO3\CMS\Core\Routing\Route;
use TYPO3\CMS\Extbase\Mvc\ExtbaseRequestParameters;
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;

use function ucfirst;

use const In2code\In2publishCore\TYPO3_V11;

class ModuleShortcutButton extends ShortcutButton
{
public function setRequest(ServerRequestInterface $request): void
{
/** @var Route $route */
$route = $request->getAttribute('route');
$arguments = $request->getQueryParams();
$modConf = $route->getOption('moduleConfiguration');
$pageId = $request->getParsedBody()['id'] ?? $request->getQueryParams()['id'] ?? null;
$displayName = LocalizationUtility::translate($modConf['labels'] . ':mlang_tabs_tab');

if (TYPO3_V11) {
$modConf = $route->getOption('moduleConfiguration');
$displayName = LocalizationUtility::translate($modConf['labels'] . ':mlang_tabs_tab');
} else {
/**
* @noinspection PhpUndefinedClassInspection
* @var ExtbaseModule $module
*/
$module = $route->getOption('module');
$displayName = LocalizationUtility::translate($module->getTitle());
}

if (null !== $pageId) {
if (0 === $pageId) {
Expand Down
66 changes: 66 additions & 0 deletions Classes/Cache/CachedRuntimeCache.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?php

declare(strict_types=1);

namespace In2code\In2publishCore\Cache;

/*
* Copyright notice
*
* (c) 2023 in2code.de and the following authors:
* Oliver Eglseder <[email protected]>
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
*/

use Closure;
use In2code\In2publishCore\Cache\Exception\CacheableValueCanNotBeGeneratedException;
use In2code\In2publishCore\CommonInjection\CacheInjection;
use TYPO3\CMS\Core\SingletonInterface;

use function array_key_exists;

class CachedRuntimeCache implements SingletonInterface
{
use CacheInjection;

protected array $rtc = [];

/**
* @return mixed
*/
public function get(string $key, Closure $valueFactory, int $ttl = 86400)
{
if (!array_key_exists($key, $this->rtc)) {
if (!$this->cache->has($key)) {
try {
$value = $valueFactory();
$this->cache->set($key, $value, [], $ttl);
} catch (CacheableValueCanNotBeGeneratedException $exception) {
$value = $exception->getValue();
}
} else {
$value = $this->cache->get($key);
}
$this->rtc[$key] = $value;
}

return $this->rtc[$key];
}
}
21 changes: 21 additions & 0 deletions Classes/Cache/CachedRuntimeCacheInjection.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

declare(strict_types=1);

namespace In2code\In2publishCore\Cache;

/**
* @codeCoverageIgnore
*/
trait CachedRuntimeCacheInjection
{
protected CachedRuntimeCache $cachedRuntimeCache;

/**
* @noinspection PhpUnused
*/
public function injectCachedRuntimeCache(CachedRuntimeCache $cachedRuntimeCache): void
{
$this->cachedRuntimeCache = $cachedRuntimeCache;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

declare(strict_types=1);

namespace In2code\In2publishCore\Cache\Exception;

use In2code\In2publishCore\In2publishCoreException;
use Throwable;

class CacheableValueCanNotBeGeneratedException extends In2publishCoreException
{
/** @var mixed */
private $value;

/**
* @param mixed $value
*/
public function __construct($value, Throwable $previous = null)
{
$this->value = $value;
parent::__construct('', 1698857094, $previous);
}

/**
* @return mixed
*/
public function getValue()
{
return $this->value;
}
}
2 changes: 1 addition & 1 deletion Classes/Command/Foreign/Status/DbConfigTestCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$queryBuilder->createNamedParameter(ForeignDatabaseConfigTest::DB_CONFIG_TEST_TYPE),
);
$queryBuilder->select('*')->from('tx_in2code_in2publish_task')->where($predicates);
$result = $queryBuilder->execute()->fetchAllAssociative();
$result = $queryBuilder->executeQuery()->fetchAllAssociative();
$value = base64_encode(json_encode(array_column($result, 'configuration'), JSON_THROW_ON_ERROR));
$output->writeln('DB Config: ' . $value);
return Command::SUCCESS;
Expand Down
45 changes: 45 additions & 0 deletions Classes/CommonInjection/BackendUserAuthenticationInjection.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

declare(strict_types=1);

namespace In2code\In2publishCore\CommonInjection;

/*
* Copyright notice
*
* (c) 2023 in2code.de and the following authors:
* Daniel Hoffmann <[email protected]>
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
*/

use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;

trait BackendUserAuthenticationInjection
{
protected BackendUserAuthentication $backendUserAuthentication;

/**
* @noinspection PhpUnused
*/
public function injectBackendUserAuthentication(BackendUserAuthentication $backendUserAuthentication): void
{
$this->backendUserAuthentication = $backendUserAuthentication;
}
}
28 changes: 28 additions & 0 deletions Classes/CommonInjection/PageDoktypeRegistryInjection.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

/**
* Defined starting with TYPO3 v12
* @noinspection PhpUndefinedClassInspection
*/

declare(strict_types=1);

namespace In2code\In2publishCore\CommonInjection;

use TYPO3\CMS\Core\DataHandling\PageDoktypeRegistry;

/**
* @codeCoverageIgnore
*/
trait PageDoktypeRegistryInjection
{
protected PageDoktypeRegistry $pageDoktypeRegistry;

/**
* @noinspection PhpUnused
*/
public function injectPageDoktypeRegistry(PageDoktypeRegistry $pageDoktypeRegistry): void
{
$this->pageDoktypeRegistry = $pageDoktypeRegistry;
}
}
Loading

0 comments on commit 63064b0

Please sign in to comment.