Skip to content

Commit

Permalink
Merged with 5.x-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
AltamashShaikh committed Dec 12, 2024
2 parents 9813810 + 2f88edb commit 369b7a0
Show file tree
Hide file tree
Showing 8 changed files with 131 additions and 47 deletions.
6 changes: 3 additions & 3 deletions API.php
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ public function createDefaultContainerForSite($idSite)
Request::processRequest('TagManager.createContainerVersion', array(
'idSite' => $idSite,
'idContainer' => $idContainer,
'name' => '0.1.0 - ' . Piwik::translate('TagManager_AutoGenerated'),
'name' => substr('0.1.0 - ' . Piwik::translate('TagManager_AutoGenerated'), 0, 50),
), $default = []);
Request::processRequest('TagManager.publishContainerVersion', array(
'idSite' => $idSite,
Expand Down Expand Up @@ -1170,7 +1170,7 @@ public function createContainerVersion($idSite, $idContainer, $name, $descriptio
$this->accessValidator->checkUseCustomTemplatesCapability($idSite);
}
$this->containers->checkContainerExists($idSite, $idContainer);
BaseValidator::check(Piwik::translate('TagManager_VersionName'), $name, [new NotEmpty(), new CharacterLength(1, 30)]);
BaseValidator::check(Piwik::translate('TagManager_VersionName'), $name, [new NotEmpty(), new CharacterLength(1, 50)]);

if (empty($idContainerVersion)) {
$idContainerVersion = $this->getContainerDraftVersion($idSite, $idContainer);
Expand Down Expand Up @@ -1200,7 +1200,7 @@ public function updateContainerVersion($idSite, $idContainer, $idContainerVersio
if (!Piwik::isUserHasCapability($idSite, PublishLiveContainer::ID) && !Piwik::isUserHasCapability($idSite, PublishLiveContainer::ID)) {
$this->accessValidator->checkUseCustomTemplatesCapability($idSite);
}
BaseValidator::check(Piwik::translate('TagManager_VersionName'), $name, [new NotEmpty(), new CharacterLength(1, 30)]);
BaseValidator::check(Piwik::translate('TagManager_VersionName'), $name, [new NotEmpty(), new CharacterLength(1, 50)]);
$this->containers->checkContainerVersionExists($idSite, $idContainer, $idContainerVersion);

return $this->containers->updateContainerVersion($idSite, $idContainer, $idContainerVersion, $name, $description);
Expand Down
1 change: 1 addition & 0 deletions lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,7 @@
"LastUpdated": "Zuletzt aktualisiert",
"LastVersions": "Letzte Versionen",
"LearnMore": "Mehr dazu",
"LearnMoreFullStop": "%1$sErfahren Sie mehr%2$s.",
"LinkedinInsightTagDescription": "Fügt den LinkedIn Insight Tag hinzu, damit Sie Konversions-Tracking für Ihre LinkedIn Werbekampagne einsetzen können.",
"LinkedinInsightTagHelp": "Der Tag wird detaillierte Kampagnenberichte und -informationen über Ihre Webseitenbesucher in LinkedIn aktivieren. Es erlaubt Ihnen Konversionen und umgeleitete Webseitenbesuche zu tracken, und zusätzliche interne Informationen über LinkedIn Mitglieder zu gewinnen, welche mit Ihrer LinkedIn Werbung interagieren.",
"LinkedinInsightTagName": "LinkedIn Insight-Tag",
Expand Down
2 changes: 1 addition & 1 deletion lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
"Created": "Créé(e)",
"CreatedDate": "Date de création",
"CreatedOnX": "Créée le \"%s\"",
"CreatedX": "Fantastique ! %sa été créée avec succès.",
"CreatedX": "Fantastique! %s a été créé avec succès.",
"CurrentTimeInLocalTimezone": "Votre temps local est %1$s%2$s%3$s.",
"CustomEventTriggerDescription": "Déclenché lorsqu'un évènement personnalisé est envoyé à la couche de données.",
"CustomEventTriggerHelp": "Permet aux développeurs de définir manuellement quand ce déclencheur devrait être déclenché en envoyant un évènement à la couche de données. De cette manière vous pouvez par exemple exécuter certaines actions quand un produit est ajouté au panier ou lorsqu'un utilisateur s'identifie.",
Expand Down
97 changes: 90 additions & 7 deletions lang/sq.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions tests/Integration/APITest.php
Original file line number Diff line number Diff line change
Expand Up @@ -387,11 +387,11 @@ public function test_updateContainerVersion_shouldFailWhenContainerVersionDoesNo
public function test_updateContainerVersion_shouldThrowExceptionForInvalidNameLength()
{
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Version name: The value contains "48" characters but should contain at most 30 characters.');
$this->expectExceptionMessage('Version name: The value contains "52" characters but should contain at most 50 characters.');

$this->setSuperUser();
$idContainerVersion = $this->api->createContainerVersion($this->idSite, $this->idContainer, 'My Name');
$this->api->updateContainerVersion($this->idSite, $this->idContainer, $idContainerVersion, 'My Name very long name should throw an exception', 'TheName');
$this->api->updateContainerVersion($this->idSite, $this->idContainer, $idContainerVersion, 'My Name very long!!!! name should throw an exception', 'TheName');
}

public function test_createContainerVersion_shouldFailWhenNotHavingViewPermissions()
Expand All @@ -415,10 +415,10 @@ public function test_createContainerVersion_shouldFailWhenContainerVersionDoesNo
public function test_createContainerVersion_shouldThrowExceptionForInvalidNameLength()
{
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Version name: The value contains "48" characters but should contain at most 30 characters.');
$this->expectExceptionMessage('Version name: The value contains "52" characters but should contain at most 50 characters.');

$this->setSuperUser();
$this->api->createContainerVersion($this->idSite, $this->idContainer, 'My Name very long name should throw an exception');
$this->api->createContainerVersion($this->idSite, $this->idContainer, 'My Name very long!!!! name should throw an exception');
}

public function test_deleteContainerVersion_shouldFailWhenNotHavingViewPermissions()
Expand Down
Loading

0 comments on commit 369b7a0

Please sign in to comment.