Skip to content

Commit

Permalink
Add support for TYPO3 11.5 and 12.4 only
Browse files Browse the repository at this point in the history
  • Loading branch information
hannesbochmann committed Jan 22, 2025
1 parent 7f9bda0 commit 7368aef
Show file tree
Hide file tree
Showing 111 changed files with 288 additions and 593 deletions.
70 changes: 58 additions & 12 deletions .github/workflows/phpci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: "PHP-CI"
on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: "30 6 * * 1"

Expand All @@ -21,6 +22,10 @@ jobs:
php-version:
- "7.4"
- "8.0"
- "8.1"
- "8.2"
- "8.3"
- "8.4"

steps:
-
Expand Down Expand Up @@ -53,8 +58,8 @@ jobs:
name: "Run Linter"
run: "composer lint:php"

php-qs:
name: "PHP QS"
php-cs:
name: "PHP CS"

runs-on: "ubuntu-latest"

Expand All @@ -64,10 +69,13 @@ jobs:
matrix:
command:
- "test:phpcs"
- "test:phpcompatibility"
php-version:
- "7.4"
- "8.0"
- "8.1"
- "8.2"
- "8.3"
- "8.4"

steps:
-
Expand Down Expand Up @@ -100,6 +108,37 @@ jobs:
name: "Run command"
run: "composer ${{ matrix.command }}"

php-compatibility:
name: "PHP Compatibility"

runs-on: "ubuntu-latest"

needs: "php-lint"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"
- name: "Setup PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.4"
extensions: "${{ env.PHP_EXTENSIONS }}"
- name: "Validate composer.json and composer.lock"
run: "composer validate --strict"
- name: "Determine composer cache directory"
id: "determine-composer-cache-directory"
run: "echo \"::set-output name=directory::$(composer config cache-dir)\""
- name: "Cache dependencies installed with composer"
uses: "actions/[email protected]"
with:
path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
key: "php-8.4-composer-${{ hashFiles('composer.lock') }}"
restore-keys: "php-8.4-composer-"
- name: "Install composer dependencies"
run: "composer install --no-interaction --no-progress --no-suggest"
- name: "Run command"
run: "composer test:phpcompatibility"


php-unit:
name: "PHP Unit"
Expand All @@ -112,15 +151,24 @@ jobs:
fail-fast: false
matrix:
include:
-
typo3-version: "^10.4"
php-version: "7.4"
-
typo3-version: "^11.5"
- typo3-version: "^11.5"
php-version: "7.4"
-
typo3-version: "^11.5"
- typo3-version: "^11.5"
php-version: "8.0"
- typo3-version: "^11.5"
php-version: "8.1"
- typo3-version: "^11.5"
php-version: "8.2"
- typo3-version: "^11.5"
php-version: "8.3"
- typo3-version: "^12.4"
php-version: "8.1"
- typo3-version: "^12.4"
php-version: "8.2"
- typo3-version: "^12.4"
php-version: "8.3"
- typo3-version: "^12.4"
php-version: "8.4"

steps:
-
Expand Down Expand Up @@ -154,5 +202,3 @@ jobs:
-
name: "Run PHP unit tests"
run: "composer test:phpunit"


9 changes: 9 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@
'@Symfony' => true,
'phpdoc_align' => false,
'no_superfluous_phpdoc_tags' => false,
'trailing_comma_in_multiline' => [
'after_heredoc' => true,
// no support for "arguments" and "parameters" as we need support for PHP 7.4
'elements' => [
'array_destructuring',
'arrays',
'match',
],
],
])
->setLineEnding("\n")
;
2 changes: 1 addition & 1 deletion Resources/Private/Templates/formonly.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
###FORM###
<!-- ###DATA### END-->
</body>
</html>
</html>
1 change: 1 addition & 0 deletions action/class.tx_mkforms_action_FormBase.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @author Michael Wagner
*
Expand Down
4 changes: 2 additions & 2 deletions action/redirect/class.tx_mkforms_action_redirect_Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public function _doTheMagic($aRendered, $sForm)
if (false !== ($mPage = $this->_navConf('/pageid'))) {
$mPage = $this->callRunneable($mPage);
$sUrl = $this->getForm()->getCObj()->typoLink_URL(['parameter' => $mPage]);
if (!Sys25\RnBase\Utility\T3General::isFirstPartOfStr($sUrl, 'http://') && '' !== trim($GLOBALS['TSFE']->baseUrl)) {
$sUrl = tx_mkforms_util_Div::removeEndingSlash($GLOBALS['TSFE']->baseUrl).'/'.$sUrl;
if (!Sys25\RnBase\Utility\T3General::isFirstPartOfStr($sUrl, 'http://') && '' !== trim($GLOBALS['TSFE']->config['config']['baseUrl'] ?? '')) {
$sUrl = tx_mkforms_util_Div::removeEndingSlash($GLOBALS['TSFE']->config['config']['baseUrl']).'/'.$sUrl;
}
} else {
$sUrl = $this->_navConf('/url');
Expand Down
19 changes: 10 additions & 9 deletions api/class.maindatahandler.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?php

use TYPO3\CMS\Core\Site\SiteFinder;
use TYPO3\CMS\Core\Utility\GeneralUtility;

class formidable_maindatahandler extends formidable_mainobject
{
public $entryId;
Expand Down Expand Up @@ -660,15 +663,13 @@ public function getT3Languages()
if (false === $this->aT3Languages) {
$this->aT3Languages = [];

$databaseConnection = Sys25\RnBase\Database\Connection::getInstance();
$rows = $databaseConnection->doSelect(
'*',
'sys_language',
['where' => '1=1'.$databaseConnection->enableFields('sys_language')]
);

foreach ($rows as $aRs) {
$this->aT3Languages[$aRs['uid']] = $aRs;
$sites = GeneralUtility::makeInstance(SiteFinder::class)->getAllSites();
foreach ($sites as $site) {
foreach ($site->getAllLanguages() as $languageId => $language) {
if (!isset($this->aT3Languages[$languageId])) {
$this->aT3Languages[$languageId] = (array) $language;
}
}
}
}

Expand Down
28 changes: 2 additions & 26 deletions api/class.tx_ameosformidable.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/***************************************************************
* Copyright notice
*
Expand Down Expand Up @@ -619,11 +620,7 @@ public function init(&$oParent, $mXml, $iForcedEntryId = false, $configurations
/* @var \TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication $frontendUser */
$frontendUser = $GLOBALS['TSFE']->fe_user ?? null;
if ($frontendUser) {
if (Sys25\RnBase\Utility\TYPO3::isTYPO115OrHigher()) {
$sessionId = $frontendUser->getSession()->getIdentifier();
} else {
$sessionId = $frontendUser->id;
}
$sessionId = $frontendUser->getSession()->getIdentifier();
}
$this->setSessionId($sessionId ?? 0);

Expand Down Expand Up @@ -4709,27 +4706,6 @@ public function getPreviousAjaxParams()
return false;
}

public function div_autoLogin($iUserId)
{
if ('FE' === tx_mkforms_util_Div::getEnvExecMode()) {
$users = Sys25\RnBase\Database\Connection::getInstance()->doSelect(
'*',
'fe_users',
['where' => 'uid=\''.$iUserId.'\'']
);

if ($users[0]) {
$GLOBALS['TSFE']->fe_user->createUserSession($users[0]);
$GLOBALS['TSFE']->fe_user->loginSessionStarted = true;
$GLOBALS['TSFE']->fe_user->user = $GLOBALS['TSFE']->fe_user->fetchUserSession();

return true;
}
}

return false;
}

public function wrapImplode($sWrap, $aData, $sGlue = '')
{
$aRes = [];
Expand Down
81 changes: 0 additions & 81 deletions api/class.tx_ameosformidable_pi.php

This file was deleted.

Loading

0 comments on commit 7368aef

Please sign in to comment.