Files
oai-symfony/patches/fix_fs_media_gallery_album_assign.php
2026-07-14 12:50:36 +02:00

24 lines
793 B
PHP

<?php
declare(strict_types=1);
$file = dirname(__DIR__) . '/vendor/minifranske/fs-media-gallery/Classes/Controller/MediaAlbumController.php';
echo "Fix sending incorrect variable to Fluid template - 20260714\n\n";
if (file_exists($file)) {
$content = file_get_contents($file);
$oldLine = '\'mediaAlbum\' => $mediaAlbum,';
$newLine = '\'mediaAlbum\' => $mediaAlbumObject,';
if (strpos($content, $oldLine) !== false) {
$content = str_replace($oldLine, $newLine, $content);
file_put_contents($file, $content);
echo "\n-> [SUCCESS] Patch fs_media_gallery applied!\n\n";
} else {
echo "\n-> [INFO] Patch fs_media_gallery not applied or row not found.\n\n";
}
} else {
echo "\n-> [ERROR] Unable to find fs-media-gallery file.\n\n";
}