-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'item-showcase-to-media-embed' into develop
- Loading branch information
Showing
10 changed files
with
163 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
application/data/migrations/20240103030617_ConvertItemShowcaseToMedia.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
namespace Omeka\Db\Migrations; | ||
|
||
use Doctrine\DBAL\Connection; | ||
use Laminas\ServiceManager\ServiceLocatorInterface; | ||
use Omeka\Db\Migration\ConstructedMigrationInterface; | ||
|
||
class ConvertItemShowcaseToMedia implements ConstructedMigrationInterface | ||
{ | ||
private $em; | ||
|
||
public static function create(ServiceLocatorInterface $services) | ||
{ | ||
return new self($services->get('Omeka\EntityManager')); | ||
} | ||
|
||
public function __construct($em) | ||
{ | ||
$this->em = $em; | ||
} | ||
|
||
public function up(Connection $conn) | ||
{ | ||
// Convert item showcase blocks to media embed blocks. | ||
$blocksRepository = $this->em->getRepository('Omeka\Entity\SitePageBlock'); | ||
foreach ($blocksRepository->findBy(['layout' => 'itemShowCase']) as $block) { | ||
$data = $block->getData(); | ||
$data['layout'] = 'horizontal'; | ||
$data['media_display'] = 'thumbnail'; | ||
$block->setData($data); | ||
$block->setLayout('media'); | ||
} | ||
$this->em->flush(); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.