SEO record links; story markets repair; story page titles
Kev's keyword CSV and TYPO3 hold the same solutions under slightly
different names, so the structure check filed them as missing/extra.
Matching is now slug -> normalized title -> record alias, using the
per-model alias store the import tabs got on 2026-08-18
(tx_vitec_import_mapping.record_aliases, key = lowercased CSV name).
One link therefore serves the import union list, the structure check
and vitec:create-markets (same service - linked rows are no longer
proposed as new records).
- every "Missing in TYPO3" row carries a select of all records the
direct match did not claim; "Save record links" persists per model
- alias-matched rows show under "Both" with a "linked" badge and the
same select; option 0 removes the link
- SeoResearchService::recordsCheck() additionally returns `linkable`
(the select options) and flags alias matches with via=link
- new backend POST route seo_aliases
Success stories: --markets-only repair mode
- /success-stories emitted empty `markets` for all 48 stories - a data
problem (code and TCA untouched since 17.08.); read-only diagnosis
script migrations/check_usecase_markets.php added
- vitec:import-success-stories --markets-only re-derives each story's
industries from the export exactly like the full import and rewrites
ONLY the markets MM relation of the existing record via DataHandler;
nothing else is touched, no usecase created or deleted, unresolved
stories keep their current relations
- decision: industries are translated onto the nine main markets of
the current taxonomy (INDUSTRY_TO_MARKET) instead of recreating the
seven deleted industry markets; the repair mode never creates
market records (root cause: those industry markets were deleted
after the 07.08. taxonomy import, orphaning all story relations)
- ensureMarkets() gained a $create flag for reuse by the full import
Story detail pages: real page title
- every story page answered with the generic page title "Story"; same
defect and same fix as the product pages on 21.08.: new
UsecasePageTitleProvider (singleton), registered as vitecUsecase in
config.pageTitleProviders, fed from UsecaseShowJsonRenderer with
seo_title falling back to title
Requires on the server:
vendor/bin/typo3 cache:flush
This commit is contained in:
1 parent
d846ba2007
commit
7442d10e68
9 files changed
+378
-9
No files matched your search
@@ -173,6 +173,47 @@ final class ImportController
|
||||
return new RedirectResponse((string)$this->uriBuilder->buildUriFromRoute('web_vitecimport.seo'), 303);
|
||||
}
|
||||
|
||||
/**
|
||||
* Persist hand-made record links from the SEO structure check. Shares the
|
||||
* per-model alias store with the import tabs (MappingRepository), so a
|
||||
* link made in either place serves both - and vitec:create-markets stops
|
||||
* proposing linked rows as new records. Key convention is the import
|
||||
* tab's: lowercased, trimmed CSV name. uid 0 removes a link.
|
||||
*/
|
||||
public function seoAliasesAction(ServerRequestInterface $request): ResponseInterface
|
||||
{
|
||||
$body = (array)$request->getParsedBody();
|
||||
$modelKey = (string)($body['model'] ?? '');
|
||||
if ($this->registry->has($modelKey)) {
|
||||
$aliases = $this->mappingRepository->load($modelKey)['aliases'] ?? [];
|
||||
$names = is_array($body['aliaskey'] ?? null) ? $body['aliaskey'] : [];
|
||||
$selected = is_array($body['alias'] ?? null) ? $body['alias'] : [];
|
||||
$changed = 0;
|
||||
foreach ($selected as $index => $selectedUid) {
|
||||
$key = mb_strtolower(trim((string)($names[$index] ?? '')));
|
||||
if ($key === '') {
|
||||
continue;
|
||||
}
|
||||
$uid = (int)$selectedUid;
|
||||
$current = (int)($aliases[$key] ?? 0);
|
||||
if ($uid > 0 && $uid !== $current) {
|
||||
$aliases[$key] = $uid;
|
||||
$changed++;
|
||||
} elseif ($uid === 0 && $current > 0) {
|
||||
unset($aliases[$key]);
|
||||
$changed++;
|
||||
}
|
||||
}
|
||||
$this->mappingRepository->saveAliases($modelKey, $aliases);
|
||||
$this->flash(
|
||||
sprintf('%d record link(s) changed for %s.', $changed, $modelKey),
|
||||
'Record links saved',
|
||||
true
|
||||
);
|
||||
}
|
||||
return new RedirectResponse((string)$this->uriBuilder->buildUriFromRoute('web_vitecimport.seo'), 303);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------ rendering
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user