- New extension fe_comment (Evomedien, framework-agnostic): floating page
feedback widget served from /api/fe-comment/widget.js, note pad in localStorage, submissions mailed via /api/fe-comment/submit with recipients from the extension configuration; classic sites get the script injected via AssetCollector when the jsonOutput setting is off. An enabled master switch serves the widget EMPTY when off (no 404, no console errors) and rejects submissions - the go-live kill switch, no front-end build change needed - URL swap finished: /_json prefix middleware, SPA fallback live with a dedicated root rule (REQUEST_FILENAME of / is a directory) and a query-string exception for the TYPO3 v14 install tool entry (?__typo3_install on the site root - the backend Settings/Environment modules depend on it); /api/ as a whole stays with TYPO3 - MailMessage::send() no longer exists in v14: fe_comment and the form EmailDelivery (latently broken since the core upgrade) now send through the Mailer service. Mail transport moved to SMTP against the local exim so delivery errors surface instead of bouncing into the blackhole - exim verifies the envelope sender, which therefore must be a routable existing address (transport config lives in the untracked settings.php) - Related-product card texts editable on the product record (table rebuilt with uid/pid, TCA + inline field, one-time migration script); shared RteCompare for the module badge and the CLI comparison - batch dry-run now reports 0 writes instead of flagging every richtext field - Workbook clarification cases executed: VisionIO-SD14, VisionSC-SD14 and both Diamond OG records imported (40 fields, live-verified); ArtioSign and ArtioView created hidden (uid 109/110) via create_artio_records.php - the product table has no sorting column; WallControl_10 mapping REVERTED and parked: the dry run revealed aetria-wallcontrol already carries its own agency workbook, which WallControl_10 would have overwritten. Manifest now 75 product / 24 family / 1 open
This commit is contained in:
1 parent
6db2234851
commit
f0b0694842
28 files changed
+1272
-54
No files matched your search
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Evomedien\FeComment\Middleware;
|
||||
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Psr\Http\Server\MiddlewareInterface;
|
||||
use Psr\Http\Server\RequestHandlerInterface;
|
||||
use TYPO3\CMS\Core\Http\Response;
|
||||
use TYPO3\CMS\Core\Http\Stream;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/**
|
||||
* Serves the widget assets under STABLE urls, independent of composer's
|
||||
* hashed _assets publishing:
|
||||
*
|
||||
* /api/fe-comment/widget.js
|
||||
* /api/fe-comment/widget.css
|
||||
*
|
||||
* One <script> tag is the whole integration - the JS injects its own CSS
|
||||
* link. Short client cache so editors see fixes quickly; the widget is a
|
||||
* review tool, not a high-traffic asset.
|
||||
*/
|
||||
final class WidgetAssetMiddleware implements MiddlewareInterface
|
||||
{
|
||||
private const FILES = [
|
||||
'/api/fe-comment/widget.js' => ['EXT:fe_comment/Resources/Public/JavaScript/fe-comment.js', 'application/javascript; charset=utf-8'],
|
||||
'/api/fe-comment/widget.css' => ['EXT:fe_comment/Resources/Public/Css/fe-comment.css', 'text/css; charset=utf-8'],
|
||||
];
|
||||
|
||||
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
|
||||
{
|
||||
$path = $request->getUri()->getPath();
|
||||
$file = self::FILES[$path] ?? null;
|
||||
if ($file === null) {
|
||||
return $handler->handle($request);
|
||||
}
|
||||
|
||||
// Kill switch: the go-live off state serves an EMPTY file instead of
|
||||
// a 404, so a front end still embedding the script tag stays silent -
|
||||
// no console errors, no build change needed.
|
||||
if (!GeneralUtility::makeInstance(\Evomedien\FeComment\Service\ExtensionSettings::class)->enabled()) {
|
||||
return (new Response())
|
||||
->withHeader('Content-Type', $file[1])
|
||||
->withHeader('Cache-Control', 'public, max-age=300')
|
||||
->withBody(GeneralUtility::makeInstance(\TYPO3\CMS\Core\Http\StreamFactory::class)
|
||||
->createStream('/* fe_comment is disabled (extension configuration) */'));
|
||||
}
|
||||
|
||||
$absolute = GeneralUtility::getFileAbsFileName($file[0]);
|
||||
if ($absolute === '' || !is_file($absolute)) {
|
||||
return (new Response())->withStatus(404);
|
||||
}
|
||||
|
||||
return (new Response())
|
||||
->withHeader('Content-Type', $file[1])
|
||||
->withHeader('Cache-Control', 'public, max-age=300')
|
||||
->withBody(new Stream($absolute, 'rb'));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user