Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/10.0' into 10.x
Browse files Browse the repository at this point in the history
# Conflicts:
#	bundles/AdminBundle/Controller/Admin/WorkflowController.php
#	lib/Mail.php
  • Loading branch information
brusch committed Jul 27, 2021
2 parents 2d72d26 + 1ac9cf4 commit 43b0963
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
Expand Up @@ -200,6 +200,17 @@ function adminer_object()
new \AdminerDumpAlter,
];

// support for SSL (at least for PDO)
$driverOptions = \Pimcore\Db::get()->getParams()['driverOptions'] ?? [];
$ssl = [
'key' => $driverOptions[\PDO::MYSQL_ATTR_SSL_KEY] ?? null,
'cert' => $driverOptions[\PDO::MYSQL_ATTR_SSL_CERT] ?? null,
'ca' => $driverOptions[\PDO::MYSQL_ATTR_SSL_CA] ?? null,
];
if ($ssl['key'] !== null || $ssl['cert'] !== null || $ssl['ca'] !== null) {
$plugins[] = new \AdminerLoginSsl($ssl);
}

class AdminerPimcore extends \AdminerPlugin
{
/**
Expand Down
2 changes: 1 addition & 1 deletion bundles/AdminBundle/Controller/Admin/PortalController.php
Expand Up @@ -92,7 +92,7 @@ public function createDashboardAction(Request $request)
$dashboards = $this->dashboardHelper->getAllDashboards();
$key = trim($request->get('key'));

if ($dashboards[$key]) {
if (isset($dashboards[$key])) {
return $this->adminJson(['success' => false, 'message' => 'name_already_in_use']);
} elseif (!empty($key)) {
$this->dashboardHelper->saveDashboard($key);
Expand Down
Expand Up @@ -95,7 +95,7 @@ public function getIndexAttributesByFilterGroup($filterGroup)
{
$this->getAllFilterGroups();

return $this->filterGroups[$filterGroup] ? $this->filterGroups[$filterGroup] : [];
return $this->filterGroups[$filterGroup] ?? [];
}

public function getAllFilterGroups()
Expand Down
12 changes: 8 additions & 4 deletions lib/Mail.php
Expand Up @@ -487,6 +487,10 @@ public function send(MailerInterface $mailer = null)

$this->subject($this->getSubjectRendered());

// Remove the document property because it is no longer needed and makes it difficult
// to serialize the Mail object when using the Symfony Messenger component
$this->setDocument(null);

return $this->sendWithoutRendering($mailer);
}

Expand Down Expand Up @@ -557,7 +561,7 @@ public function sendWithoutRendering(MailerInterface $mailer = null)
$mailer->send($this);
} catch (\Exception $e) {
if (isset($failedRecipients[0])) {
$sendingFailedException = new \Exception($failedRecipients[0].' - '.$e->getMessage(), 0, $e);
$sendingFailedException = new \Exception($failedRecipients[0] . ' - ' . $e->getMessage(), 0, $e);
} else {
$sendingFailedException = new \Exception($e->getMessage(), 0, $e);
}
Expand Down Expand Up @@ -750,7 +754,7 @@ public function getBodyTextRendered()
}

/**
* @param Model\Document|int|string $document
* @param Model\Document|int|string|null $document
*
* @return $this
*
Expand All @@ -766,7 +770,7 @@ public function setDocument($document)
}
}

if ($document instanceof Model\Document\Email || $document instanceof Model\Document\Newsletter) {
if ($document instanceof Model\Document\Email || $document instanceof Model\Document\Newsletter || $document === null) {
$this->document = $document;
$this->setDocumentSettings();
} else {
Expand Down Expand Up @@ -939,7 +943,7 @@ private function formatAddress(...$addresses)
{
//old param style with string name as second param
if (isset($addresses[1]) && is_string($addresses[1])) {
return [ new Address($addresses[0], $addresses[1]) ];
return [new Address($addresses[0], $addresses[1])];
}

return $addresses;
Expand Down

0 comments on commit 43b0963

Please sign in to comment.