From 04f8c4bb3a67d750dc7e27e3b09d4699f9c9ad1e Mon Sep 17 00:00:00 2001
From: rtobias
Date: Thu, 11 Apr 2019 13:39:15 +0200
Subject: [PATCH 1/7] Upgrade to 9.5
---
Classes/Controller/AddressController.php | 4 ++--
Resources/Private/Templates/Address/Approve.html | 2 +-
Resources/Private/Templates/Address/Create.html | 4 ++--
Resources/Private/Templates/Address/Delete.html | 2 +-
Resources/Private/Templates/Address/Information.html | 2 +-
.../Templates/Address/MailNewsletterRegistration.html | 2 +-
.../Templates/Address/MailNewsletterRegistration.txt | 2 +-
ext_emconf.php | 6 +++---
8 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/Classes/Controller/AddressController.php b/Classes/Controller/AddressController.php
index 1979ab1..1e28e9e 100644
--- a/Classes/Controller/AddressController.php
+++ b/Classes/Controller/AddressController.php
@@ -235,7 +235,7 @@ protected function errorAction()
* action form only
*
* @param Address $newAddress
- * @dontvalidate $newAddress
+ * @ignorevalidation $newAddress
* @return void
*/
public function formOnlyAction(Address $newAddress = NULL)
@@ -247,7 +247,7 @@ public function formOnlyAction(Address $newAddress = NULL)
* action new
*
* @param Address $newAddress
- * @dontvalidate $newAddress
+ * @ignorevalidation $newAddress
* @return void
*/
public function newAction(Address $newAddress = NULL)
diff --git a/Resources/Private/Templates/Address/Approve.html b/Resources/Private/Templates/Address/Approve.html
index 632a82f..67530f0 100644
--- a/Resources/Private/Templates/Address/Approve.html
+++ b/Resources/Private/Templates/Address/Approve.html
@@ -17,7 +17,7 @@
-
+
diff --git a/Resources/Private/Templates/Address/Create.html b/Resources/Private/Templates/Address/Create.html
index 67e0659..91961b0 100644
--- a/Resources/Private/Templates/Address/Create.html
+++ b/Resources/Private/Templates/Address/Create.html
@@ -15,11 +15,11 @@
-
+
-
+
diff --git a/Resources/Private/Templates/Address/Delete.html b/Resources/Private/Templates/Address/Delete.html
index 3984f6a..daee160 100644
--- a/Resources/Private/Templates/Address/Delete.html
+++ b/Resources/Private/Templates/Address/Delete.html
@@ -17,7 +17,7 @@
-
+
diff --git a/Resources/Private/Templates/Address/Information.html b/Resources/Private/Templates/Address/Information.html
index e8f0b14..4b8769c 100644
--- a/Resources/Private/Templates/Address/Information.html
+++ b/Resources/Private/Templates/Address/Information.html
@@ -18,7 +18,7 @@
-
+
diff --git a/Resources/Private/Templates/Address/MailNewsletterRegistration.html b/Resources/Private/Templates/Address/MailNewsletterRegistration.html
index ea746f5..76cfd79 100644
--- a/Resources/Private/Templates/Address/MailNewsletterRegistration.html
+++ b/Resources/Private/Templates/Address/MailNewsletterRegistration.html
@@ -2,7 +2,7 @@
{f:translate(key:'mail.registration.greet')} {f:translate(key:'mail.gender.{address.gender}')} {address.firstName} {address.lastName}
- {f:translate(key:'mail.registration.text', htmlEscape:0)}
+ {f:translate(key:'mail.registration.text')}
{f:translate(key:'mail.registration.consentText')}
diff --git a/Resources/Private/Templates/Address/MailNewsletterRegistration.txt b/Resources/Private/Templates/Address/MailNewsletterRegistration.txt
index 9d62f80..15fd9ee 100644
--- a/Resources/Private/Templates/Address/MailNewsletterRegistration.txt
+++ b/Resources/Private/Templates/Address/MailNewsletterRegistration.txt
@@ -1,6 +1,6 @@
{f:translate(key:'mail.registration.greet')} {f:translate(key:'mail.gender.{address.gender}')} {address.firstName} {address.lastName}
-{f:translate(key:'mail.registration.text', htmlEscape:0)}
+{f:translate(key:'mail.registration.text')}
{f:translate(key:'mail.registration.consentText')}
{address.consent -> f:format.html(parseFuncTSPath:"plugin.tx_registeraddress.lib.parseFunc_PLAIN") -> f:format.stripTags()}
diff --git a/ext_emconf.php b/ext_emconf.php
index 3ec5632..ec6539c 100644
--- a/ext_emconf.php
+++ b/ext_emconf.php
@@ -27,11 +27,11 @@
'modify_tables' => '',
'clearCacheOnLoad' => 0,
'lockType' => '',
- 'version' => '2.0.1',
+ 'version' => '2.0.2',
'constraints' => array(
'depends' => array(
- 'typo3' => '6.2.0-8.7.99',
- 'tt_address' => '3.1.0-3.3.99',
+ 'typo3' => '6.2.0-9.5.99',
+ 'tt_address' => '3.1.0-4.1.99',
),
'conflicts' => array(
),
From 2541a20ce427155030aec56c0228097af25482e9 Mon Sep 17 00:00:00 2001
From: Johannes Pieper
Date: Sat, 13 Jun 2020 23:38:29 +0200
Subject: [PATCH 2/7] Update composer and emfconf-File
---
composer.json | 4 ++--
ext_emconf.php | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/composer.json b/composer.json
index 4b17ed7..eac8507 100644
--- a/composer.json
+++ b/composer.json
@@ -7,8 +7,8 @@
"issues": "https://github.com/lsascha/registeraddress/issues"
},
"require": {
- "typo3/cms-core": ">=6.2.0 <8.99.99",
- "friendsoftypo3/tt-address": ">=3.1.0 <3.2.99"
+ "typo3/cms-core": ">=9.5.0 <9.5.99",
+ "friendsoftypo3/tt-address": ">=4.0.0 <5.99.99"
},
"replace": {
"registeraddress": "self.version",
diff --git a/ext_emconf.php b/ext_emconf.php
index ec6539c..d1644d1 100644
--- a/ext_emconf.php
+++ b/ext_emconf.php
@@ -30,8 +30,8 @@
'version' => '2.0.2',
'constraints' => array(
'depends' => array(
- 'typo3' => '6.2.0-9.5.99',
- 'tt_address' => '3.1.0-4.1.99',
+ 'typo3' => '9.5.0-9.5.99',
+ 'tt_address' => '4.0.0-5.99.99',
),
'conflicts' => array(
),
From e77e56096ff118f46586aa49e1bdabb93edb4a76 Mon Sep 17 00:00:00 2001
From: Johannes Pieper
Date: Mon, 15 Jun 2020 12:39:15 +0200
Subject: [PATCH 3/7] Changing to new Structur
---
Configuration/TCA/Overrides/sys_template.php | 5 +
Configuration/TCA/Overrides/tt_content.php | 24 +++-
class.ext_update.php | 119 ++++++-------------
ext_tables.php | 29 -----
4 files changed, 64 insertions(+), 113 deletions(-)
create mode 100644 Configuration/TCA/Overrides/sys_template.php
delete mode 100644 ext_tables.php
diff --git a/Configuration/TCA/Overrides/sys_template.php b/Configuration/TCA/Overrides/sys_template.php
new file mode 100644
index 0000000..b99caaa
--- /dev/null
+++ b/Configuration/TCA/Overrides/sys_template.php
@@ -0,0 +1,5 @@
+= 8000000) {
- // If TYPO3 version is version 8 or higher
- $this->queryBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Database\ConnectionPool::class)->getQueryBuilderForTable('tt_address');
- $this->queryBuilder->getRestrictions()->removeAll()->add(GeneralUtility::makeInstance(DeletedRestriction::class));
- } else {
- // For TYPO3 Version 7 or lower
- $this->databaseConnection = $GLOBALS['TYPO3_DB'];
- }
+ $this->queryBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Database\ConnectionPool::class)->getQueryBuilderForTable('tt_address');
+ $this->queryBuilder->getRestrictions()->removeAll()->add(GeneralUtility::makeInstance(DeletedRestriction::class));
}
/**
@@ -47,30 +40,18 @@ public function __construct()
*
* @return bool
*/
- public function access() {
-
- $typo3Version = VersionNumberUtility::getNumericTypo3Version();
- if (VersionNumberUtility::convertVersionNumberToInteger($typo3Version) >= 8000000) {
- // If TYPO3 version is version 8 or higher
- $count = $this->queryBuilder->count('uid')
- ->from('tt_address')
- ->where(
- $this->queryBuilder->expr()->eq(
- 'registeraddresshash',
- $this->queryBuilder->createNamedParameter('')
- )
+ public function access()
+ {
+ $count = $this->queryBuilder->count('uid')
+ ->from('tt_address')
+ ->where(
+ $this->queryBuilder->expr()->eq(
+ 'registeraddresshash',
+ $this->queryBuilder->createNamedParameter('')
)
- ->execute()
- ->fetchColumn(0);
- } else {
- // For TYPO3 Version 7 or lower
- $count = $this->databaseConnection->exec_SELECTcountRows(
- 'uid',
- 'tt_address',
- 'registeraddresshash=""'
- );
- }
-
+ )
+ ->execute()
+ ->fetchColumn(0);
return ($count > 0);
}
@@ -80,66 +61,38 @@ public function access() {
* @return string
* @throws \Exception
*/
- public function main() {
-
+ public function main()
+ {
$content = '';
-
- $typo3Version = VersionNumberUtility::getNumericTypo3Version();
- if (VersionNumberUtility::convertVersionNumberToInteger($typo3Version) >= 8000000) {
- // If TYPO3 version is version 8 or higher
- $addresslist = $this->queryBuilder->select('uid', 'registeraddresshash', 'email')
- ->from('tt_address')
- ->where(
- $this->queryBuilder->expr()->eq(
- 'registeraddresshash',
- $this->queryBuilder->createNamedParameter('')
- )
+ $addresslist = $this->queryBuilder->select('uid', 'registeraddresshash', 'email')
+ ->from('tt_address')
+ ->where(
+ $this->queryBuilder->expr()->eq(
+ 'registeraddresshash',
+ $this->queryBuilder->createNamedParameter('')
)
- ->groupBy('uid')
- ->execute()->fetchAll();
+ )
+ ->groupBy('uid')
+ ->execute()->fetchAll();
- foreach ($addresslist as $fixAddress) {
- $content .= 'Updating tt_address uid:' . $fixAddress['uid'] . PHP_EOL;
+ foreach ($addresslist as $fixAddress) {
+ $content .= 'Updating tt_address uid:' . $fixAddress['uid'] . PHP_EOL;
- $rnd = microtime(true) . random_int(10000, 90000);
- $regHash = sha1($fixAddress['email'] . $rnd);
+ $rnd = microtime(true) . random_int(10000, 90000);
+ $regHash = sha1($fixAddress['email'] . $rnd);
- $this->queryBuilder->update('tt_address')
- ->set('registeraddresshash', $regHash)
- ->where(
- $this->queryBuilder->expr()->eq(
- 'uid',
- $this->queryBuilder->createNamedParameter($fixAddress['uid'])
- )
+ $this->queryBuilder->update('tt_address')
+ ->set('registeraddresshash', $regHash)
+ ->where(
+ $this->queryBuilder->expr()->eq(
+ 'uid',
+ $this->queryBuilder->createNamedParameter($fixAddress['uid'])
)
- ->execute();
- }
-
- } else {
- // For TYPO3 Version 7 or lower
- $addresslist = $this->databaseConnection->exec_SELECTquery(
- 'uid, registeraddresshash, email',
- 'tt_address',
- 'registeraddresshash=""'
- );
-
- foreach ($addresslist as $fixAddress) {
- $content .= 'Updating tt_address uid:' . $fixAddress['uid'] . PHP_EOL;
-
- $rnd = microtime(true) . random_int(10000, 90000);
- $regHash = sha1($fixAddress['email'] . $rnd);
-
- $this->databaseConnection->exec_UPDATEquery(
- 'tt_address',
- 'uid = "'.$fixAddress['uid'].'"',
- ['registeraddresshash' => $regHash]
- );
- }
+ )
+ ->execute();
}
$content .= 'tt_address entries updates finished.' . PHP_EOL;
-
return nl2br($content);
-
}
}
diff --git a/ext_tables.php b/ext_tables.php
deleted file mode 100644
index 84c7aa1..0000000
--- a/ext_tables.php
+++ /dev/null
@@ -1,29 +0,0 @@
-
Date: Fri, 11 Jan 2019 14:07:14 +0100
Subject: [PATCH 4/7] [BUGFIX] add language strings to generate links in HTML
emails
---
Resources/Private/Language/de.locallang.xlf | 15 +++++++++++++++
Resources/Private/Language/locallang.xlf | 15 +++++++++++++++
.../Address/MailNewsletterInformation.html | 4 ++--
.../Address/MailNewsletterRegistration.html | 6 +++---
.../Address/MailNewsletterUnsubscribe.html | 2 +-
5 files changed, 36 insertions(+), 6 deletions(-)
diff --git a/Resources/Private/Language/de.locallang.xlf b/Resources/Private/Language/de.locallang.xlf
index 4741ad4..c3bcd1d 100644
--- a/Resources/Private/Language/de.locallang.xlf
+++ b/Resources/Private/Language/de.locallang.xlf
@@ -133,9 +133,15 @@ Versuchen Sie es bitte erneut.
Bitte klicken Sie folgenden Link, um Ihre Daten zu bearbeiten:
+
+ Daten bearbeiten
+
Bitte klicken Sie folgenden Link, um Ihre Anmeldung zu löschen:
+
+ Anmeldung löschen
+
Newsletter-Information
@@ -149,12 +155,21 @@ Versuchen Sie es bitte erneut.
Bitte bestätigen Sie Ihre Anmeldung mit Klick auf folgenden Link:
+
+ Anmeldung bestätigen
+
Wenn Sie sich nicht für den Newsletter anmelden wollen, dann klicken Sie bitte folgenden Link:
+
+ Anmeldung widerrufen
+
Wenn Sie Ihre persönlichen Daten ändern wollen, dann klicken Sie bitte folgenden Link:
+
+ Daten bearbeiten
+
Newsletter-Registrierung
diff --git a/Resources/Private/Language/locallang.xlf b/Resources/Private/Language/locallang.xlf
index 9a5c99f..414fa13 100644
--- a/Resources/Private/Language/locallang.xlf
+++ b/Resources/Private/Language/locallang.xlf
@@ -133,9 +133,15 @@ Please try again.
Please click the following link to edit your data:
+
+ Edit data
+
Please click the following link to delete your registration:
+
+ Delete registration
+
Newsletter-Information
@@ -149,12 +155,21 @@ Please try again.
Please confirm your subscription by clicking on the following link:
+
+ Confirm subscription
+
If you do not want to subscribe for the newsletter, please click the following link:
+
+ Reject subscription
+
If you want to change your personal data, please click the following link:
+
+ Update data
+
Newsletter-Subscription
diff --git a/Resources/Private/Templates/Address/MailNewsletterInformation.html b/Resources/Private/Templates/Address/MailNewsletterInformation.html
index 031abc0..310415d 100644
--- a/Resources/Private/Templates/Address/MailNewsletterInformation.html
+++ b/Resources/Private/Templates/Address/MailNewsletterInformation.html
@@ -3,9 +3,9 @@
{f:translate(key:'mail.info.editLinkText')}
- {f:link.action(action: 'edit', arguments: {hash: hash}, controller: 'Address', extensionName: 'registeraddress', pluginName: 'registerform', noCacheHash: 1, pageUid: settings.pagewithform, absolute: 1) -> f:format.htmlentitiesDecode()}
+ {f:translate(key:'mail.info.editLink') -> f:link.action(action: 'edit', arguments: {hash: hash}, controller: 'Address', extensionName: 'registeraddress', pluginName: 'registerform', noCacheHash: 1, pageUid: settings.pagewithform, absolute: 1) -> f:format.htmlentitiesDecode()}
{f:translate(key:'mail.info.deleteLinkText')}
- {f:link.action(action: 'delete', arguments: {hash: hash}, controller: 'Address', extensionName: 'registeraddress', pluginName: 'registerform', noCacheHash: 1, pageUid: settings.pagewithform, absolute: 1) -> f:format.htmlentitiesDecode()}
+ {f:translate(key:'mail.info.deleteLink') -> f:link.action(action: 'delete', arguments: {hash: hash}, controller: 'Address', extensionName: 'registeraddress', pluginName: 'registerform', noCacheHash: 1, pageUid: settings.pagewithform, absolute: 1) -> f:format.htmlentitiesDecode()}
diff --git a/Resources/Private/Templates/Address/MailNewsletterRegistration.html b/Resources/Private/Templates/Address/MailNewsletterRegistration.html
index 76cfd79..d56b253 100644
--- a/Resources/Private/Templates/Address/MailNewsletterRegistration.html
+++ b/Resources/Private/Templates/Address/MailNewsletterRegistration.html
@@ -10,13 +10,13 @@
{f:translate(key:'mail.registration.approveLinkText')}
- {f:link.action(action: 'approve', arguments: {hash: hash}, controller: 'Address', extensionName: 'registeraddress', pluginName: 'registerform', noCacheHash: 1, pageUid: settings.pagewithform, absolute: 1) -> f:format.htmlentitiesDecode()}
+ {f:translate(key:'mail.registration.approveLink') -> f:link.action(action: 'approve', arguments: {hash: hash}, controller: 'Address', extensionName: 'registeraddress', pluginName: 'registerform', noCacheHash: 1, pageUid: settings.pagewithform, absolute: 1) -> f:format.htmlentitiesDecode()}
{f:translate(key:'mail.registration.deleteLinkText')}
- {f:link.action(action: 'delete', arguments: {hash: hash}, controller: 'Address', extensionName: 'registeraddress', pluginName: 'registerform', noCacheHash: 1, pageUid: settings.pagewithform, absolute: 1) -> f:format.htmlentitiesDecode()}
+ {f:translate(key:'mail.registration.deleteLink') -> f:link.action(action: 'delete', arguments: {hash: hash}, controller: 'Address', extensionName: 'registeraddress', pluginName: 'registerform', noCacheHash: 1, pageUid: settings.pagewithform, absolute: 1) -> f:format.htmlentitiesDecode()}
{f:translate(key:'mail.registration.editLinkText')}
- {f:link.action(action: 'edit', arguments: {hash: hash}, controller: 'Address', extensionName: 'registeraddress', pluginName: 'registerform', noCacheHash: 1, pageUid: settings.pagewithform, absolute: 1) -> f:format.htmlentitiesDecode()}
+ {f:translate(key:'mail.registration.editLink') -> f:link.action(action: 'edit', arguments: {hash: hash}, controller: 'Address', extensionName: 'registeraddress', pluginName: 'registerform', noCacheHash: 1, pageUid: settings.pagewithform, absolute: 1) -> f:format.htmlentitiesDecode()}
diff --git a/Resources/Private/Templates/Address/MailNewsletterUnsubscribe.html b/Resources/Private/Templates/Address/MailNewsletterUnsubscribe.html
index 8e98969..422a45c 100644
--- a/Resources/Private/Templates/Address/MailNewsletterUnsubscribe.html
+++ b/Resources/Private/Templates/Address/MailNewsletterUnsubscribe.html
@@ -3,5 +3,5 @@
{f:translate(key:'mail.info.deleteLinkText')}
- {f:link.action(action: 'delete', arguments: {hash: hash}, controller: 'Address', extensionName: 'registeraddress', pluginName: 'registerform', noCacheHash: 1, pageUid: settings.pagewithform, absolute: 1) -> f:format.htmlentitiesDecode()}
+ {f:translate(key:'mail.info.deleteLink') -> f:link.action(action: 'delete', arguments: {hash: hash}, controller: 'Address', extensionName: 'registeraddress', pluginName: 'registerform', noCacheHash: 1, pageUid: settings.pagewithform, absolute: 1) -> f:format.htmlentitiesDecode()}
From 29255b411d0227f8f31f4016415ce5272499a297 Mon Sep 17 00:00:00 2001
From: Thomas Scholze
Date: Mon, 14 Jan 2019 20:52:45 +0100
Subject: [PATCH 5/7] [BUGFIX] missing translations, improved salutation,
unnecessary source
---
Resources/Private/Language/de.locallang.xlf | 3 +--
Resources/Private/Language/locallang.xlf | 9 ++++-----
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/Resources/Private/Language/de.locallang.xlf b/Resources/Private/Language/de.locallang.xlf
index c3bcd1d..f07837d 100644
--- a/Resources/Private/Language/de.locallang.xlf
+++ b/Resources/Private/Language/de.locallang.xlf
@@ -214,8 +214,7 @@ Versuchen Sie es bitte erneut.
- You will apply the following consent.
- Sie stimmen den folgenden Bedingungen zu.
+ Sie stimmen den folgenden Bedingungen zu.