-
-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/8.3' into 9.0
- Loading branch information
Showing
9 changed files
with
139 additions
and
13 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
13 changes: 10 additions & 3 deletions
13
Neos.Media.Browser/Resources/Private/Partials/ContentDefaultPreview.html
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 |
---|---|---|
@@ -1,7 +1,14 @@ | ||
{namespace m=Neos\Media\ViewHelpers} | ||
{namespace neos=Neos\Neos\ViewHelpers} | ||
<div class="neos-preview-image" id="neos-preview-image"> | ||
<a href="{assetProxy.originalUri}" target="_blank"> | ||
<img src="{assetProxy.previewUri}" class="img-polaroid" alt="{assetProxy.label}"/> | ||
</a> | ||
<f:if condition="{assetContainsMaliciousContent}"> | ||
<f:then> | ||
<img src="{assetProxy.previewUri}" class="img-polaroid" alt="{assetProxy.label}"/> | ||
</f:then> | ||
<f:else> | ||
<a href="{assetProxy.originalUri}" target="_blank"> | ||
<img src="{assetProxy.previewUri}" class="img-polaroid" alt="{assetProxy.label}"/> | ||
</a> | ||
</f:else> | ||
</f:if> | ||
</div> |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Neos\Flow\Persistence\Doctrine\Migrations; | ||
|
||
use Doctrine\DBAL\Schema\Schema; | ||
use Doctrine\Migrations\AbstractMigration; | ||
use Neos\ContentRepository\Utility; | ||
|
||
final class Version20230727164600 extends AbstractMigration | ||
{ | ||
public function getDescription() : string | ||
{ | ||
return 'add dimensions hash to node event model'; | ||
} | ||
|
||
/** | ||
* @param Schema $schema | ||
* @throws \Doctrine\DBAL\Exception | ||
*/ | ||
public function up(Schema $schema) : void | ||
{ | ||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on "postgresql".'); | ||
|
||
$this->addSql('ALTER TABLE neos_neos_eventlog_domain_model_event ADD dimensionshash VARCHAR(32) DEFAULT NULL'); | ||
$this->addSql('CREATE INDEX dimensionshash ON neos_neos_eventlog_domain_model_event (dimensionshash)'); | ||
} | ||
|
||
/** | ||
* @param Schema $schema | ||
* @throws \Doctrine\DBAL\Exception | ||
*/ | ||
public function down(Schema $schema) : void | ||
{ | ||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on "postgresql".'); | ||
|
||
$this->addSql('DROP INDEX dimensionshash'); | ||
$this->addSql('ALTER TABLE neos_neos_eventlog_domain_model_event DROP dimensionshash'); | ||
} | ||
|
||
/** | ||
* @param Schema $schema | ||
* @throws \Doctrine\DBAL\Driver\Exception | ||
* @throws \Doctrine\DBAL\Exception | ||
*/ | ||
public function postUp(Schema $schema): void | ||
{ | ||
$eventLogResult = $this->connection->executeQuery('SELECT dimension FROM neos_neos_eventlog_domain_model_event where dimensionshash IS NULL AND dimension IS NOT NULL LIMIT 1'); | ||
|
||
while ($eventLogInfo = $eventLogResult->fetchAssociative()) { | ||
$dimensionsArray = unserialize($eventLogInfo['dimension'], ['allowed_classes' => false]); | ||
$dimensionsHash = Utility::sortDimensionValueArrayAndReturnDimensionsHash($dimensionsArray); | ||
$this->connection->executeStatement('UPDATE neos_neos_eventlog_domain_model_event SET dimensionshash = ? WHERE dimension = ?', [$dimensionsHash, $eventLogInfo['dimension']]); | ||
$eventLogResult = $this->connection->executeQuery('SELECT dimension FROM neos_neos_eventlog_domain_model_event where dimensionshash IS NULL AND dimension IS NOT NULL LIMIT 1'); | ||
} | ||
} | ||
} |
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