Commit b21434d5 authored by Thomas Löffler's avatar Thomas Löffler
Browse files

Merge branch 'develop' into feature/build-search-suggest

parents c15a3bdc f51a609f
Pipeline #19992 failed with stages
in 16 seconds
#ddev-generated: Automatically generated ddev .gitignore.
# You can remove the above line if you want to edit and maintain this file yourself.
/.gitignore
/**/*.example
/.dbimageBuild
/.dbimageExtra
/.ddev-docker-*.yaml
/.*downloads
/.global_commands
/.homeadditions
/.sshimageBuild
/.webimageBuild
/.webimageExtra
/apache/apache-site.conf
/commands/.gitattributes
/commands/db/mysql
/commands/host/launch
/commands/web/live
/commands/web/xdebug
/config.*.y*ml
/db_snapshots
/import-db
/import.yaml
/nginx_full/nginx-site.conf
/sequelpro.spf
/**/README.*
......@@ -10,7 +10,8 @@ additional_hostnames: []
additional_fqdns: []
mariadb_version: "10.3"
mysql_version: ""
provider: default
nfs_mount_enabled: false
mutagen_enabled: false
hooks:
post-import-db:
- exec: ./vendor/bin/typo3cms database:updateschema
......@@ -23,11 +24,12 @@ webimage_extra_packages: [php7.4-ldap]
use_dns_when_possible: true
timezone: Europe/Berlin
composer_version: "2"
web_environment: []
# This config.yaml was created with ddev version v1.16.2
# webimage: drud/ddev-webserver:v1.16.2
# dbimage: drud/ddev-dbserver-mariadb-10.2:v1.16.0
# This config.yaml was created with ddev version v1.18.0-alpha4
# webimage: drud/ddev-webserver:20210729_cspitzlay_mysql_history
# dbimage: drud/ddev-dbserver-mariadb-10.3:20210729_cspitzlay_mysql_history
# dbaimage: phpmyadmin:5
# However we do not recommend explicitly wiring these images into the
# config.yaml as they may break future versions of ddev.
......@@ -42,7 +44,7 @@ composer_version: "2"
# docroot: <relative_path> # Relative path to the directory containing index.php.
# php_version: "7.3" # PHP version to use, "5.6", "7.0", "7.1", "7.2", "7.3", "7.4" "8.0"
# php_version: "7.4" # PHP version to use, "5.6", "7.0", "7.1", "7.2", "7.3", "7.4" "8.0"
# You can explicitly specify the webimage, dbimage, dbaimage lines but this
# is not recommended, as the images are often closely tied to ddev's' behavior,
......@@ -66,6 +68,11 @@ composer_version: "2"
# "ddev xdebug" to enable xdebug and "ddev xdebug off" to disable it work better,
# as leaving xdebug enabled all the time is a big performance hit.
# xhprof_enabled: false # Set to true to enable xhprof and "ddev start" or "ddev restart"
# Note that for most people the commands
# "ddev xhprof" to enable xhprof and "ddev xhprof off" to disable it work better,
# as leaving xhprof enabled all the time is a big performance hit.
# webserver_type: nginx-fpm # or apache-fpm
# timezone: Europe/Berlin
......@@ -74,7 +81,7 @@ composer_version: "2"
# see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
# For example Europe/Dublin or MST7MDT
# composer_version: "2"
# composer_version: ""
# if composer_version:"" it will use the current ddev default composer release.
# It can also be set to "1", to get most recent composer v1
# or "2" for most recent composer v2.
......@@ -113,6 +120,13 @@ composer_version: "2"
# Great performance improvement but requires host configuration first.
# See https://ddev.readthedocs.io/en/stable/users/performance/#using-nfs-to-mount-the-project-into-the-container
# mutagen_enabled: false
# Experimental performance improvement using mutagen asynchronous updates.
# See https://ddev.readthedocs.io/en/latest/users/performance/#using-mutagen
# fail_on_hook_fail: False
# Decide whether 'ddev start' should be interrupted by a failing hook
# host_https_port: "59002"
# The host port binding for https can be explicitly specified. It is
# dynamic unless otherwise specified.
......@@ -137,7 +151,7 @@ composer_version: "2"
# mailhog_https_port: "8026"
# The MailHog ports can be changed from the default 8025 and 8026
# webimage_extra_packages: [php7.3-tidy, php-bcmath]
# webimage_extra_packages: [php7.4-tidy, php-bcmath]
# Extra Debian packages that are needed in the webimage can be added here
# dbimage_extra_packages: [telnet,netcat]
......@@ -161,17 +175,20 @@ composer_version: "2"
# disable_settings_management: false
# If true, ddev will not create CMS-specific settings files like
# Drupal's settings.php/settings.ddev.php or TYPO3's AdditionalSettings.php
# Drupal's settings.php/settings.ddev.php or TYPO3's AdditionalConfiguration.php
# In this case the user must provide all such settings.
# You can inject environment variables into the web container with:
# web_environment:
# - SOMEENV=somevalue
# - SOMEOTHERENV=someothervalue
# no_project_mount: false
# (Experimental) If true, ddev will not mount the project into the web container;
# the user is responsible for mounting it manually or via a script.
# This is to enable experimentation with alternate file mounting strategies.
# For advanced users only!
# provider: default # Currently either "default" or "pantheon"
#
# Many ddev commands can be extended to run tasks before or after the
# ddev command is executed, for example "post-start", "post-import-db",
# "pre-composer", "post-composer"
......
# You can copy this Dockerfile.example to Dockerfile to add configuration
# or packages or anything else to your dbimage
ARG BASE_IMAGE=drud/ddev-dbserver:v1.6.0-10.1
FROM $BASE_IMAGE
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y telnet netcat
RUN echo "Built from drud/ddev-dbserver:v1.6.0-10.1" >/var/tmp/built-from.txt
# You can copy this Dockerfile.example to Dockerfile to add configuration
# or packages or anything else to your webimage
ARG BASE_IMAGE=drud/ddev-webserver:v1.8.0
FROM $BASE_IMAGE
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y php-yaml
RUN npm install --global gulp-cli
RUN ln -fs /usr/share/zoneinfo/Europe/Berlin /etc/localtime && dpkg-reconfigure --frontend noninteractive tzdata
{
"name": "t3o/typo3.org",
"description": "Website for TYPO3.org",
"authors": [
{
"name": "t3o team",
"email": "maintenance@typo3.org"
}
],
"support": {
"email": "maintenance@typo3.org",
"issues": "https://git-t3o.typo3.org/t3o/typo3.org/issues"
},
"repositories": [
{
"type": "path",
"url": "extensions/*"
},
{
"type": "vcs",
"url": "https://github.com/TYPO3GmbH/ext-hubspot-forms.git"
},
{
"type": "composer",
"url": "https://gitlab.typo3.org/api/v4/group/560/-/packages/composer/"
}
],
"require": {
"apache-solr-for-typo3/solr": "^11.0",
"brotkrueml/typo3-matomo-widgets": "^0.1.0",
"cweagans/composer-patches": "^1.6",
"derhansen/sf_event_mgt": "^5.0",
"doctrine/dbal": "~2.10.3",
"georgringer/news": "^8.0",
"gordalina/cachetool": "^4.0",
"reelworx/rx-shariff": "^13.0",
"spooner/deployer-information": "^1.1",
"t3g/hubspot-forms": "^1.1",
"t3o/randombanners": "^2.0",
"t3o/t3o_donation": "@dev",
"t3o/t3o_membership": "^3.0",
"t3o/t3o_planet": "@dev",
"t3o/t3olayout": "^5.0",
"t3o/t3org_layout": "@dev",
"t3o/typo3-roadmap": "@dev",
"typo3/cms-adminpanel": "^10.4",
"typo3/cms-dashboard": "^10.4",
"typo3/cms-linkvalidator": "^10.4",
"typo3/cms-redirects": "^10.4",
"typo3/cms-seo": "^10.4",
"typo3/cms-sys-note": "^10.4",
"typo3/cms-workspaces": "^10.4",
"yoast-seo-for-typo3/yoast_seo": "^7.0"
},
"config": {
"sort-packages": true,
"platform": {
"php": "7.4.4"
}
},
"extra": {
"typo3/cms": {
"root-dir": "private",
"web-dir": "public",
"cms-package-dir": "{$vendor-dir}/typo3/cms"
},
"enable-patching": true
},
"require-dev": {
"ichhabrecht/filefill": "^3.2"
}
"name": "t3o/typo3.org",
"description": "Website for TYPO3.org",
"authors": [
{
"name": "t3o team",
"email": "maintenance@typo3.org"
}
],
"support": {
"email": "maintenance@typo3.org",
"issues": "https://git-t3o.typo3.org/t3o/typo3.org/issues"
},
"repositories": [
{
"type": "path",
"url": "extensions/*"
},
{
"type": "vcs",
"url": "https://github.com/TYPO3GmbH/ext-hubspot-forms.git"
},
{
"type": "vcs",
"url": "https://gitlab.typo3.org/services/t3o-sites/typo3.org/randombanners.git"
},
{
"type": "composer",
"url": "https://gitlab.typo3.org/api/v4/group/560/-/packages/composer/"
}
],
"require": {
"apache-solr-for-typo3/solr": "^11.0",
"brotkrueml/typo3-matomo-widgets": "^0.1.0",
"cweagans/composer-patches": "^1.6",
"derhansen/sf_event_mgt": "^5.0",
"doctrine/dbal": "~2.10.3",
"georgringer/news": "^8.0",
"gordalina/cachetool": "^4.0",
"reelworx/rx-shariff": "^13.0",
"spooner/deployer-information": "^1.1",
"t3g/hubspot-forms": "^1.1",
"t3o/randombanners": "^2.1",
"t3o/t3o_donation": "@dev",
"t3o/t3o_membership": "^3.0",
"t3o/t3o_planet": "@dev",
"t3o/t3olayout": "^5.0",
"t3o/t3org_layout": "@dev",
"t3o/typo3-roadmap": "@dev",
"typo3/cms-adminpanel": "^10.4",
"typo3/cms-dashboard": "^10.4",
"typo3/cms-linkvalidator": "^10.4",
"typo3/cms-redirects": "^10.4",
"typo3/cms-seo": "^10.4",
"typo3/cms-sys-note": "^10.4",
"typo3/cms-workspaces": "^10.4",
"yoast-seo-for-typo3/yoast_seo": "^7.0"
},
"config": {
"sort-packages": true,
"platform": {
"php": "7.4.4"
}
},
"extra": {
"patches": {
"typo3/cms-core": {
"Add basic check for email before validation": "patches/email-validation.diff"
}
},
"typo3/cms": {
"root-dir": "private",
"web-dir": "public",
"cms-package-dir": "{$vendor-dir}/typo3/cms"
},
"enable-patching": true
},
"require-dev": {
"ichhabrecht/filefill": "^3.2"
}
}
This diff is collapsed.
......@@ -23,7 +23,7 @@
<td>
<f:if condition="{donation.url}">
<f:then>
<f:link.external uri="{donation.url}">{donation.name}</f:link.external>
<f:link.external uri="{donation.url}" rel="sponsored">{donation.name}</f:link.external>
</f:then>
<f:else>
{donation.name}
......
<?php
namespace T3o\T3orgLayout\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use T3o\T3orgLayout\Service\FetchMembersService;
use TYPO3\CMS\Core\Cache\CacheManager;
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Database\Query\QueryBuilder;
use TYPO3\CMS\Core\Database\Query\Restriction\HiddenRestriction;
use TYPO3\CMS\Core\Utility\GeneralUtility;
class FetchMembersCommand extends Command
{
protected ?QueryBuilder $queryBuilder = null;
protected ?FetchMembersService $fetchMembersService = null;
protected array $extConfig = [];
protected function initialize(InputInterface $input, OutputInterface $output)
{
$this->queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
->getQueryBuilderForTable('tx_t3omembership_domain_model_member');
$this->extConfig = GeneralUtility::makeInstance(ExtensionConfiguration::class)
->get('t3org_layout');
$this->fetchMembersService = GeneralUtility::makeInstance(FetchMembersService::class);
$this->fetchMembersService->token = $this->extConfig['BearerToken'];
}
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);
$io->title('Importing members via API from my.typo3.org');
if (!$this->extConfig['BearerToken']) {
$io->error('No token for authentication to API found!');
return 1;
}
$io->section('Fetching members...');
$members = $this->fetchMembersService->getMembers();
if ($members) {
$io->success('Found ' . count($members) . ' members');
} else {
$io->warning('No members found. Please check the settings and API.');
return 1;
}
$io->section('Importing members...');
$this->queryBuilder
->update('tx_t3omembership_domain_model_member')
->where(
$this->queryBuilder->expr()->neq('external_identifier', '""'),
$this->queryBuilder->expr()->eq('pid', (int)$this->extConfig['MemberStorage'])
)
->set('hidden', 1)
->execute();
$this->queryBuilder = $this->queryBuilder->getConnection()->createQueryBuilder();
foreach ($members as $member) {
$this->queryBuilder = $this->queryBuilder->getConnection()->createQueryBuilder();
$this->queryBuilder
->getRestrictions()
->removeByType(HiddenRestriction::class);
$existingMember = $this->queryBuilder
->select('uid')
->from('tx_t3omembership_domain_model_member')
->where(
$this->queryBuilder->expr()->eq(
'external_identifier',
$this->queryBuilder->quote($member['identifier'])
)
)
->execute()
->fetch();
$this->queryBuilder = $this->queryBuilder->getConnection()->createQueryBuilder();
if (!$existingMember) {
// Prepare member date for DB insert
$data = $member;
$data['external_identifier'] = $data['identifier'];
$data['url'] = $data['backlink'] ?? '';
$data['hidden'] = 0;
$data['pid'] = (int)$this->extConfig['MemberStorage'];
$data['tstamp'] = time();
$data['crdate'] = time();
$data['membership'] = $this->getMembershipId($data['membership']);
$data['email'] = $data['email'] ?? '';
unset($data['votingEmail']);
unset($data['identifier']);
unset($data['backlink']);
$this->queryBuilder
->insert('tx_t3omembership_domain_model_member')
->values($data)
->execute();
} else {
$this->queryBuilder
->update('tx_t3omembership_domain_model_member')
->where(
$this->queryBuilder->expr()->eq(
'uid',
$existingMember['uid']
)
)
->set('name', $member['name'])
->set('email', $member['email'] ?? '')
->set('url', $member['backlink'] ?? '')
->set('membership', $this->getMembershipId($member['membership']))
->set('hidden', 0)
->set('tstamp', time())
->execute();
}
$io->success('Imported member: ' . $member['name']);
}
$io->section('Flushing caches on page with UID 160');
// Flush caches on page ID 160
GeneralUtility::makeInstance(CacheManager::class)
->flushCachesInGroupByTags(
'pages',
['pageId_160']
);
$io->success('Finished.');
return 0;
}
private function getMembershipId(string $membership): int
{
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
->getQueryBuilderForTable('tx_t3omembership_domain_model_membership');
$membershipRecord = $queryBuilder
->select('uid')
->from('tx_t3omembership_domain_model_membership')
->where(
$queryBuilder->expr()->eq('external_identifier', $queryBuilder->quote($membership))
)
->execute()
->fetch();
return $membershipRecord['uid'] ?? 0;
}
}
<?php
namespace T3o\T3orgLayout\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use T3o\T3orgLayout\Service\FetchMembersService;
use TYPO3\CMS\Core\Cache\CacheManager;
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Database\Query\QueryBuilder;
use TYPO3\CMS\Core\Database\Query\Restriction\HiddenRestriction;
use TYPO3\CMS\Core\Utility\GeneralUtility;
class FetchPlatinumMembersCommand extends Command
{
protected ?QueryBuilder $queryBuilder = null;
protected ?FetchMembersService $fetchMembersService = null;
protected array $extConfig = [];
protected function initialize(InputInterface $input, OutputInterface $output)
{
$this->queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
->getQueryBuilderForTable('tx_randombanners_domain_model_banner');
$this->extConfig = GeneralUtility::makeInstance(ExtensionConfiguration::class)
->get('t3org_layout');
$this->fetchMembersService = GeneralUtility::makeInstance(FetchMembersService::class);
$this->fetchMembersService->token = $this->extConfig['BearerToken'];
}
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);
$io->title('Importing platinum members via API from my.typo3.org');
if (!$this->extConfig['BearerToken']) {
$io->error('No token for authentication to API found!');
return 1;
}
$io->section('Fetching members...');
$members = $this->fetchMembersService->getPlatinumMembers();
if ($members) {
$io->success('Found ' . count($members) . ' platinum members');
} else {
$io->warning('No members found. Please check the settings and API.');
return 1;
}
$io->section('Importing members...');
$this->queryBuilder
->update('tx_randombanners_domain_model_banner')
->where(
$this->queryBuilder->expr()->neq('external_identifier', '""')
)
->set('hidden', 1)
->execute();
$this->queryBuilder = $this->queryBuilder->getConnection()->createQueryBuilder();
$warnings = false;
foreach ($members as $member) {
$this->queryBuilder = $this->queryBuilder->getConnection()->createQueryBuilder();
$this->queryBuilder
->getRestrictions()
->removeByType(HiddenRestriction::class);
$existingMember = $this->queryBuilder
->select('uid')
->from('tx_randombanners_domain_model_banner')
->where(
$this->queryBuilder->expr()->eq(
'external_identifier',
$this->queryBuilder->quote($member['identifier'])
)
)
->execute()
->fetch();
$this->queryBuilder = $this->queryBuilder->getConnection()->createQueryBuilder();
if (!$existingMember) {
// Prepare member date for DB insert
$data = $member;
$data['external_logo'] = $data['logo'] ?? '';
$data['external_identifier'] = $data['identifier'];
$data['link'] = $data['backlink'] ?? '';
$data['hidden'] = 0;
$data['pid'] = (int)$this->extConfig['BannerStorage'];
$data['tstamp'] = time();
$data['crdate'] = time();
unset($data['logo']);
unset($data['identifier']);
unset($data['backlink']);
unset($data['membership']);
$this->queryBuilder
->insert('tx_randombanners_domain_model_banner')
->values($data)
->execute();
} else {
$this->queryBuilder
->update('tx_randombanners_domain_model_banner')
->where(
$this->queryBuilder->expr()->eq(
'uid',
$existingMember['uid']
)
)
->set('name', $member['name'])
->set('email', $member['email'] ?? '')
->set('external_logo', $member['logo'] ?? '')
->set('link', $member['backlink'] ?? '')
->set('hidden', 0)
->set('tstamp', time())
->execute();