Compare commits

..

8 commits

Author SHA1 Message Date
d7e796eea5 one more try
All checks were successful
ci/woodpecker/push/code-style Pipeline was successful
ci/woodpecker/push/functional-tests/1 Pipeline was successful
ci/woodpecker/push/functional-tests/2 Pipeline was successful
ci/woodpecker/push/functional-tests/3 Pipeline was successful
2024-06-27 21:33:46 +02:00
2119e62bbb next try to stick to the column length :/
All checks were successful
ci/woodpecker/push/code-style Pipeline was successful
ci/woodpecker/push/functional-tests/1 Pipeline was successful
ci/woodpecker/push/functional-tests/3 Pipeline was successful
ci/woodpecker/push/functional-tests/2 Pipeline was successful
2024-06-27 21:27:38 +02:00
e94b044d3a this time really staying inside length
All checks were successful
ci/woodpecker/push/code-style Pipeline was successful
ci/woodpecker/push/functional-tests/3 Pipeline was successful
ci/woodpecker/push/functional-tests/1 Pipeline was successful
ci/woodpecker/push/functional-tests/2 Pipeline was successful
2024-06-27 21:21:19 +02:00
0876923bf5 using shortened value for urlValue
All checks were successful
ci/woodpecker/push/code-style Pipeline was successful
ci/woodpecker/push/functional-tests/3 Pipeline was successful
ci/woodpecker/push/functional-tests/1 Pipeline was successful
ci/woodpecker/push/functional-tests/2 Pipeline was successful
2024-06-27 21:12:52 +02:00
40097be56e adding branch alias
All checks were successful
ci/woodpecker/push/code-style Pipeline was successful
ci/woodpecker/push/functional-tests/3 Pipeline was successful
ci/woodpecker/push/functional-tests/2 Pipeline was successful
ci/woodpecker/push/functional-tests/1 Pipeline was successful
2024-06-25 23:12:50 +02:00
de816ce05c Adding the possibility to store more than 250 bytes in attribute values
All checks were successful
ci/woodpecker/push/code-style Pipeline was successful
ci/woodpecker/push/functional-tests/2 Pipeline was successful
ci/woodpecker/push/functional-tests/1 Pipeline was successful
ci/woodpecker/push/functional-tests/3 Pipeline was successful
2024-06-25 17:46:33 +02:00
683d940f94 make views yaml expression even more explicit
All checks were successful
ci/woodpecker/push/code-style Pipeline was successful
ci/woodpecker/push/functional-tests Pipeline was successful
2023-08-01 15:23:39 +02:00
9238f4fea5 Merge tag '1.0.1' into develop
All checks were successful
ci/woodpecker/push/code-style Pipeline was successful
ci/woodpecker/push/functional-tests Pipeline was successful
Tagging 1.0.1
2023-07-25 19:56:39 +02:00
4 changed files with 49 additions and 5 deletions

View file

@ -17,6 +17,8 @@ use Neos\Flow\Annotations as Flow;
*/ */
class AssetAttribute class AssetAttribute
{ {
protected const MAX_VALUE_LENGTH = 250;
/** /**
* @var string * @var string
*/ */
@ -39,6 +41,12 @@ 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
@ -47,9 +55,14 @@ 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;
$this->value = $value; if (\mb_strlen($value) > self::MAX_VALUE_LENGTH) {
$this->longValue = $value;
$this->value = \mb_substr($value, 0, 250);
} else {
$this->value = $value;
}
if (!$urlValue) { if (!$urlValue) {
$urlValue = $value; $urlValue = $this->value;
} }
$this->urlValue = $urlValue; $this->urlValue = $urlValue;
} }
@ -62,7 +75,7 @@ class AssetAttribute
\array_column($this->replacementMap, 'value'), \array_column($this->replacementMap, 'value'),
$this->urlValue $this->urlValue
); );
$this->urlValue = \urlencode(\strtolower($this->urlValue)); $this->urlValue = \mb_substr(\urlencode(\strtolower($this->urlValue)), 0, 250);
} }
} }
@ -79,7 +92,7 @@ class AssetAttribute
*/ */
public function getValue(): string public function getValue(): string
{ {
return $this->value; return $this->longValue ?? $this->value;
} }
/** /**

View file

@ -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')" requestFilter: "parentRequest.isPackage('Neos.Neos') && isFormat('html') && isPackage('Neos.Media.Browser') && isAction('edit')"
options: options:
templateRootPaths: templateRootPaths:
"DigiComp.AssetAttributes": "resource://DigiComp.AssetAttributes/Private/Templates" "DigiComp.AssetAttributes": "resource://DigiComp.AssetAttributes/Private/Templates"

View file

@ -0,0 +1,28 @@
<?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');
}
}

View file

@ -15,6 +15,9 @@
} }
}, },
"extra": { "extra": {
"branch-alias": {
"dev-develop": "1.0.x-dev"
},
"neos": { "neos": {
"package-key": "DigiComp.AssetAttributes" "package-key": "DigiComp.AssetAttributes"
} }