Skip to content

Commit

Permalink
Special handling for array parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
billtomczak committed Dec 7, 2023
1 parent 191755e commit 3b9caf5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/admin/library/MailingLists/AbstractClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,17 +182,26 @@ protected function getDocumentParam(int $documentId, string $key, $default = nul
{
if ($document = $this->getDocument($documentId)) {
$value = $document->get('params')->get($key);
if (is_array($value)) {
$value = array_filter($value);
}
}

if (empty($value)) {
// Try category lookup
if ($category = $this->getCategory($document->get('cate_id'))) {
$value = $category->get('params')->get($key);
if (is_array($value)) {
$value = array_filter($value);
}
}

if (empty($value)) {
// Try global
$value = static::getParams()->get($key);
if (is_array($value)) {
$value = array_filter($value);
}
}
}

Expand Down

0 comments on commit 3b9caf5

Please sign in to comment.