Skip to content

Commit

Permalink
Merge branch 'release/38.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
einpraegsam committed Dec 8, 2024
2 parents 0bde49d + 3ddbcbb commit af3333f
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 36 deletions.
2 changes: 2 additions & 0 deletions .project/tests/typoscript-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ paths:
filePatterns:
- "*.tsconfig"
- "*.typoscript"
excludePatterns:
- "LuxLetter.typoscript"
sniffs:
- class: Indentation
parameters:
Expand Down
2 changes: 1 addition & 1 deletion Classes/Command/ExtbaseCommandTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

trait ExtbaseCommandTrait
{
public function initializeExtbase()
public function initializeExtbase(): void
{
if (EnvironmentUtility::isCli() && ConfigurationUtility::isTypo3Version12() === false) {
Bootstrap::initializeBackendAuthentication();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function trackByFrontenduserAuthentication(): void
if (FrontendUtility::isLoggedInFrontendUser()) {
$userRepository = GeneralUtility::makeInstance(FrontendUserRepository::class);
/** @var FrontendUser $user */
$user = $userRepository->findByUid((int)FrontendUtility::getPropertyFromLoggedInFrontendUser('uid'));
$user = $userRepository->findByUid((int)FrontendUtility::getPropertyFromLoggedInFrontendUser());

$this->setRelationToFrontendUser($user);
$this->addEmailAttribute($user);
Expand Down
28 changes: 2 additions & 26 deletions Classes/Utility/ConfigurationUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
use TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationExtensionNotConfiguredException;
use TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationPathDoesNotExistException;
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\VersionNumberUtility;

class ConfigurationUtility
{
Expand Down Expand Up @@ -240,32 +240,8 @@ protected static function getExtensionConfiguration(): array
return GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('lux');
}

/**
* Todo: Can be removed if TYPO3 12 support is dropped
*
* @return bool
*/
public static function isTypo3Version12(): bool
{
return self::isVersionToCompareSameOrHigherThenCurrentTypo3Version('12.4.99');
}

/**
* @param string $versionToCompare like "1.2.3"
* @return bool
*/
public static function isVersionToCompareSameOrHigherThenCurrentTypo3Version(string $versionToCompare): bool
{
return VersionNumberUtility::convertVersionNumberToInteger($versionToCompare) >= self::getCurrentTypo3Version();
}

/**
* Return current TYPO3 version as integer - e.g. 10003000 (10.3.0) or 9005014 (9.5.14)
*
* @return int
*/
protected static function getCurrentTypo3Version(): int
{
return VersionNumberUtility::convertVersionNumberToInteger(VersionNumberUtility::getNumericTypo3Version());
return (new Typo3Version())->getMajorVersion() === 12;
}
}
18 changes: 14 additions & 4 deletions Classes/Utility/FrontendUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

use In2code\Lux\Domain\Service\SiteService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication;
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;

class FrontendUtility
Expand Down Expand Up @@ -43,18 +44,27 @@ public static function getCurrentHostAndDomain(): string

public static function isLoggedInFrontendUser(): bool
{
return !empty(self::getTyposcriptFrontendController()->fe_user->user['uid']);
$authentication = self::getFrontendUserAuthentication();
if ($authentication !== null) {
return $authentication->user['uid'] > 0;
}
return false;
}

public static function getPropertyFromLoggedInFrontendUser($propertyName = 'uid'): string
{
$tsfe = self::getTyposcriptFrontendController();
if (!empty($tsfe->fe_user->user[$propertyName])) {
return (string)$tsfe->fe_user->user[$propertyName];
$authentication = self::getFrontendUserAuthentication();
if ($authentication !== null) {
return (string)($authentication->user[$propertyName] ?? '');
}
return '';
}

protected static function getFrontendUserAuthentication(): ?FrontendUserAuthentication
{
return $GLOBALS['TYPO3_REQUEST']?->getAttribute('frontend.user');
}

/**
* @return ?TypoScriptFrontendController
* @SuppressWarnings(PHPMD.Superglobals)
Expand Down
2 changes: 2 additions & 0 deletions Configuration/TSConfig/LuxLetter.typoscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Overrule LUXletter backend module view for receiver list
templates.in2code/luxletter.1732878717 = in2code/lux:/Resources/Private/
1 change: 1 addition & 0 deletions Documentation/Technical/Changelog/Index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

| Version | Date | State | TYPO3 | Description |
|------------|------------|----------|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 38.1.0 | 2024-12-08 | Task | `12.4 + 13.4` | Fix identification of logged in frontendusers, update some LUXletter related stuff (if LUX + LUXletter is in use), code cleanup |
| 38.0.1 | 2024-11-26 | Bugfix | `12.4 + 13.4` | Update TYPO3 dependencies in old ext_emconf file |
| 38.0.0 | 2024-11-25 | Feature | `12.4 + 13.4` | Add TYPO3 13 support, drop TYPO3 11 support, add darkmode styling, add LUX to TYPO3 livesearch in backend |
| 37.1.0 | 2024-10-30 | Task | `11.5 + 12.4` | Bing is used for preview images instead of google (if feature is turned on for leads and companies) |
Expand Down
4 changes: 2 additions & 2 deletions Resources/Private/Templates/Newsletter/Receiver.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<f:layout name="Backend"/>
<f:layout name="BackendLuxLetter"/>

This template is for EXT:luxletter to render a receiver analysis

Expand Down Expand Up @@ -80,7 +80,7 @@ <h4 class="alert-heading">
<f:translate key="LLL:EXT:lux/Resources/Private/Language/locallang_db.xlf:luxletter.module.newsletter.receiver.nousers.text">no users found that would receive a newsletter</f:translate>
</p>
<f:if condition="{filter.set}">
<f:link.action class="btn btn-default" style="color: black;" action="resetFilter" arguments="{redirectAction:view.action}">
<f:link.action class="btn btn-warning" style="color: black; text-decoration: none;" action="resetFilter" arguments="{redirectAction:view.action}">
Reset Filter
</f:link.action>
</f:if>
Expand Down
2 changes: 1 addition & 1 deletion ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'description' => 'Living User Experience - LUX - the Marketing Automation tool for TYPO3.
Turn your visitors to leads. Identification and profiling of your visitors within your TYPO3 website.',
'category' => 'plugin',
'version' => '38.0.1',
'version' => '38.1.0',
'author' => 'Alex Kellner',
'author_email' => '[email protected]',
'author_company' => 'in2code.de',
Expand Down
3 changes: 2 additions & 1 deletion ext_localconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ function () {
* Add page TSConfig
*/
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
'@import \'EXT:lux/Configuration/TSConfig/Lux.typoscript\''
'@import \'EXT:lux/Configuration/TSConfig/Lux.typoscript\'' . PHP_EOL .
'@import \'EXT:lux/Configuration/TSConfig/LuxLetter.typoscript\''
);

/**
Expand Down

0 comments on commit af3333f

Please sign in to comment.