Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBX-7409: Changed Content Type to content type #83

Merged
merged 2 commits into from
Jan 22, 2024
Merged
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
2 changes: 1 addition & 1 deletion src/bundle/Resources/config/value_object_visitors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ parameters:

# Field Definition

# Content Type Group
# Content type Group

# HTTP

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@
<note>The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message.</note>
</header>
<body>
<trans-unit id="6b5380565700746eb00dfa6b096b5db86d590589" resname="Cannot publish an empty Content Type draft">
<source>Cannot publish an empty Content Type draft</source>
<target state="new">Cannot publish an empty Content Type draft</target>
<note>key: Cannot publish an empty Content Type draft</note>
<trans-unit id="18a38f6c46cc84d27fa3d24cbd09aee62125be8d" resname="Cannot publish an empty content type draft">
<source>Cannot publish an empty content type draft</source>
<target state="new">Cannot publish an empty content type draft</target>
<note>key: Cannot publish an empty content type draft</note>
</trans-unit>
<trans-unit id="05517432cfd855bfa4417139564c188c02654b4c" resname="Cannot unlink the Content Type from its only remaining group">
<source>Cannot unlink the Content Type from its only remaining group</source>
<target state="new">Cannot unlink the Content Type from its only remaining group</target>
<note>key: Cannot unlink the Content Type from its only remaining group</note>
<trans-unit id="8bfebd32a3304d378cf1219c4b25b1044d9dde34" resname="Cannot unlink the content type from its only remaining group">
<source>Cannot unlink the content type from its only remaining group</source>
<target state="new">Cannot unlink the content type from its only remaining group</target>
<note>key: Cannot unlink the content type from its only remaining group</note>
</trans-unit>
<trans-unit id="0b525944af0bdcb0dd04bcaa4a027212bffc9738" resname="Current version already has DRAFT status">
<source>Current version already has DRAFT status</source>
<target state="new">Current version already has DRAFT status</target>
<note>key: Current version already has DRAFT status</note>
</trans-unit>
<trans-unit id="3488686cd9f81f72d18993fefc0d4de7d17bc52b" resname="Only empty Content Type groups can be deleted">
<source>Only empty Content Type groups can be deleted</source>
<target state="new">Only empty Content Type groups can be deleted</target>
<note>key: Only empty Content Type groups can be deleted</note>
<trans-unit id="f915c78ee350c1b4fb3d3adac7584a12fcc0cfdf" resname="Only empty content type groups can be deleted">
<source>Only empty content type groups can be deleted</source>
<target state="new">Only empty content type groups can be deleted</target>
<note>key: Only empty content type groups can be deleted</note>
</trans-unit>
<trans-unit id="309f294f925bf5343de6ca4507a303bbc762090f" resname="Only versions with DRAFT status can be published">
<source>Only versions with DRAFT status can be published</source>
Expand Down Expand Up @@ -56,10 +56,10 @@
<target state="new">Relation of type COMMON to the selected destination content ID already exists</target>
<note>key: Relation of type COMMON to the selected destination content ID already exists</note>
</trans-unit>
<trans-unit id="fd9dfe52da409af010a267fa2ad0a70d077b73c4" resname="The Content Type is already linked to the provided group">
<source>The Content Type is already linked to the provided group</source>
<target state="new">The Content Type is already linked to the provided group</target>
<note>key: The Content Type is already linked to the provided group</note>
<trans-unit id="7d98c91ecfe4814f6268eb889de59ada9eec6a1d" resname="The content type is already linked to the provided group">
<source>The content type is already linked to the provided group</source>
<target state="new">The content type is already linked to the provided group</target>
<note>key: The content type is already linked to the provided group</note>
</trans-unit>
<trans-unit id="d71c63955373cbd73161528026feb878e5e042b8" resname="Translation can be deleted from a DRAFT version only">
<source>Translation can be deleted from a DRAFT version only</source>
Expand Down
4 changes: 2 additions & 2 deletions src/contracts/Input/ParsingDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function __construct(EventDispatcherInterface $eventDispatcher, array $pa
}

/**
* Adds another parser for the given Content Type.
* Adds another parser for the given content type.
*
* @param string $mediaType
* @param \Ibexa\Contracts\Rest\Input\Parser $parser
Expand Down Expand Up @@ -105,7 +105,7 @@ protected function internalParse(array $data, string $mediaType)
}

if (!isset($this->parsers[$mediaType][$version])) {
throw new Exceptions\Parser("Unknown Content Type specification: '$mediaType (version: $version)'.");
throw new Exceptions\Parser("Unknown content type specification: '$mediaType (version: $version)'.");
}

return $this->parsers[$mediaType][$version]->parse($data, $this);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Input/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function __construct(ParsingDispatcher $parsingDispatcher, array $handler
}

/**
* Adds another handler for the given Content Type.
* Adds another handler for the given content type.
*
* @param string $type
* @param \Ibexa\Contracts\Rest\Input\Handler $handler
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Input/ParserTools.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public function parseStatus($contentTypeStatus)
return Values\ContentType\ContentType::STATUS_MODIFIED;
}

throw new \RuntimeException("Unknown Content Type status '{$contentTypeStatus}.'");
throw new \RuntimeException("Unknown content type status '{$contentTypeStatus}.'");
}

/**
Expand Down
10 changes: 5 additions & 5 deletions src/lib/Server/Controller/ContentType.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public function deleteContentTypeGroup($contentTypeGroupId)

$contentTypes = $this->contentTypeService->loadContentTypes($contentTypeGroup);
if (!empty($contentTypes)) {
throw new ForbiddenException('Only empty Content Type groups can be deleted');
throw new ForbiddenException('Only empty content type groups can be deleted');
}

$this->contentTypeService->deleteContentTypeGroup($contentTypeGroup);
Expand Down Expand Up @@ -740,7 +740,7 @@ public function publishContentTypeDraft($contentTypeId)

$fieldDefinitions = $contentTypeDraft->getFieldDefinitions();
if (empty($fieldDefinitions)) {
throw new ForbiddenException('Cannot publish an empty Content Type draft');
throw new ForbiddenException('Cannot publish an empty content type draft');
}

$this->contentTypeService->publishContentTypeDraft($contentTypeDraft);
Expand Down Expand Up @@ -843,7 +843,7 @@ public function linkContentTypeToGroup($contentTypeId, Request $request)
}

if ($contentTypeInGroup) {
throw new ForbiddenException('The Content Type is already linked to the provided group');
throw new ForbiddenException('The content type is already linked to the provided group');
}

$this->contentTypeService->assignContentTypeGroup(
Expand Down Expand Up @@ -885,11 +885,11 @@ public function unlinkContentTypeFromGroup($contentTypeId, $contentTypeGroupId)
}

if (!$contentTypeInGroup) {
throw new Exceptions\NotFoundException('The Content Type is not in the provided group');
throw new Exceptions\NotFoundException('The content type is not in the provided group');
}

if (count($existingContentTypeGroups) == 1) {
throw new ForbiddenException('Cannot unlink the Content Type from its only remaining group');
throw new ForbiddenException('Cannot unlink the content type from its only remaining group');
}

$this->contentTypeService->unassignContentTypeGroup(
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Server/Input/Parser/ContentCreate.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public function parse(array $data, ParsingDispatcher $parsingDispatcher)
$fieldDefinition = $contentType->getFieldDefinition($fieldData['fieldDefinitionIdentifier']);
if (!$fieldDefinition) {
throw new Exceptions\Parser(
"'{$fieldData['fieldDefinitionIdentifier']}' is an invalid Field definition identifier for the '{$contentType->identifier}' Content Type in ContentCreate."
"'{$fieldData['fieldDefinitionIdentifier']}' is an invalid Field definition identifier for the '{$contentType->identifier}' content type in ContentCreate."
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/Server/Input/Parser/UserCreate.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public function parse(array $data, ParsingDispatcher $parsingDispatcher)
$fieldDefinition = $userCreateStruct->contentType->getFieldDefinition($fieldData['fieldDefinitionIdentifier']);
if (!$fieldDefinition) {
throw new Exceptions\Parser(
"'{$fieldData['fieldDefinitionIdentifier']}' is an invalid Field definition identifier for the '{$userCreateStruct->contentType->identifier}' Content Type in UserCreate."
"'{$fieldData['fieldDefinitionIdentifier']}' is an invalid Field definition identifier for the '{$userCreateStruct->contentType->identifier}' content type in UserCreate."
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/Server/Input/Parser/UserGroupCreate.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function parse(array $data, ParsingDispatcher $parsingDispatcher)
$fieldDefinition = $userGroupCreateStruct->contentType->getFieldDefinition($fieldData['fieldDefinitionIdentifier']);
if (!$fieldDefinition) {
throw new Exceptions\Parser(
"'{$fieldData['fieldDefinitionIdentifier']}' is an invalid Field definition identifier for the '{$userGroupCreateStruct->contentType->identifier}' Content Type in UserGroupCreate."
"'{$fieldData['fieldDefinitionIdentifier']}' is an invalid Field definition identifier for the '{$userGroupCreateStruct->contentType->identifier}' content type in UserGroupCreate."
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected function serializeStatus($contentTypeStatus)
return 'MODIFIED';
}

throw new \RuntimeException("Unknown Content Type status: '{$contentTypeStatus}'.");
throw new \RuntimeException("Unknown content type status: '{$contentTypeStatus}'.");
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/Server/Values/RestContentType.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Ibexa\Rest\Value as RestValue;

/**
* REST Content type, as received by /content/types/<ID>.
* REST content type, as received by /content/types/<ID>.
*
* Might have a "FieldDefinitionList" embedded
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/bundle/Functional/BinaryContentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ private function createContentTypeWithImageAsset()
<ContentTypeCreate>
<identifier>image_asset_ct</identifier>
<names>
<value languageCode="eng-GB">Image Asset Content Type</value>
<value languageCode="eng-GB">Image Asset content type</value>
</names>
<remoteId>image_asset_ct</remoteId>
<urlAliasSchema>&lt;title&gt;</urlAliasSchema>
Expand Down
2 changes: 1 addition & 1 deletion tests/bundle/Functional/ContentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ private function assertVersionResponseContainsExpectedFields(ResponseInterface $
/**
* Create new Content Draft.
*
* @param string $restContentTypeHref Content Type REST resource link
* @param string $restContentTypeHref content type REST resource link
* @param string $restParentLocationHref Parent Location REST resource link
* @param string $restSectionHref Section REST resource link
* @param string $restUserHref User REST resource link
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/Server/Input/Parser/ContentCreateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ public function testParseExceptionOnMissingFieldDefinitionIdentifier()
public function testParseExceptionOnInvalidFieldDefinitionIdentifier()
{
$this->expectException(Parser::class);
$this->expectExceptionMessage('\'unknown\' is an invalid Field definition identifier for the \'some_class\' Content Type in ContentCreate.');
$this->expectExceptionMessage('\'unknown\' is an invalid Field definition identifier for the \'some_class\' content type in ContentCreate.');
$inputArray = [
'ContentType' => [
'_href' => '/content/types/13',
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/Server/Input/Parser/UserCreateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ public function testParseExceptionOnMissingFieldDefinitionIdentifier()
public function testParseExceptionOnInvalidFieldDefinitionIdentifier()
{
$this->expectException(Parser::class);
$this->expectExceptionMessage('\'unknown\' is an invalid Field definition identifier for the \'some_class\' Content Type in UserCreate.');
$this->expectExceptionMessage('\'unknown\' is an invalid Field definition identifier for the \'some_class\' content type in UserCreate.');
$inputArray = [
'ContentType' => [
'_href' => '/content/types/4',
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/Server/Input/Parser/UserGroupCreateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ public function testParseExceptionOnMissingFieldDefinitionIdentifier()
public function testParseExceptionOnInvalidFieldDefinitionIdentifier()
{
$this->expectException(Parser::class);
$this->expectExceptionMessage('\'unknown\' is an invalid Field definition identifier for the \'some_class\' Content Type in UserGroupCreate.');
$this->expectExceptionMessage('\'unknown\' is an invalid Field definition identifier for the \'some_class\' content type in UserGroupCreate.');
$inputArray = [
'ContentType' => [
'_href' => '/content/types/3',
Expand Down
Loading