Skip to content

Commit

Permalink
Merge tag v2.4.14 into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
roadiz-ci committed Feb 13, 2025
1 parent 4856d3b commit 3eaa7fd
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
29 changes: 29 additions & 0 deletions migrations/Version20250213093448.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

declare(strict_types=1);

namespace RZ\Roadiz\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250213093448 extends AbstractMigration
{
public function getDescription(): string
{
return 'Fixes NULL published_at dates in nodes_sources';
}

public function up(Schema $schema): void
{
$this->addSql('UPDATE nodes_sources SET published_at = "2025-02-13 09:34:48" WHERE published_at IS NULL');
}

public function down(Schema $schema): void
{
// Do nothing
}
}
16 changes: 16 additions & 0 deletions src/Entity/NodesSources.php
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,22 @@ public function isReachable(): bool
throw new \RuntimeException('This method should only be called from children classes');
}

/**
* Set base data from another node-source.
*
* @return $this
*/
public function withNodesSources(NodesSources $nodesSources): self
{
$this->setTitle($nodesSources->getTitle());
$this->setPublishedAt($nodesSources->getPublishedAt());
$this->setMetaTitle($nodesSources->getMetaTitle());
$this->setMetaDescription($nodesSources->getMetaDescription());
$this->setNoIndex($nodesSources->isNoIndex());

return $this;
}

/**
* Returns current listing sort options OR parent node's if parent node is hiding children.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Node/NodeTranstyper.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ protected function doTranstypeSingleSource(
): NodesSources {
/** @var NodesSources $source */
$source = new $sourceClass($node, $translation);
$source = $source->withNodesSources($existingSource);
$this->getManager()->persist($source);
$source->setTitle($existingSource->getTitle());

foreach ($fieldAssociations as $fields) {
/** @var NodeTypeField $oldField */
Expand Down

0 comments on commit 3eaa7fd

Please sign in to comment.