Align product records with sitemap V2; product family model; CLI workbook import

- vitec:migrate-product-structure: exact V2 titles, Milestone typo fix (incl.
  slug), QTX100 stray VSN category removed, Aligo record moved to its own
  category with slug /product/aligo, new Aligo Workstation record takes over
  /product/aligo-workstation
- product families (sitemap column K) are ordinary content pages now:
  vitec:remove-family-records deletes the interim landing records again,
  reset_subproduct_flags.php clears the misused subproduct flag (the list
  renderer has always excluded subproduct=1)
- vitec:import-product-workbook: non-interactive counterpart of the module
  import (same reader, mapping and DataHandler path); Arqa imported, Aligo
  re-applied with the corrected capabilities markup
- ProductXlsxReader: new :copy cell selector (Body Copy with CTA fallback)
  absorbs the agency's column drift; default teaser mapping uses it
- ProductListJsonRenderer: selected categories now match their whole subtree,
  results ordered by category tree position, sheet order within a category
- read-only diagnostics: check_product_structure.php, check_productlist_ces.php
This commit is contained in:
2026-09-04 12:59:17 +02:00
parent 7833e1b668
commit 5499ca54af
12 changed files with 1186 additions and 121 deletions

View File

@@ -0,0 +1,49 @@
<?php
declare(strict_types=1);
/**
* One-shot: clear the subproduct flag on ALL product records.
*
* The flag was set on every classic product on 2026-09-04 while K-level
* entries still existed as records. Same-day model change: families are
* content pages, the record table holds only classic products - and the
* product list renderer has always EXCLUDED subproduct=1 (its original,
* editorial meaning), which emptied every product list on /products.
* Before 2026-09-04 no record carried the flag, so 0 across the board
* restores the original state.
*
* Usage: php migrations/reset_subproduct_flags.php
*/
$root = null;
$dir = __DIR__;
for ($i = 0; $i < 5; $i++) {
if (is_file($dir . '/config/system/settings.php')) {
$root = $dir;
break;
}
$dir = dirname($dir);
}
if ($root === null) {
exit("Could not locate project root above " . __DIR__ . "\n");
}
$settings = require $root . '/config/system/settings.php';
$db = $settings['DB']['Connections']['Default'];
$pdo = new PDO(
sprintf('mysql:host=%s;port=%s;dbname=%s;charset=utf8mb4', $db['host'] ?? 'localhost', $db['port'] ?? 3306, $db['dbname'] ?? ''),
$db['user'] ?? '',
$db['password'] ?? '',
[PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]
);
$count = (int)$pdo->query(
"SELECT COUNT(*) FROM tx_vitec_domain_model_product WHERE deleted = 0 AND subproduct = 1"
)->fetchColumn();
echo "Records with subproduct=1: " . $count . "\n";
$stmt = $pdo->prepare("UPDATE tx_vitec_domain_model_product SET subproduct = 0, tstamp = ? WHERE deleted = 0 AND subproduct = 1");
$stmt->execute([time()]);
echo "Cleared " . $stmt->rowCount() . " flag(s). Flush the cache: vendor/bin/typo3 cache:flush\n";