Skip to content

Commit

Permalink
Merge pull request #56 from kartolo/11.x
Browse files Browse the repository at this point in the history
11.x
  • Loading branch information
SSFGizmo authored Jun 26, 2023
2 parents 3c91a70 + ad426e4 commit fd34959
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions Classes/DirectMailUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,12 @@ protected static function addUserPass(string $url, array $params): string
public static function getFullUrlsForDirectMailRecord(array $row): array
{
// Finding the domain to use
if (!$_SERVER['HTTP_HOST']) {
// In CLI / Scheduler context, $_SERVER['HTTP_HOST'] can be null
$siteFinder = GeneralUtility::makeInstance(SiteFinder::class);
$site = $siteFinder->getSiteByPageId((int)$row['page']);
$_SERVER['HTTP_HOST'] = $site->getBase()->getHost();
}
$result = [
'baseUrl' => self::getTypolinkURL((int)$row['page']),
'htmlUrl' => '',
Expand Down
8 changes: 4 additions & 4 deletions Classes/Module/StatisticsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ protected function stats($row)
($html ? $id : '-'),
($html ? '-' : $id),
($html ? $urlCounter['html'][$id]['counter'] : $urlCounter['plain'][$origId]['counter']),
$urlCounter['html'][$id]['counter'],
$urlCounter['html'][$id]['counter'] ?? 0,
$urlCounter['plain'][$origId]['counter'] ?? 0,
$img,
];
Expand Down Expand Up @@ -1533,7 +1533,7 @@ public function getLinkLabel($url, $urlStr, $forceFetch = false, $linkedWord = '

$urlParts = parse_url($url);
if (!$forceFetch && (substr($url, 0, strlen($pathSite)) === $pathSite)) {
if ($urlParts['fragment'] && (substr($urlParts['fragment'], 0, 1) == 'c')) {
if ($urlParts['fragment'] ?? '' && (substr($urlParts['fragment'], 0, 1) == 'c')) {
// linking directly to a content
$elementUid = (int)(substr($urlParts['fragment'], 1));
$row = BackendUtility::getRecord('tt_content', $elementUid);
Expand All @@ -1559,11 +1559,11 @@ public function getLinkLabel($url, $urlStr, $forceFetch = false, $linkedWord = '
$contentTitle = $file['file'];
}
}
/**
/**
if ($this->params['showContentTitle'] == 1) {
$label = $contentTitle;
}
if ($this->params['prependContentTitle'] == 1) {
$label = $contentTitle . ' (' . $linkedWord . ')';
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"require": {
"typo3/cms-core": "^11.5",
"typo3/cms-dashboard": "^11.5",
"php": "^7.4 || ^8.0 || ^8.1",
"php": "^7.4 || ^8.0 || ^8.1",
"friendsoftypo3/tt-address": "^6.0 || ^7.0 || ^8.0",
"tedivm/fetch": "0.7.*"
},
Expand Down

0 comments on commit fd34959

Please sign in to comment.