Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
*
* ILIAS is licensed with the GPL-3.0,
* see https://www.gnu.org/licenses/gpl-3.0.en.html
* You should have received a copy of said license along with the
* source code, too.
*
* If this is not the case or you just want to try ILIAS, you'll find
* us at:
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
*********************************************************************/

declare(strict_types=1);

namespace ILIAS\ResourceStorage\Setup\DB;

class UpdateStepsV12 implements \ilDatabaseUpdateSteps
{
private \ilDBInterface $db;

public function prepare(\ilDBInterface $db): void
{
$this->db = $db;
}

public function step_1(): void
{
$this->db->modifyTableColumn('il_resource_flavour', 'variant', [
'notnull' => false,
'length' => 638,
'type' => \ilDBConstants::T_TEXT,
]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
use ILIAS\Setup\Config;
use ILIAS\Setup\Objective;
use ILIAS\Setup\ObjectiveCollection;
use ILIAS\ResourceStorage\Setup\DB\UpdateStepsV12;
use ILIAS\Setup\Objective\ObjectiveWithPreconditions;

/**
* Class ilResourceStorageSetupAgent
Expand Down Expand Up @@ -65,9 +67,10 @@ public function getUpdateObjective(?Config $config = null): Objective
new ilDatabaseUpdateStepsExecutedObjective(
new ilResourceStorageDB80()
),
new ilDatabaseUpdateStepsExecutedObjective(
new ilResourceStorageDB90()
)
new ObjectiveWithPreconditions(
new ilDatabaseUpdateStepsExecutedObjective(new UpdateStepsV12()),
new ilDatabaseUpdateStepsExecutedObjective(new ilResourceStorageDB90()),
),
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function getInternalName(): string;
* such variants must be distinguishable. For example, a variant name may contain "{height}x{width}"
* if these are configurable values.
*
* The Variant-Name MUST be less than 768 characters long!
* The Variant-Name MUST be less than 638 characters long!
*/
public function getVariantName(): ?string;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
*/
class FlavourBuilder
{
public const VARIANT_NAME_MAX_LENGTH = 768;
public const VARIANT_NAME_MAX_LENGTH = 638;
private array $current_revision_cache = [];
private array $resources_cache = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function testDefinitionVariantNameLengths(): void
$flavour_definition = $this->createMock(FlavourDefinition::class);
$flavour_definition->expects($this->exactly(2))
->method('getVariantName')
->willReturn(str_repeat('a', 768));
->willReturn(str_repeat('a', 638));

$flavour_builder->has(
new ResourceIdentification('1'),
Expand Down
Loading