diff --git a/public/index.php b/public/index.php index 3261f06..a709e3e 100644 --- a/public/index.php +++ b/public/index.php @@ -3,6 +3,7 @@ use DanielSiepmann\FediverseFeedWrappers\RequestHandler; use DanielSiepmann\FediverseFeedWrappers\WrapperRegistry; use DanielSiepmann\FediverseFeedWrappers\Wrapper\DanielSiepmannTypo3; +use DanielSiepmann\FediverseFeedWrappers\Wrapper\ForgeTypo3Issues; use DanielSiepmann\FediverseFeedWrappers\Wrapper\Frontpage; use DanielSiepmann\FediverseFeedWrappers\Wrapper\GitHubTypo3; @@ -12,6 +13,7 @@ require_once __DIR__ . '/../vendor/autoload.php'; new WrapperRegistry([ '' => Frontpage::class, 'GitHubTypo3' => GitHubTypo3::class, + 'ForgeTypo3Issues' => ForgeTypo3Issues::class, 'DanielSiepmannTypo3' => DanielSiepmannTypo3::class, ]) ))->handleRequest(); diff --git a/src/Wrapper/ForgeTypo3Issues.php b/src/Wrapper/ForgeTypo3Issues.php new file mode 100644 index 0000000..8009b38 --- /dev/null +++ b/src/Wrapper/ForgeTypo3Issues.php @@ -0,0 +1,61 @@ + + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ + +namespace DanielSiepmann\FediverseFeedWrappers\Wrapper; + +use DOMDocument; +use DanielSiepmann\FediverseFeedWrappers\WrapperInterface; + +class ForgeTypo3Issues implements WrapperInterface +{ + private string $url; + + public function __construct( + string $url = 'https://forge.typo3.org/projects/typo3cms-core/issues.atom?c%5B%5D=status&c%5B%5D=priority&c%5B%5D=subject&c%5B%5D=category&c%5B%5D=fixed_version&c%5B%5D=done_ratio&f%5B%5D=status_id&f%5B%5D=&group_by=tracker&key=bc42963d07fee8c6960da7b7224225009d493c99&op%5Bstatus_id%5D==&set_filter=1&sort=id:desc,priority&t%5B%5D=&utf8=%E2%9C%93&v%5Bstatus_id%5D%5B%5D=1' + ) { + $this->url = $url; + } + + public function contentType(): string + { + return 'application/atom+xml'; + } + + /** + * We don't want the full message within each feed item. + * + * Interested people can head over to the actual URL for full info. + */ + public function content(): string + { + $content = new DOMDocument(); + $content->loadXML(file_get_contents($this->url)); + + foreach ($content->getElementsByTagName('entry') as $entry) { + // Remove content (body in friendica), title will become body within friendica + $entry->getElementsByTagName('content')[0]->nodeValue = ''; + } + + return $content->saveXML(); + } +} diff --git a/tests/Unit/Wrapper/Assertions/ForgeTypo3Issues.atom b/tests/Unit/Wrapper/Assertions/ForgeTypo3Issues.atom new file mode 100644 index 0000000..a23a2bd --- /dev/null +++ b/tests/Unit/Wrapper/Assertions/ForgeTypo3Issues.atom @@ -0,0 +1,35 @@ + + + TYPO3 Core: Issues + + + http://forge.typo3.org/ + http://forge.typo3.org/themes/typo3_forge/favicon/favicon.png?1705866169 + 2024-05-23T12:05:09Z + + TYPO3 Forge + + +Redmine + + Bug #103885 (New): foreign_match_fields is ignored in flexforms in Typo3 12 + + http://forge.typo3.org/issues/103885 + 2024-05-23T12:05:09Z + + Georgi Mateev + + + + + Bug #103883 (New): View generated in LinkBrowserController missed PageTS configuration + + http://forge.typo3.org/issues/103883 + 2024-05-23T09:39:11Z + + Nicole Cordes + typo3@cordes.co + + + + diff --git a/tests/Unit/Wrapper/Fixtures/ForgeTypo3Issues.atom b/tests/Unit/Wrapper/Fixtures/ForgeTypo3Issues.atom new file mode 100644 index 0000000..1dfd450 --- /dev/null +++ b/tests/Unit/Wrapper/Fixtures/ForgeTypo3Issues.atom @@ -0,0 +1,160 @@ + + + TYPO3 Core: Issues + + + http://forge.typo3.org/ + http://forge.typo3.org/themes/typo3_forge/favicon/favicon.png?1705866169 + 2024-05-23T12:05:09Z + + TYPO3 Forge + + +Redmine + + Bug #103885 (New): foreign_match_fields is ignored in flexforms in Typo3 12 + + http://forge.typo3.org/issues/103885 + 2024-05-23T12:05:09Z + + Georgi Mateev + + +<p>The inline TCA type (also tested for the new file type) does not respect the configuration foreign_match_fields.fieldname when in Flexform context. Up to TYPO3 v11 it would respect it and store the value in the sys_file_reference table. After updating to TYPO3 v12 it does not respect it anymore and writes the name of the TCA Field instead.</p> + + + <p>Example:<br /><pre><code class="xml syntaxhl" data-language="xml"><span class="nt">&lt;settings.thumbnailImages&gt;</span> + <span class="nt">&lt;label&gt;</span>LLL:EXT:sg_vimeo/Resources/Private/Language/locallang.xlf:flexform.thumbnailImages + <span class="nt">&lt;/label&gt;</span> + <span class="nt">&lt;description&gt;</span> + LLL:EXT:sg_vimeo/Resources/Private/Language/locallang.xlf:flexform.thumbnailImages.description + <span class="nt">&lt;/description&gt;</span> + <span class="nt">&lt;config&gt;</span> + <span class="nt">&lt;type&gt;</span>inline<span class="nt">&lt;/type&gt;</span> + <span class="nt">&lt;foreign_table&gt;</span>sys_file_reference<span class="nt">&lt;/foreign_table&gt;</span> + <span class="nt">&lt;foreign_field&gt;</span>uid_foreign<span class="nt">&lt;/foreign_field&gt;</span> + <span class="nt">&lt;foreign_table_field&gt;</span>tablenames<span class="nt">&lt;/foreign_table_field&gt;</span> + <span class="nt">&lt;foreign_label&gt;</span>uid_local<span class="nt">&lt;/foreign_label&gt;</span> + <span class="nt">&lt;foreign_sortby&gt;</span>sorting_foreign<span class="nt">&lt;/foreign_sortby&gt;</span> + <span class="nt">&lt;foreign_selector&gt;</span>uid_local<span class="nt">&lt;/foreign_selector&gt;</span> + <span class="nt">&lt;foreign_selector_fieldTcaOverride</span> <span class="na">type=</span><span class="s">"array"</span><span class="nt">&gt;</span> + <span class="nt">&lt;config&gt;</span> + <span class="nt">&lt;appearance&gt;</span> + <span class="nt">&lt;elementBrowserType&gt;</span>file<span class="nt">&lt;/elementBrowserType&gt;</span> + <span class="nt">&lt;elementBrowserAllowed&gt;</span>jpg,png,svg,jpeg,gif,webp<span class="nt">&lt;/elementBrowserAllowed&gt;</span> + <span class="nt">&lt;/appearance&gt;</span> + <span class="nt">&lt;/config&gt;</span> + <span class="nt">&lt;/foreign_selector_fieldTcaOverride&gt;</span> + <span class="nt">&lt;foreign_match_fields</span> <span class="na">type=</span><span class="s">"array"</span><span class="nt">&gt;</span> + <span class="nt">&lt;fieldname&gt;</span>tx_sgvimeo_thumbnail_image<span class="nt">&lt;/fieldname&gt;</span> + <span class="nt">&lt;/foreign_match_fields&gt;</span> + <span class="nt">&lt;filter</span> <span class="na">type=</span><span class="s">"array"</span><span class="nt">&gt;</span> + <span class="nt">&lt;userFunc&gt;</span>TYPO3\CMS\Core\Resource\Filter\FileExtensionFilter-&gt;filterInlineChildren + <span class="nt">&lt;/userFunc&gt;</span> + <span class="nt">&lt;parameters&gt;</span> + <span class="nt">&lt;allowedFileExtensions&gt;</span>jpg,png,svg,jpeg,gif,webp<span class="nt">&lt;/allowedFileExtensions&gt;</span> + <span class="nt">&lt;disallowedFileExtensions&gt;&lt;/disallowedFileExtensions&gt;</span> + <span class="nt">&lt;/parameters&gt;</span> + <span class="nt">&lt;/filter&gt;</span> + <span class="nt">&lt;appearance</span> <span class="na">type=</span><span class="s">"array"</span><span class="nt">&gt;</span> + <span class="nt">&lt;useSortable&gt;</span>1<span class="nt">&lt;/useSortable&gt;</span> + <span class="nt">&lt;headerThumbnail&gt;</span> + <span class="nt">&lt;field&gt;</span>uid_local<span class="nt">&lt;/field&gt;</span> + <span class="nt">&lt;height&gt;</span>45m<span class="nt">&lt;/height&gt;</span> + <span class="nt">&lt;/headerThumbnail&gt;</span> + <span class="nt">&lt;enabledControls&gt;</span> + <span class="nt">&lt;info&gt;</span>1<span class="nt">&lt;/info&gt;</span> + <span class="nt">&lt;new&gt;</span>0<span class="nt">&lt;/new&gt;</span> + <span class="nt">&lt;dragdrop&gt;</span>1<span class="nt">&lt;/dragdrop&gt;</span> + <span class="nt">&lt;sort&gt;</span>1<span class="nt">&lt;/sort&gt;</span> + <span class="nt">&lt;hide&gt;</span>1<span class="nt">&lt;/hide&gt;</span> + <span class="nt">&lt;delete&gt;</span>1<span class="nt">&lt;/delete&gt;</span> + <span class="nt">&lt;/enabledControls&gt;</span> + <span class="nt">&lt;/appearance&gt;</span> + <span class="nt">&lt;overrideChildTca&gt;</span> + <span class="nt">&lt;columns</span> <span class="na">type=</span><span class="s">"array"</span><span class="nt">&gt;</span> + <span class="nt">&lt;uid_local</span> <span class="na">type=</span><span class="s">"array"</span><span class="nt">&gt;</span> + <span class="nt">&lt;config</span> <span class="na">type=</span><span class="s">"array"</span><span class="nt">&gt;</span> + <span class="nt">&lt;appearance</span> <span class="na">type=</span><span class="s">"array"</span><span class="nt">&gt;</span> + <span class="nt">&lt;elementBrowserType&gt;</span>file<span class="nt">&lt;/elementBrowserType&gt;</span> + <span class="nt">&lt;elementBrowserAllowed&gt;</span>jpg,png,svg,jpeg,gif<span class="nt">&lt;/elementBrowserAllowed&gt;</span> + <span class="nt">&lt;/appearance&gt;</span> + <span class="nt">&lt;/config&gt;</span> + <span class="nt">&lt;/uid_local&gt;</span> + <span class="nt">&lt;crop</span> <span class="na">type=</span><span class="s">"array"</span><span class="nt">&gt;</span> + <span class="nt">&lt;config</span> <span class="na">type=</span><span class="s">"array"</span><span class="nt">&gt;</span> + <span class="nt">&lt;cropVariants</span> <span class="na">type=</span><span class="s">"array"</span><span class="nt">&gt;</span> + <span class="nt">&lt;medium</span> <span class="na">type=</span><span class="s">"array"</span><span class="nt">&gt;</span> + <span class="nt">&lt;disabled&gt;</span>1<span class="nt">&lt;/disabled&gt;</span> + <span class="nt">&lt;/medium&gt;</span> + <span class="nt">&lt;small</span> <span class="na">type=</span><span class="s">"array"</span><span class="nt">&gt;</span> + <span class="nt">&lt;disabled&gt;</span>1<span class="nt">&lt;/disabled&gt;</span> + <span class="nt">&lt;/small&gt;</span> + <span class="nt">&lt;extrasmall</span> <span class="na">type=</span><span class="s">"array"</span><span class="nt">&gt;</span> + <span class="nt">&lt;disabled&gt;</span>1<span class="nt">&lt;/disabled&gt;</span> + <span class="nt">&lt;/extrasmall&gt;</span> + <span class="nt">&lt;/cropVariants&gt;</span> + <span class="nt">&lt;/config&gt;</span> + <span class="nt">&lt;/crop&gt;</span> + <span class="nt">&lt;/columns&gt;</span> + <span class="nt">&lt;types</span> <span class="na">type=</span><span class="s">"array"</span><span class="nt">&gt;</span> + <span class="nt">&lt;numIndex</span> <span class="na">index=</span><span class="s">"2"</span><span class="nt">&gt;</span> + <span class="nt">&lt;showitem&gt;</span> + --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette + <span class="nt">&lt;/showitem&gt;</span> + <span class="nt">&lt;/numIndex&gt;</span> + <span class="nt">&lt;/types&gt;</span> + <span class="nt">&lt;/overrideChildTca&gt;</span> + <span class="nt">&lt;/config&gt;</span> + <span class="nt">&lt;/settings.thumbnailImages&gt;</span> +</code></pre></p> + + + <p>Expected result in the database:<br />tx_sgvimeo_thumbnail_image</p> + + + <p>Actual result in the database:<br />settings.thumbnailImages</p> + + + <p>You can test this with our sgalinski/sg-vimeo extension in version 7.1.11 when trying to set a custom thumbnail image.</p> + + + <p>This looks like a bug in TYPO3 12 or an undocumented breaking change.</p> + + + Bug #103883 (New): View generated in LinkBrowserController missed PageTS configuration + + http://forge.typo3.org/issues/103883 + 2024-05-23T09:39:11Z + + Nicole Cordes + typo3@cordes.co + + +<p>Given:</p> + + + <p>- a package having following files:</p> + + + <p><strong>Configuration/page.tsconfig</strong> with content <em>templates.typo3/cms-backend.123 = EXT:foo/Resources/Private/TemplateOverrides</em> <br /><strong>Resources/Private/TemplateOverrides/Templates/LinkBrowser/Page.html</strong> with content <em>Foo</em><br /><strong>Configuration/PageTs/PageTs.typoscript</strong> with content <em>templates.typo3/cms-backend.123 ></em></p> + + + <p>The given PageTS is used on the root page (in page settings).</p> + + + <p>Expectation:</p> + + + <p>- LinkBrowser in Redirect record (pageUid = 0) shows "Foo" in the page browser as the overrides template is used<br />- any other LinkBrowser (in page context) shows default page tree in browser</p> + + + <p>Actual:</p> + + + <p>- the reset of the overrides template isn't triggered. "Foo" is always shown.</p> + + + <p>The view is rendered in typo3/cms-backend/Classes/View/BackendViewFactory.php:73 expecting an "id" parameter in the request. This parameter isn't available in a "wizard/link/browse" context as the page id is provided in P[pid]=161 parameter</p> + + diff --git a/tests/Unit/Wrapper/ForgeTypo3IssuesTest.php b/tests/Unit/Wrapper/ForgeTypo3IssuesTest.php new file mode 100644 index 0000000..8cd30c5 --- /dev/null +++ b/tests/Unit/Wrapper/ForgeTypo3IssuesTest.php @@ -0,0 +1,80 @@ + + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ + +namespace DanielSiepmann\FediverseFeedWrappers\Tests\Unit\Wrapper; + +use DanielSiepmann\FediverseFeedWrappers\WrapperInterface; +use DanielSiepmann\FediverseFeedWrappers\Wrapper\ForgeTypo3Issues; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\Test; +use PHPUnit\Framework\TestCase; + +#[CoversClass(ForgeTypo3Issues::class)] +final class ForgeTypo3IssuesTest extends TestCase +{ + #[Test] + public function canBeCreated(): void + { + $subject = new ForgeTypo3Issues(); + + self::assertInstanceOf( + ForgeTypo3Issues::class, + $subject + ); + } + + #[Test] + public function isInstanceOfWrapperInterface(): void + { + $subject = new ForgeTypo3Issues(); + + self::assertInstanceOf( + WrapperInterface::class, + $subject + ); + } + + #[Test] + public function returnsContentType(): void + { + $subject = new ForgeTypo3Issues(); + + self::assertSame( + 'application/atom+xml', + $subject->contentType() + ); + } + + #[Test] + public function returnsAdjustedFeed(): void + { + $subject = new ForgeTypo3Issues( + __DIR__ . '/Fixtures/ForgeTypo3Issues.atom' + ); + + self::assertStringEqualsFile( + __DIR__ . '/Assertions/ForgeTypo3Issues.atom', + $subject->content() + ); + } +}