Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 14f3efc

Browse files
authoredSep 21, 2024··
[BUGFIX] Fix Link to system extension docs in report button (#755)
1 parent 3955954 commit 14f3efc

File tree

6 files changed

+24
-9
lines changed

6 files changed

+24
-9
lines changed
 

‎packages/typo3-docs-theme/src/Twig/TwigExtension.php

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -398,9 +398,20 @@ public function enrichForgeLink(string $reportButton, RenderContext $renderConte
398398
}
399399
if (str_ends_with($reportButton, '/new')) {
400400
$reportButton .= '?issue[category_id]=1004&issue[subject]=';
401-
$description = $this->getIssueTitle($renderContext);
402-
$reportButton .= urlencode($description);
403401
$version = $this->typo3VersionService->getPreferredVersion();
402+
$extension = $this->themeSettings->getSettings('interlink_shortcode');
403+
if ($extension === 'changelog') {
404+
$extension = 'typo3/cms-core';
405+
}
406+
$description = $this->getIssueTitle(
407+
$renderContext,
408+
sprintf(
409+
'https://docs.typo3.org/c/%s/%s/en-us',
410+
$extension,
411+
$version,
412+
)
413+
);
414+
$reportButton .= urlencode($description);
404415
switch ($version) {
405416
case 'main':
406417
$reportButton .= '&issue[custom_field_values][4]=' . Typo3VersionMapping::getMajorVersionOfMain()->value;
@@ -423,9 +434,13 @@ public function enrichForgeLink(string $reportButton, RenderContext $renderConte
423434
* @param RenderContext $renderContext
424435
* @return string
425436
*/
426-
public function getIssueTitle(RenderContext $renderContext): string
437+
public function getIssueTitle(RenderContext $renderContext, ?string $docsPath = null): string
427438
{
428-
return 'Problem on ' . $this->themeSettings->getSettings('project_home') . '/' . $renderContext->getCurrentFileName() . '.html';
439+
return sprintf(
440+
'Problem on %s/%s.html',
441+
$docsPath ?? $this->themeSettings->getSettings('project_home'),
442+
$renderContext->getCurrentFileName()
443+
);
429444
}
430445

431446
/**

‎tests/Integration/tests-full/changelog/expected/Changelog/12.0/Breaking-87616-RemovedHookForAlteringPageLinks.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
<li class="breadcrumb-item"><a href="Index.html">12.0 Changes</a></li>
135135
<li aria-current="page" class="breadcrumb-item active">Breaking: #87616 - Removed hook for altering page links</li>
136136
</ol>
137-
<div class="breadcrumb-additions"> <a class="btn btn-sm btn-light" href="https://forge.typo3.org/projects/typo3cms-core/issues/new?issue[category_id]=1004&amp;issue[subject]=Problem+on+https%3A%2F%2Fextensions.typo3.org%2Fextension%2Fcore%2F%2FChangelog%2F12.0%2FBreaking-87616-RemovedHookForAlteringPageLinks.html&amp;issue[custom_field_values][4]=13" id="btnReportIssue" rel="nofollow noopener" target="_blank">
137+
<div class="breadcrumb-additions"> <a class="btn btn-sm btn-light" href="https://forge.typo3.org/projects/typo3cms-core/issues/new?issue[category_id]=1004&amp;issue[subject]=Problem+on+https%3A%2F%2Fdocs.typo3.org%2Fc%2Ftypo3%2Fcms-core%2Fmain%2Fen-us%2FChangelog%2F12.0%2FBreaking-87616-RemovedHookForAlteringPageLinks.html&amp;issue[custom_field_values][4]=13" id="btnReportIssue" rel="nofollow noopener" target="_blank">
138138
<span class="btn-icon"><i class="fas fa-bug"></i></span>
139139
<span class="btn-text">Report issue</span>
140140
</a>

‎tests/Integration/tests-full/changelog/expected/Changelog/12.0/Index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
<li class="breadcrumb-item"><a href="../../Changelog-12.html">ChangeLog v12</a></li>
135135
<li aria-current="page" class="breadcrumb-item active">12.0 Changes</li>
136136
</ol>
137-
<div class="breadcrumb-additions"> <a class="btn btn-sm btn-light" href="https://forge.typo3.org/projects/typo3cms-core/issues/new?issue[category_id]=1004&amp;issue[subject]=Problem+on+https%3A%2F%2Fextensions.typo3.org%2Fextension%2Fcore%2F%2FChangelog%2F12.0%2FIndex.html&amp;issue[custom_field_values][4]=13" id="btnReportIssue" rel="nofollow noopener" target="_blank">
137+
<div class="breadcrumb-additions"> <a class="btn btn-sm btn-light" href="https://forge.typo3.org/projects/typo3cms-core/issues/new?issue[category_id]=1004&amp;issue[subject]=Problem+on+https%3A%2F%2Fdocs.typo3.org%2Fc%2Ftypo3%2Fcms-core%2Fmain%2Fen-us%2FChangelog%2F12.0%2FIndex.html&amp;issue[custom_field_values][4]=13" id="btnReportIssue" rel="nofollow noopener" target="_blank">
138138
<span class="btn-icon"><i class="fas fa-bug"></i></span>
139139
<span class="btn-text">Report issue</span>
140140
</a>

‎tests/Integration/tests-full/changelog/expected/Index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
<ol class="breadcrumb">
131131
<li aria-current="page" class="breadcrumb-item active">TYPO3 Core</li>
132132
</ol>
133-
<div class="breadcrumb-additions"> <a class="btn btn-sm btn-light" href="https://forge.typo3.org/projects/typo3cms-core/issues/new?issue[category_id]=1004&amp;issue[subject]=Problem+on+https%3A%2F%2Fextensions.typo3.org%2Fextension%2Fcore%2F%2FIndex.html&amp;issue[custom_field_values][4]=13" id="btnReportIssue" rel="nofollow noopener" target="_blank">
133+
<div class="breadcrumb-additions"> <a class="btn btn-sm btn-light" href="https://forge.typo3.org/projects/typo3cms-core/issues/new?issue[category_id]=1004&amp;issue[subject]=Problem+on+https%3A%2F%2Fdocs.typo3.org%2Fc%2Ftypo3%2Fcms-core%2Fmain%2Fen-us%2FIndex.html&amp;issue[custom_field_values][4]=13" id="btnReportIssue" rel="nofollow noopener" target="_blank">
134134
<span class="btn-icon"><i class="fas fa-bug"></i></span>
135135
<span class="btn-text">Report issue</span>
136136
</a>

‎tests/Integration/tests-full/changelog/expected/Sitemap.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
<li class="breadcrumb-item"><a href="Index.html">TYPO3 Core</a></li>
133133
<li aria-current="page" class="breadcrumb-item active">Sitemap</li>
134134
</ol>
135-
<div class="breadcrumb-additions"> <a class="btn btn-sm btn-light" href="https://forge.typo3.org/projects/typo3cms-core/issues/new?issue[category_id]=1004&amp;issue[subject]=Problem+on+https%3A%2F%2Fextensions.typo3.org%2Fextension%2Fcore%2F%2FSitemap.html&amp;issue[custom_field_values][4]=13" id="btnReportIssue" rel="nofollow noopener" target="_blank">
135+
<div class="breadcrumb-additions"> <a class="btn btn-sm btn-light" href="https://forge.typo3.org/projects/typo3cms-core/issues/new?issue[category_id]=1004&amp;issue[subject]=Problem+on+https%3A%2F%2Fdocs.typo3.org%2Fc%2Ftypo3%2Fcms-core%2Fmain%2Fen-us%2FSitemap.html&amp;issue[custom_field_values][4]=13" id="btnReportIssue" rel="nofollow noopener" target="_blank">
136136
<span class="btn-icon"><i class="fas fa-bug"></i></span>
137137
<span class="btn-text">Report issue</span>
138138
</a>

‎tests/Integration/tests-full/report-issue/report-issue-forge/expected/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
<ol class="breadcrumb">
106106
<li aria-current="page" class="breadcrumb-item active">Document Title</li>
107107
</ol>
108-
<div class="breadcrumb-additions"> <a class="btn btn-sm btn-light" href="https://forge.typo3.org/projects/typo3cms-core/issues/new?issue[category_id]=1004&amp;issue[subject]=Problem+on+https%3A%2F%2Fdocs.typo3.org%2Fm%2Ftypo3%2Freference-coreapi%2F12.4%2Fen-us%2F%2Findex.html&amp;issue[custom_field_values][4]=12" id="btnReportIssue" rel="nofollow noopener" target="_blank">
108+
<div class="breadcrumb-additions"> <a class="btn btn-sm btn-light" href="https://forge.typo3.org/projects/typo3cms-core/issues/new?issue[category_id]=1004&amp;issue[subject]=Problem+on+https%3A%2F%2Fdocs.typo3.org%2Fc%2F%2F12.4%2Fen-us%2Findex.html&amp;issue[custom_field_values][4]=12" id="btnReportIssue" rel="nofollow noopener" target="_blank">
109109
<span class="btn-icon"><i class="fas fa-bug"></i></span>
110110
<span class="btn-text">Report issue</span>
111111
</a>

0 commit comments

Comments
 (0)
Please sign in to comment.