Commit 510a2845 authored by Wolf-Peter Utz's avatar Wolf-Peter Utz Committed by Felix Herrmann
Browse files

Task/be functionality fix extension scanner errors

parent 60d25b73
<?php
namespace T3o\Election;
class Constants
......@@ -6,4 +7,6 @@ class Constants
public const EXTENSION_KEY = 'election';
public const EXTENSION_NAME = 'Election';
public const VENDOR = 'T3o';
}
......@@ -41,7 +41,7 @@ abstract class AbstractProtectedBeController extends AbstractBeController
{
$this->clearCacheOnError();
$message = "";
foreach ($this->arguments->getValidationResults()->getFlattenedErrors() as $propertyPath => $errors) {
foreach ($this->arguments->validate()->getFlattenedErrors() as $propertyPath => $errors) {
foreach ($errors as $error) {
$message .= PHP_EOL . 'Error for ' . $propertyPath . ': ' . $error->render();
}
......@@ -60,9 +60,13 @@ abstract class AbstractProtectedBeController extends AbstractBeController
if ($referringRequest !== null) {
$originalRequest = clone $this->request;
$this->request->setOriginalRequest($originalRequest);
$this->request->setOriginalRequestMappingResults($this->arguments->getValidationResults());
$this->forward($referringRequest->getControllerActionName(), $referringRequest->getControllerName(),
$referringRequest->getControllerExtensionName(), $referringRequest->getArguments());
$this->request->setOriginalRequestMappingResults($this->arguments->validate());
$this->forward(
$referringRequest->getControllerActionName(),
$referringRequest->getControllerName(),
$referringRequest->getControllerExtensionName(),
$referringRequest->getArguments()
);
}
$message = 'An error occurred while trying to call ' . get_class($this) . '->' . $this->actionMethodName . '().' . PHP_EOL;
......
......@@ -62,7 +62,7 @@ class Configuration extends AbstractEntity
/**
* @var bool
*/
protected $debug = false;
protected $inTestMode = false;
/**
* @var string
......@@ -184,17 +184,17 @@ class Configuration extends AbstractEntity
/**
* @return boolean
*/
public function isDebug()
public function isInTestMode()
{
return $this->debug;
return $this->inTestMode;
}
/**
* @param boolean $debug
* @param boolean $inTestMode
*/
public function setDebug($debug)
public function setInTestMode($inTestMode)
{
$this->debug = $debug;
$this->inTestMode = $inTestMode;
}
/**
......@@ -233,7 +233,7 @@ class Configuration extends AbstractEntity
$clone->setNumberOfMails($this->getNumberOfMails());
$clone->setFromEmail($this->getFromEmail());
$clone->setFromName($this->getFromName());
$clone->setDebug($this->isDebug());
$clone->setInTestMode($this->isInTestMode());
$clone->setTestEmail($this->getTestEmail());
return $clone;
}
......
......@@ -165,15 +165,13 @@ class ElectionCircular extends AbstractEntity
0
);
$GLOBALS['TSFE']->config = ['config' => []];
$GLOBALS['TSFE']->initFEuser();
$GLOBALS['TSFE']->fetch_the_id();
$GLOBALS['TSFE']->initTemplate();
}
/** @var UriBuilder $uriBuilder */
$uriBuilder = $objectManager->get(UriBuilder::class);
$uriBuilder->setTargetPageUid($configuration->getPluginPid());
$uriBuilder->setCreateAbsoluteUri(true);
$uriBuilder->setUseCacheHash(false);
$uriBuilder->uriFor(
FeElectionController::ACTION_VOTE,
[
......
......@@ -81,7 +81,7 @@ class ElectionInvitationService
$mail->setSubject($electionCircular->getSubject());
$mail->setFrom([$configuration->getFromEmail() => $configuration->getFromName()]);
if ($configuration->isDebug()) {
if ($configuration->isInTestMode()) {
$mail->setTo([$configuration->getTestEmail() => $elector->getFullName()]);
} else {
$mail->setTo([$elector->getEmail() => $elector->getFullName()]);
......
......@@ -54,7 +54,7 @@ class MailUtility
$electionInvitationRepository->persistAll();
if ($configuration->isDebug()) {
if ($configuration->isInTestMode()) {
$mail->setTo([$configuration->getTestEmail() => $elector->getFullName()]);
} else {
$mail->setTo([$elector->getEmail() => $elector->getFullName()]);
......
<?php
declare(strict_types=1);
defined('TYPO3_MODE') || die();
return [
\T3o\Election\Domain\Model\Configuration::class => [
'tableName' => 'tx_election_domain_model_configuration',
'properties' => [
'inTestMode' => [
'fieldName' => 'debug'
],
],
],
];
......@@ -6,7 +6,7 @@
</f:translate>
</label>
<div class="form-control-wrap" style="max-width: 480px">
<f:form.checkbox id="tx_election_configuration_debug" property="debug" value="true"/>
<f:form.checkbox id="tx_election_configuration_debug" property="isInTestMode" value="true"/>
</div>
</div>
</fieldset>
<?php
$EM_CONF[$_EXTKEY] = [
$EM_CONF[\T3o\Election\Constants::EXTENSION_KEY] = [
'title' => 'Election',
'description' => 'voting / polling tool',
'category' => 'fe',
......
temp.abstractEntity.mapping.columns {
creation_date.mapOnProperty = creationDate
creation_user.mapOnProperty = creationUser
}
temp.abstractPerson.mapping.columns {
first_name.mapOnProperty = firstName
middle_name.mapOnProperty = middleName
last_name.mapOnProperty = lastName
gender.mapOnProperty = gender
email.mapOnProperty = email
}
config.tx_extbase.persistence.classes {
T3o\Election\Domain\Model\Configuration < temp.abstractEntity
T3o\Election\Domain\Model\Configuration {
mapping {
tableName = tx_election_domain_model_configuration
columns {
administration_group.mapOnProperty = administrationGroup
election_manager_group.mapOnProperty = electionManagerGroup
poll_manager_group.mapOnProperty = pollManagerGroup
plugin_pid.mapOnProperty = pluginPid
number_of_mails.mapOnProperty = numberOfMails
from_email.mapOnProperty = fromEmail
from_name.mapOnProperty = fromName
debug.mapOnProperty = debug
test_email.mapOnProperty = testEmail
}
}
}
T3o\Election\Domain\Model\Elector < temp.abstractPerson
T3o\Election\Domain\Model\Elector {
mapping {
tableName = tx_election_domain_model_elector
columns {
electorates {
mapOnProperty = electorates
config {
type = select
MM = tx_election_domain_model_electorate_elector_mm
foreign_table = tx_election_domain_model_electorate
MM_opposite_field = electors
}
}
election_invitations {
mapOnProperty = electionInvitations
config {
type = inline
foreign_table = tx_election_domain_model_electioninvitation
foreign_field = elector
}
}
}
}
}
T3o\Election\Domain\Model\ElectorImport < temp.abstractPerson
T3o\Election\Domain\Model\ElectorImport {
mapping {
tableName = tx_election_domain_model_electorimport
columns {
electorate {
mapOnProperty = electorate
config {
type = select
foreign_table = tx_election_domain_model_electorate
}
}
}
}
}
T3o\Election\Domain\Model\Nominee < temp.abstractPerson
T3o\Election\Domain\Model\Nominee {
mapping {
tableName = tx_election_domain_model_nominee
columns {
url.mapOnProperty = url
image.mapOnProperty = image
comment.mapOnProperty = comment
public.mapOnProperty = public
elections {
mapOnProperty = elections
config {
type = select
MM = tx_election_domain_model_election_nominee_mm
foreign_table = tx_election_domain_model_nominee
MM_opposite_field = nominees
}
}
}
}
}
T3o\Election\Domain\Model\Election < temp.abstractEntity
T3o\Election\Domain\Model\Election {
mapping {
tableName = tx_election_domain_model_election
columns {
title.mapOnProperty = title
description.mapOnProperty = description
start_date.mapOnProperty = startDate
end_date.mapOnProperty = endDate
number_of_votes.mapOnProperty = numberOfVotes
electorate {
mapOnProperty = electorate
config {
type = select
foreign_table = tx_election_domain_model_electorate
}
}
nominees {
mapOnProperty = nominees
config {
type = select
MM = tx_election_domain_model_election_nominee_mm
foreign_table = tx_election_domain_model_nominee
}
}
election_votes {
mapOnProperty = electionVotes
config {
type = inline
foreign_table = tx_election_domain_model_electionvote
foreign_field = election
}
}
}
}
}
T3o\Election\Domain\Model\Electorate < temp.abstractEntity
T3o\Election\Domain\Model\Electorate {
mapping {
tableName = tx_election_domain_model_electorate
columns {
title.mapOnProperty = title
electors {
mapOnProperty = electors
config {
type = select
MM = tx_election_domain_model_electorate_elector_mm
foreign_table = tx_election_domain_model_elector
}
}
}
}
}
T3o\Election\Domain\Model\ElectionCircular < temp.abstractEntity
T3o\Election\Domain\Model\ElectionCircular {
mapping {
tableName = tx_election_domain_model_electioncircular
columns {
subject.mapOnProperty = subject
body.mapOnProperty = body
election {
mapOnProperty = election
config {
type = select
foreign_table = tx_election_domain_model_election
}
}
}
}
}
T3o\Election\Domain\Model\ElectionInvitation < temp.abstractEntity
T3o\Election\Domain\Model\ElectionInvitation {
mapping {
tableName = tx_election_domain_model_electioninvitation
columns {
secret.mapOnProperty = secret
success.mapOnProperty = success
voted.mapOnProperty = voted
election_circular {
mapOnProperty = electionCircular
config {
type = select
foreign_table = tx_election_domain_model_electioncircular
}
}
elector {
mapOnProperty = elector
config {
type = select
foreign_table = tx_election_domain_model_elector
}
}
}
}
}
T3o\Election\Domain\Model\ElectionVote < temp.abstractEntity
T3o\Election\Domain\Model\ElectionVote {
mapping {
tableName = tx_election_domain_model_electionvote
columns {
elector {
mapOnProperty = elector
config {
type = select
foreign_table = tx_election_domain_model_elector
}
}
election {
mapOnProperty = election
config {
type = select
foreign_table = tx_election_domain_model_election
}
}
nominee {
mapOnProperty = nominee
config {
type = select
foreign_table = tx_election_domain_model_nominee
}
}
}
}
}
}
plugin {
tx_election {
features {
......@@ -238,4 +12,4 @@ page {
includeJSFooter {
election = EXT:election/Resources/Public/JavaScript/election.js
}
}
\ No newline at end of file
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment