Skip to content

Commit 03fedda

Browse files
committed
[BUGFIX] Respect typo3-core-preferred setting on interlinks
1 parent c74dbb7 commit 03fedda

File tree

12 files changed

+62
-2
lines changed

12 files changed

+62
-2
lines changed

packages/typo3-docs-theme/src/DependencyInjection/Typo3DocsThemeExtension.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public function load(array $configs, ContainerBuilder $container): void
5858
'project_contact' => $this->getConfigValue($configs, 'project_contact', ''),
5959
'project_repository' => $this->getConfigValue($configs, 'project_repository', ''),
6060
'project_issues' => $this->getConfigValue($configs, 'project_issues', ''),
61+
'typo3_core_preferred' => $this->getConfigValue($configs, 'typo3_core_preferred', ''),
6162
],
6263
],
6364
);

packages/typo3-docs-theme/src/Inventory/Typo3InventoryRepository.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,11 @@ private function resolveVersion(string $versionName): string
9393
{
9494
$version = trim($versionName, 'v');
9595
if (preg_match(self::VERSION_MINOR_REGEX, $version, $matches)) {
96-
$version = $matches[1];
96+
return $matches[1];
97+
}
98+
$mappedVersion = Typo3VersionMapping::tryFrom($version);
99+
if ($mappedVersion !== null) {
100+
return $mappedVersion->getVersion();
97101
}
98102
return $version;
99103
}

tests/Integration/tests/typo3_core_preferred/input/skip

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!-- content start -->
2+
<section class="section" id="document-title">
3+
<h1>Document Title<a class="headerlink" href="#document-title" data-bs-toggle="modal" data-bs-target="#linkReferenceModal" title="Reference this headline"></a></h1>
4+
5+
<p>See <a href="https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/WritingReST/Reference/Content/Links.html#how-to-document-hyperlinks">Links &amp; cross referencing</a> for information about how to use cross-references.</p>
6+
<p>Missing knowledge can be acquired by working through the TYPO3
7+
documentation, for example the <a href="https://docs.typo3.org/m/typo3/tutorial-getting-started/11.5/en-us/Index.html">Getting Started Tutorial</a>.</p>
8+
</section>
9+
10+
<!-- content end -->
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<guides
3+
xmlns="https://www.phpdoc.org/guides"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="https://www.phpdoc.org/guides vendor/phpdocumentor/guides-cli/resources/schema/guides.xsd"
6+
>
7+
<extension class="\T3Docs\Typo3DocsTheme\DependencyInjection\Typo3DocsThemeExtension"
8+
typo3-core-preferred="11.5"
9+
/>
10+
</guides>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
==============
2+
Document Title
3+
==============
4+
5+
See :ref:`h2document:how-to-document-hyperlinks` for information about how to use cross-references.
6+
7+
Missing knowledge can be acquired by working through the TYPO3
8+
documentation, for example the :doc:`Getting Started Tutorial <t3start:Index>`.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!-- content start -->
2+
<section class="section" id="document-title">
3+
<h1>Document Title<a class="headerlink" href="#document-title" data-bs-toggle="modal" data-bs-target="#linkReferenceModal" title="Reference this headline"></a></h1>
4+
5+
<p>See <a href="https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/WritingReST/Reference/Content/Links.html#how-to-document-hyperlinks">Links &amp; cross referencing</a> for information about how to use cross-references.</p>
6+
<p>Missing knowledge can be acquired by working through the TYPO3
7+
documentation, for example the <a href="https://docs.typo3.org/m/typo3/tutorial-getting-started/12.4/en-us/Index.html">Getting Started Tutorial</a>.</p>
8+
</section>
9+
10+
<!-- content end -->
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<guides
3+
xmlns="https://www.phpdoc.org/guides"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="https://www.phpdoc.org/guides vendor/phpdocumentor/guides-cli/resources/schema/guides.xsd"
6+
>
7+
<extension class="\T3Docs\Typo3DocsTheme\DependencyInjection\Typo3DocsThemeExtension"
8+
typo3-core-preferred="stable"
9+
/>
10+
</guides>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
==============
2+
Document Title
3+
==============
4+
5+
See :ref:`h2document:how-to-document-hyperlinks` for information about how to use cross-references.
6+
7+
Missing knowledge can be acquired by working through the TYPO3
8+
documentation, for example the :doc:`Getting Started Tutorial <t3start:Index>`.

0 commit comments

Comments
 (0)