Compare commits
No commits in common. "develop" and "main" have entirely different histories.
4 changed files with 5 additions and 49 deletions
|
@ -17,8 +17,6 @@ use Neos\Flow\Annotations as Flow;
|
||||||
*/
|
*/
|
||||||
class AssetAttribute
|
class AssetAttribute
|
||||||
{
|
{
|
||||||
protected const MAX_VALUE_LENGTH = 250;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
|
@ -41,12 +39,6 @@ class AssetAttribute
|
||||||
*/
|
*/
|
||||||
protected array $replacementMap;
|
protected array $replacementMap;
|
||||||
|
|
||||||
/**
|
|
||||||
* @ORM\Column(type="text", nullable=true)
|
|
||||||
* @var string|null
|
|
||||||
*/
|
|
||||||
protected ?string $longValue = null;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $name
|
* @param string $name
|
||||||
* @param string $value
|
* @param string $value
|
||||||
|
@ -55,14 +47,9 @@ class AssetAttribute
|
||||||
public function __construct(string $name, string $value, string $urlValue = '')
|
public function __construct(string $name, string $value, string $urlValue = '')
|
||||||
{
|
{
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
if (\mb_strlen($value) > self::MAX_VALUE_LENGTH) {
|
$this->value = $value;
|
||||||
$this->longValue = $value;
|
|
||||||
$this->value = \mb_substr($value, 0, 250);
|
|
||||||
} else {
|
|
||||||
$this->value = $value;
|
|
||||||
}
|
|
||||||
if (!$urlValue) {
|
if (!$urlValue) {
|
||||||
$urlValue = $this->value;
|
$urlValue = $value;
|
||||||
}
|
}
|
||||||
$this->urlValue = $urlValue;
|
$this->urlValue = $urlValue;
|
||||||
}
|
}
|
||||||
|
@ -75,7 +62,7 @@ class AssetAttribute
|
||||||
\array_column($this->replacementMap, 'value'),
|
\array_column($this->replacementMap, 'value'),
|
||||||
$this->urlValue
|
$this->urlValue
|
||||||
);
|
);
|
||||||
$this->urlValue = \mb_substr(\urlencode(\strtolower($this->urlValue)), 0, 250);
|
$this->urlValue = \urlencode(\strtolower($this->urlValue));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,7 +79,7 @@ class AssetAttribute
|
||||||
*/
|
*/
|
||||||
public function getValue(): string
|
public function getValue(): string
|
||||||
{
|
{
|
||||||
return $this->longValue ?? $this->value;
|
return $this->value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
"Neos.Media.Browser": "resource://Neos.Media.Browser/Private/Partials"
|
"Neos.Media.Browser": "resource://Neos.Media.Browser/Private/Partials"
|
||||||
|
|
||||||
-
|
-
|
||||||
requestFilter: "parentRequest.isPackage('Neos.Neos') && isFormat('html') && isPackage('Neos.Media.Browser') && isAction('edit')"
|
requestFilter: "parentRequest.isPackage('Neos.Neos') && isFormat('html') && isPackage('Neos.Media.Browser')"
|
||||||
options:
|
options:
|
||||||
templateRootPaths:
|
templateRootPaths:
|
||||||
"DigiComp.AssetAttributes": "resource://DigiComp.AssetAttributes/Private/Templates"
|
"DigiComp.AssetAttributes": "resource://DigiComp.AssetAttributes/Private/Templates"
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Neos\Flow\Persistence\Doctrine\Migrations;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Auto-generated Migration: Please modify to your needs!
|
|
||||||
*/
|
|
||||||
final class Version20240625154316 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
|
|
||||||
|
|
||||||
$this->addSql('ALTER TABLE digicomp_assetattributes_domain_model_assetattribute ADD longvalue LONGTEXT DEFAULT NULL');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
|
|
||||||
|
|
||||||
$this->addSql('ALTER TABLE digicomp_assetattributes_domain_model_assetattribute DROP longvalue');
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -15,9 +15,6 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
|
||||||
"dev-develop": "1.0.x-dev"
|
|
||||||
},
|
|
||||||
"neos": {
|
"neos": {
|
||||||
"package-key": "DigiComp.AssetAttributes"
|
"package-key": "DigiComp.AssetAttributes"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue