Skip to content

Instantly share code, notes, and snippets.

@patrickallaert
Created July 2, 2024 09:26
Show Gist options
  • Save patrickallaert/fac2a71bdb8006799e69bd5d3771ae01 to your computer and use it in GitHub Desktop.
Save patrickallaert/fac2a71bdb8006799e69bd5d3771ae01 to your computer and use it in GitHub Desktop.
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Controller/Content/ContentTreeController.php vendor-4.6.7/ibexa/admin-ui/src/bundle/Controller/Content/ContentTreeController.php
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Controller/Content/ContentTreeController.php 2024-07-02 10:19:28.412331807 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Controller/Content/ContentTreeController.php 2024-07-02 10:23:24.950906973 +0200
@@ -8,34 +8,62 @@
namespace Ibexa\Bundle\AdminUi\Controller\Content;
+use Ibexa\AdminUi\Permission\LookupLimitationsTransformer;
use Ibexa\AdminUi\REST\Value\ContentTree\LoadSubtreeRequestNode;
use Ibexa\AdminUi\REST\Value\ContentTree\Node;
+use Ibexa\AdminUi\REST\Value\ContentTree\NodeExtendedInfo;
use Ibexa\AdminUi\REST\Value\ContentTree\Root;
+use Ibexa\AdminUi\Siteaccess\SiteaccessResolverInterface;
+use Ibexa\AdminUi\Specification\ContentType\ContentTypeIsUser;
use Ibexa\AdminUi\UI\Module\ContentTree\NodeFactory;
+use Ibexa\Contracts\AdminUi\Permission\PermissionCheckerInterface;
+use Ibexa\Contracts\Core\Limitation\Target;
use Ibexa\Contracts\Core\Repository\LocationService;
+use Ibexa\Contracts\Core\Repository\PermissionResolver;
+use Ibexa\Contracts\Core\Repository\Values\Content\Content;
+use Ibexa\Contracts\Core\Repository\Values\Content\Location;
use Ibexa\Contracts\Core\Repository\Values\Content\Query;
+use Ibexa\Contracts\Core\Repository\Values\User\Limitation;
+use Ibexa\Contracts\Core\SiteAccess\ConfigResolverInterface;
use Ibexa\Rest\Message;
use Ibexa\Rest\Server\Controller as RestController;
use Symfony\Component\HttpFoundation\Request;
+/**
+ * @phpstan-import-type TPermissionRestrictions from \Ibexa\AdminUi\REST\Value\ContentTree\NodeExtendedInfo
+ */
class ContentTreeController extends RestController
{
- /** @var \Ibexa\Contracts\Core\Repository\LocationService */
- private $locationService;
+ private LocationService $locationService;
- /** @var \Ibexa\AdminUi\UI\Module\ContentTree\NodeFactory */
- private $contentTreeNodeFactory;
+ private PermissionCheckerInterface $permissionChecker;
+
+ private LookupLimitationsTransformer $lookupLimitationsTransformer;
+
+ private NodeFactory $contentTreeNodeFactory;
+
+ private PermissionResolver $permissionResolver;
+
+ private ConfigResolverInterface $configResolver;
+
+ private SiteaccessResolverInterface $siteaccessResolver;
- /**
- * @param \Ibexa\Contracts\Core\Repository\LocationService $locationService
- * @param \Ibexa\AdminUi\UI\Module\ContentTree\NodeFactory $contentTreeNodeFactory
- */
public function __construct(
LocationService $locationService,
- NodeFactory $contentTreeNodeFactory
+ PermissionCheckerInterface $permissionChecker,
+ LookupLimitationsTransformer $lookupLimitationsTransformer,
+ NodeFactory $contentTreeNodeFactory,
+ PermissionResolver $permissionResolver,
+ ConfigResolverInterface $configResolver,
+ SiteaccessResolverInterface $siteaccessResolver
) {
$this->locationService = $locationService;
+ $this->permissionChecker = $permissionChecker;
+ $this->lookupLimitationsTransformer = $lookupLimitationsTransformer;
$this->contentTreeNodeFactory = $contentTreeNodeFactory;
+ $this->permissionResolver = $permissionResolver;
+ $this->configResolver = $configResolver;
+ $this->siteaccessResolver = $siteaccessResolver;
}
/**
@@ -104,12 +132,164 @@
true,
0,
$sortClause,
- $sortOrder
+ $sortOrder,
+ $loadSubtreeRequest->filter,
);
}
return new Root($elements);
}
+
+ /**
+ * @internal for internal use by this package
+ *
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
+ */
+ public function loadNodeExtendedInfoAction(Location $location): NodeExtendedInfo
+ {
+ $locationPermissionRestrictions = $this->getLocationPermissionRestrictions($location);
+
+ $content = $location->getContent();
+ $versionInfo = $content->getVersionInfo();
+ $translations = $versionInfo->languageCodes;
+ $previewableTranslations = array_filter(
+ $translations,
+ fn (string $languageCode): bool => $this->isPreviewable($location, $content, $languageCode)
+ );
+
+ return new NodeExtendedInfo($locationPermissionRestrictions, $previewableTranslations);
+ }
+
+ /**
+ * @return TPermissionRestrictions
+ *
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
+ */
+ private function getLocationPermissionRestrictions(Location $location): array
+ {
+ $lookupCreateLimitationsResult = $this->permissionChecker->getContentCreateLimitations($location);
+ $lookupUpdateLimitationsResult = $this->permissionChecker->getContentUpdateLimitations($location);
+
+ $createLimitationsValues = $this->lookupLimitationsTransformer->getGroupedLimitationValues(
+ $lookupCreateLimitationsResult,
+ [Limitation::CONTENTTYPE, Limitation::LANGUAGE]
+ );
+
+ $updateLimitationsValues = $this->lookupLimitationsTransformer->getGroupedLimitationValues(
+ $lookupUpdateLimitationsResult,
+ [Limitation::LANGUAGE]
+ );
+
+ return [
+ 'create' => [
+ 'hasAccess' => $lookupCreateLimitationsResult->hasAccess(),
+ 'restrictedContentTypeIds' => $createLimitationsValues[Limitation::CONTENTTYPE],
+ 'restrictedLanguageCodes' => $createLimitationsValues[Limitation::LANGUAGE],
+ ],
+ 'edit' => [
+ 'hasAccess' => $lookupUpdateLimitationsResult->hasAccess(),
+ // skipped content type limitation values as in this case it can be inferred from "hasAccess" above
+ 'restrictedLanguageCodes' => $updateLimitationsValues[Limitation::LANGUAGE],
+ ],
+ 'delete' => [
+ 'hasAccess' => $this->canUserRemoveContent($location),
+ // skipped other limitation values due to performance, until really needed
+ ],
+ 'hide' => [
+ 'hasAccess' => $this->canUserHideContent($location),
+ // skipped other limitation values due to performance, until really needed
+ ],
+ ];
+ }
+
+ /**
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
+ */
+ private function canUserRemoveContent(Location $location): bool
+ {
+ $content = $location->getContent();
+ $contentType = $content->getContentType();
+ $contentIsUser = (new ContentTypeIsUser($this->configResolver->getParameter('user_content_type_identifier')))
+ ->isSatisfiedBy($contentType);
+
+ $translations = $content->getVersionInfo()->getLanguageCodes();
+ $target = (new Target\Version())->deleteTranslations($translations);
+
+ if ($contentIsUser) {
+ return $this->permissionResolver->canUser(
+ 'content',
+ 'remove',
+ $content,
+ [$target]
+ );
+ }
+
+ if ($location->depth > 1) {
+ return $this->permissionResolver->canUser(
+ 'content',
+ 'remove',
+ $location->getContentInfo(),
+ [$location, $target]
+ );
+ }
+
+ return false;
+ }
+
+ /**
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
+ */
+ private function canUserHideContent(Location $location): bool
+ {
+ $content = $location->getContent();
+
+ $translations = $content->getVersionInfo()->getLanguageCodes();
+ $target = (new Target\Version())->deleteTranslations($translations);
+
+ return $this->permissionResolver->canUser(
+ 'content',
+ 'hide',
+ $content,
+ [$target]
+ );
+ }
+
+ /**
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
+ */
+ private function isPreviewable(
+ Location $location,
+ Content $content,
+ string $languageCode
+ ): bool {
+ $canPreview = $this->permissionResolver->canUser(
+ 'content',
+ 'versionread',
+ $content,
+ [$location]
+ );
+
+ if (!$canPreview) {
+ return false;
+ }
+
+ $versionNo = $content->getVersionInfo()->getVersionNo();
+
+ $siteAccesses = $this->siteaccessResolver->getSiteAccessesListForLocation(
+ $location,
+ $versionNo,
+ $languageCode
+ );
+
+ return !empty($siteAccesses);
+ }
}
class_alias(ContentTreeController::class, 'EzSystems\EzPlatformAdminUiBundle\Controller\Content\ContentTreeController');
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Controller/ContentTypeController.php vendor-4.6.7/ibexa/admin-ui/src/bundle/Controller/ContentTypeController.php
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Controller/ContentTypeController.php 2024-07-02 10:19:28.412331807 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Controller/ContentTypeController.php 2024-07-02 10:23:24.950906973 +0200
@@ -692,6 +692,18 @@
ContentType $contentType,
Request $request
): Response {
+ $contentTypeGroups = $contentType->getContentTypeGroups();
+ $contentTypeGroupsIds = array_column($contentTypeGroups, 'id');
+ if (!in_array($group->id, $contentTypeGroupsIds, true)) {
+ throw $this->createNotFoundException(
+ sprintf(
+ '%s content type does not belong to %s content type group.',
+ $contentType->getName(),
+ $group->identifier,
+ ),
+ );
+ }
+
$fieldDefinitionsByGroup = [];
foreach ($contentType->fieldDefinitions as $fieldDefinition) {
$fieldDefinitionsByGroup[$fieldDefinition->fieldGroup ?: 'content'][] = $fieldDefinition;
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Controller/ContentViewController.php vendor-4.6.7/ibexa/admin-ui/src/bundle/Controller/ContentViewController.php
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Controller/ContentViewController.php 2024-07-02 10:19:28.412331807 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Controller/ContentViewController.php 2024-07-02 10:23:24.951906975 +0200
@@ -172,6 +172,7 @@
$this->supplyContentType($view);
$this->supplyDraftPagination($view, $request);
+ $this->supplyRelationPagination($view, $request);
$this->supplyReverseRelationPagination($view, $request);
$this->supplyCustomUrlPagination($view, $request);
$this->supplySystemUrlPagination($view, $request);
@@ -357,6 +358,21 @@
],
]);
}
+
+ private function supplyRelationPagination(ContentView $view, Request $request): void
+ {
+ $page = $request->query->all('page');
+
+ $view->addParameters([
+ 'relation_pagination_params' => [
+ 'route_name' => $request->get('_route'),
+ 'route_params' => $request->get('_route_params'),
+ 'page' => $page['relation'] ?? 1,
+ 'pages_map' => $page,
+ 'limit' => $this->configResolver->getParameter('pagination.relation_limit'),
+ ],
+ ]);
+ }
/**
* @param \Ibexa\Core\MVC\Symfony\View\ContentView $view
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Controller/DownloadImageController.php vendor-4.6.7/ibexa/admin-ui/src/bundle/Controller/DownloadImageController.php
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Controller/DownloadImageController.php 1970-01-01 01:00:00.000000000 +0100
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Controller/DownloadImageController.php 2024-07-02 10:23:24.951906975 +0200
@@ -0,0 +1,320 @@
+<?php
+
+/**
+ * @copyright Copyright (C) Ibexa AS. All rights reserved.
+ * @license For full copyright and license information view LICENSE file distributed with this source code.
+ */
+declare(strict_types=1);
+
+namespace Ibexa\Bundle\AdminUi\Controller;
+
+use DateTimeImmutable;
+use Ibexa\Contracts\Core\Repository\SearchService;
+use Ibexa\Contracts\Core\Repository\Values\Content\Content;
+use Ibexa\Contracts\Core\Repository\Values\Content\Query;
+use Ibexa\Contracts\Core\Repository\Values\Content\Search\SearchResult;
+use Ibexa\Core\FieldType\Image\Value;
+use Ibexa\Rest\Server\Controller;
+use Ibexa\User\UserSetting\DateTimeFormat\FormatterInterface;
+use RuntimeException;
+use Symfony\Component\HttpFoundation\HeaderUtils;
+use Symfony\Component\HttpFoundation\Response;
+use ZipArchive;
+
+final class DownloadImageController extends Controller
+{
+ private const EXTENSION_ZIP = '.zip';
+
+ private const ARCHIVE_NAME_PATTERN = 'images_%s' . self::EXTENSION_ZIP;
+
+ private int $downloadLimit;
+
+ private FormatterInterface $formatter;
+
+ /** @var array<string, mixed> */
+ private array $imageMappings;
+
+ private SearchService $searchService;
+
+ /**
+ * @param array<string, mixed> $imageMappings
+ */
+ public function __construct(
+ int $downloadLimit,
+ FormatterInterface $formatter,
+ array $imageMappings,
+ SearchService $searchService
+ ) {
+ $this->downloadLimit = $downloadLimit;
+ $this->formatter = $formatter;
+ $this->imageMappings = $imageMappings;
+ $this->searchService = $searchService;
+ }
+
+ /**
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidCriterionArgumentException
+ * @throws \Exception
+ */
+ public function downloadAction(string $contentIdList): Response
+ {
+ $splitContentIdList = array_map(
+ static fn (string $value): int => (int)$value,
+ explode(',', $contentIdList)
+ );
+
+ $this->assertDownloadLimitNotExceeded($splitContentIdList);
+
+ $images = $this->loadImages($splitContentIdList);
+ if (0 === $images->totalCount) {
+ return new Response(
+ 'No results found.',
+ Response::HTTP_NOT_FOUND
+ );
+ }
+
+ return $this->processDownloading($images);
+ }
+
+ /**
+ * @param array<int> $contentIdList
+ */
+ private function assertDownloadLimitNotExceeded(array $contentIdList): void
+ {
+ if (count($contentIdList) > $this->downloadLimit) {
+ throw new RuntimeException(
+ sprintf(
+ 'Total download limit in one request is %d.',
+ $this->downloadLimit
+ )
+ );
+ }
+ }
+
+ /**
+ * @throws \Random\RandomException
+ * @throws \Exception
+ */
+ private function processDownloading(SearchResult $result): Response
+ {
+ if (1 === $result->totalCount) {
+ return $this->downloadSingleImage(
+ $result->getIterator()->current()->valueObject
+ );
+ }
+
+ if (!extension_loaded('zip')) {
+ throw new RuntimeException(
+ 'ZIP extension is not loaded. Enable the extension or use single download instead.'
+ );
+ }
+
+ $contentList = [];
+
+ /** @var \Ibexa\Contracts\Core\Repository\Values\Content\Search\SearchHit $image */
+ foreach ($result as $image) {
+ /** @var \Ibexa\Contracts\Core\Repository\Values\Content\Content $content */
+ $content = $image->valueObject;
+ $contentList[] = $content;
+ }
+
+ return $this->downloadArchiveWithImages($contentList);
+ }
+
+ /**
+ * @throws \Random\RandomException
+ */
+ private function downloadSingleImage(Content $content): Response
+ {
+ $value = $this->getImageValue($content);
+ $uri = $this->getImageUri($value);
+
+ $content = file_get_contents($uri);
+ if (false === $content) {
+ throw new RuntimeException(
+ sprintf(
+ 'Failed to read data from "%s"',
+ $uri
+ )
+ );
+ }
+
+ $response = $this->createResponse(
+ $content,
+ $this->getImageFileName($value)
+ );
+
+ $response->headers->set('Content-Type', $value->mime);
+
+ return $response;
+ }
+
+ /**
+ * @param array<\Ibexa\Contracts\Core\Repository\Values\Content\Content> $contentList
+ *
+ * @throws \Random\RandomException
+ */
+ private function downloadArchiveWithImages(array $contentList): Response
+ {
+ $archiveName = sprintf(
+ self::ARCHIVE_NAME_PATTERN,
+ $this->generateRandomFileName()
+ );
+
+ $this->createArchive($archiveName, $contentList);
+
+ $content = file_get_contents($archiveName);
+ if (false === $content) {
+ throw new RuntimeException('Failed to read archive with images.');
+ }
+
+ $fileName = $this->formatter->format(new DateTimeImmutable()) . self::EXTENSION_ZIP;
+ $response = $this->createResponse($content, $fileName);
+ $response->headers->set('Content-Type', 'application/zip');
+
+ unlink($archiveName);
+
+ return $response;
+ }
+
+ private function getImageValue(Content $content): Value
+ {
+ $imageFieldIdentifier = $this->getImageFieldIdentifier($content->getContentType()->identifier);
+ $value = $content->getFieldValue($imageFieldIdentifier);
+
+ if (null === $value) {
+ throw new RuntimeException(
+ sprintf(
+ 'Missing field with identifier: "%s"',
+ $imageFieldIdentifier
+ )
+ );
+ }
+
+ if (!$value instanceof Value) {
+ throw new RuntimeException(
+ sprintf(
+ 'Field value should be of type %s. "%s" given.',
+ Value::class,
+ get_debug_type($value)
+ )
+ );
+ }
+
+ return $value;
+ }
+
+ private function getImageFieldIdentifier(string $contentTypeIdentifier): string
+ {
+ $imageFieldIdentifier = $this->imageMappings[$contentTypeIdentifier]['imageFieldIdentifier'];
+ if (null === $imageFieldIdentifier) {
+ throw new RuntimeException(
+ sprintf(
+ 'Missing key imageFieldIdentifier for content type mapping "%s".',
+ $contentTypeIdentifier
+ )
+ );
+ }
+
+ return $imageFieldIdentifier;
+ }
+
+ private function getImageUri(Value $value): string
+ {
+ $uri = $value->uri;
+ if (null === $uri) {
+ throw new RuntimeException('Missing image uri');
+ }
+
+ return ltrim($uri, '/');
+ }
+
+ /**
+ * @throws \Random\RandomException
+ */
+ private function getImageFileName(Value $value): string
+ {
+ return $value->fileName ?? 'image_' . $this->generateRandomFileName();
+ }
+
+ /**
+ * @param array<int> $contentIdList
+ *
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException;
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidCriterionArgumentException;
+ */
+ private function loadImages(array $contentIdList): SearchResult
+ {
+ $query = new Query();
+ $query->filter = new Query\Criterion\LogicalAnd(
+ [
+ new Query\Criterion\ContentId($contentIdList),
+ new Query\Criterion\ContentTypeIdentifier($this->getContentTypeIdentifiers()),
+ ]
+ );
+ $query->limit = $this->downloadLimit;
+
+ return $this->searchService->findContent($query, [], false);
+ }
+
+ /**
+ * @return array<string>
+ */
+ private function getContentTypeIdentifiers(): array
+ {
+ $contentTypeIdentifiers = [];
+ foreach ($this->imageMappings as $contentTypeIdentifier => $mapping) {
+ $contentTypeIdentifiers[] = $contentTypeIdentifier;
+ }
+
+ return $contentTypeIdentifiers;
+ }
+
+ private function createResponse(
+ string $content,
+ string $fileName
+ ): Response {
+ $disposition = HeaderUtils::makeDisposition(
+ HeaderUtils::DISPOSITION_ATTACHMENT,
+ $fileName
+ );
+
+ return new Response(
+ $content,
+ 200,
+ [
+ 'Content-Disposition' => $disposition,
+ 'Content-Length' => strlen($content),
+ ]
+ );
+ }
+
+ /**
+ * @param array<\Ibexa\Contracts\Core\Repository\Values\Content\Content> $contentList
+ *
+ * @throws \Random\RandomException
+ */
+ private function createArchive(string $name, array $contentList): void
+ {
+ $zipArchive = new ZipArchive();
+ $zipArchive->open($name, ZipArchive::CREATE);
+
+ foreach ($contentList as $content) {
+ $value = $this->getImageValue($content);
+ $zipArchive->addFile(
+ $this->getImageUri($value),
+ $this->getImageFileName($value)
+ );
+ }
+
+ $zipArchive->close();
+ }
+
+ /**
+ * @throws \Random\RandomException
+ */
+ private function generateRandomFileName(): string
+ {
+ return bin2hex(random_bytes(12));
+ }
+}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Controller/NotificationController.php vendor-4.6.7/ibexa/admin-ui/src/bundle/Controller/NotificationController.php
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Controller/NotificationController.php 2024-07-02 10:19:28.412331807 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Controller/NotificationController.php 2024-07-02 10:23:24.951906975 +0200
@@ -108,6 +108,7 @@
'page' => $page,
'pagination' => $pagination,
'notifications' => $notifications,
+ 'notifications_count_interval' => $this->configResolver->getParameter('notification_count.interval'),
'pager' => $pagerfanta,
])->getContent());
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/DependencyInjection/Configuration/Parser/Notifications.php vendor-4.6.7/ibexa/admin-ui/src/bundle/DependencyInjection/Configuration/Parser/Notifications.php
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/DependencyInjection/Configuration/Parser/Notifications.php 2024-07-02 10:19:28.412331807 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/DependencyInjection/Configuration/Parser/Notifications.php 2024-07-02 10:23:24.951906975 +0200
@@ -17,12 +17,14 @@
*
* Example configuration:
* ```yaml
- * ezpublish:
+ * ibexa:
* system:
* admin_group: # configuration per siteaccess or siteaccess group
* notifications:
* warning: # type of notification
* timeout: 5000 # in milliseconds
+ * notification_count:
+ * interval: 60000 # in milliseconds
* ```
*/
class Notifications extends AbstractParser
@@ -32,26 +34,31 @@
*/
public function mapConfig(array &$scopeSettings, $currentScope, ContextualizerInterface $contextualizer)
{
- if (empty($scopeSettings['notifications'])) {
- return;
- }
+ if (!empty($scopeSettings['notifications'])) {
+ $settings = $scopeSettings['notifications'];
+ $nodes = ['timeout'];
- $settings = $scopeSettings['notifications'];
- $nodes = ['timeout'];
+ foreach ($settings as $type => $config) {
+ foreach ($nodes as $key) {
+ if (!isset($config[$key]) || empty($config[$key])) {
+ continue;
+ }
- foreach ($settings as $type => $config) {
- foreach ($nodes as $key) {
- if (!isset($config[$key]) || empty($config[$key])) {
- continue;
+ $contextualizer->setContextualParameter(
+ sprintf('notifications.%s.%s', $type, $key),
+ $currentScope,
+ $config[$key]
+ );
}
-
- $contextualizer->setContextualParameter(
- sprintf('notifications.%s.%s', $type, $key),
- $currentScope,
- $config[$key]
- );
}
}
+ if (!empty($scopeSettings['notification_count']) && !empty($scopeSettings['notification_count']['interval'])) {
+ $contextualizer->setContextualParameter(
+ 'notification_count.interval',
+ $currentScope,
+ $scopeSettings['notification_count']['interval']
+ );
+ }
}
/**
@@ -70,6 +77,13 @@
->end()
->end()
->end()
+ ->end()
+ ->arrayNode('notification_count')
+ ->children()
+ ->scalarNode('interval')
+ ->info('Time in milliseconds between notification count refreshment.')
+ ->end()
+ ->end()
->end();
}
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/config/default_parameters.yaml vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/config/default_parameters.yaml
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/config/default_parameters.yaml 2024-07-02 10:19:28.413331809 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/config/default_parameters.yaml 2024-07-02 10:23:24.951906975 +0200
@@ -81,10 +81,17 @@
ibexa.site_access.config.default.admin_ui.default_focus_mode: '1'
- ibexa.dam_widget.image.field_definition_identifiers: [image]
- ibexa.dam_widget.image.content_type_identifiers: [image]
+ #### DAM WIDGET
+ ibexa.dam_widget.image.mappings:
+ image:
+ imageFieldIdentifier: image
+
ibexa.dam_widget.image.aggregations:
KeywordTermAggregation:
name: keywords
contentTypeIdentifier: image
fieldDefinitionIdentifier: tags
+
+ ibexa.dam_widget.image.download_limit: 25
+
+ ibexa.dam_widget.folder.content_type_identifier: folder
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/config/ezplatform_default_settings.yaml vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/config/ezplatform_default_settings.yaml
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/config/ezplatform_default_settings.yaml 2024-07-02 10:19:28.413331809 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/config/ezplatform_default_settings.yaml 2024-07-02 10:23:24.951906975 +0200
@@ -15,6 +15,7 @@
ibexa.site_access.config.admin_group.pagination.role_assignment_limit: 10
ibexa.site_access.config.admin_group.pagination.policy_limit: 10
ibexa.site_access.config.admin_group.pagination.version_draft_limit: 5
+ ibexa.site_access.config.admin_group.pagination.relation_limit: 10
ibexa.site_access.config.admin_group.pagination.reverse_relation_limit: 10
ibexa.site_access.config.admin_group.pagination.content_system_url_limit: 5
ibexa.site_access.config.admin_group.pagination.content_custom_url_limit: 5
@@ -43,6 +44,7 @@
ibexa.site_access.config.admin_group.subtree_operations.copy_subtree.limit: 100
# Notifications
+ ibexa.site_access.config.admin_group.notification_count.interval: 30000
ibexa.site_access.config.admin_group.notifications.error.timeout: 0
ibexa.site_access.config.admin_group.notifications.warning.timeout: 0
ibexa.site_access.config.admin_group.notifications.success.timeout: 5000
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/config/routing_rest.yaml vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/config/routing_rest.yaml
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/config/routing_rest.yaml 2024-07-02 10:19:28.413331809 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/config/routing_rest.yaml 2024-07-02 10:23:24.951906975 +0200
@@ -36,6 +36,13 @@
defaults:
_controller: 'Ibexa\Bundle\AdminUi\Controller\Content\ContentTreeController::loadSubtreeAction'
+ibexa.rest.location.tree.load_node_extended_info:
+ path: /location/tree/{locationId}/extended-info
+ methods: ['GET']
+ options:
+ expose: true
+ controller: 'Ibexa\Bundle\AdminUi\Controller\Content\ContentTreeController::loadNodeExtendedInfoAction'
+
#
# Content type create/edit form
#
@@ -112,3 +119,10 @@
methods: [GET]
options:
expose: true
+
+ibexa.rest.image.download:
+ path: /image/download/{contentIdList}
+ controller: 'Ibexa\Bundle\AdminUi\Controller\DownloadImageController::downloadAction'
+ methods: GET
+ requirements:
+ contentIdList: '^\d+(,\d+)*$'
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/config/services/controllers.yaml vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/config/services/controllers.yaml
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/config/services/controllers.yaml 2024-07-02 10:19:28.413331809 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/config/services/controllers.yaml 2024-07-02 10:23:24.951906975 +0200
@@ -244,3 +244,11 @@
autowire: true
tags:
- controller.service_arguments
+
+ Ibexa\Bundle\AdminUi\Controller\DownloadImageController:
+ arguments:
+ $downloadLimit: '%ibexa.dam_widget.image.download_limit%'
+ $formatter: '@ibexa.user.settings.full_datetime_format.formatter'
+ $imageMappings: '%ibexa.dam_widget.image.mappings%'
+ tags:
+ - controller.service_arguments
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/config/services/rest.yaml vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/config/services/rest.yaml
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/config/services/rest.yaml 2024-07-02 10:19:28.413331809 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/config/services/rest.yaml 2024-07-02 10:23:24.951906975 +0200
@@ -38,6 +38,11 @@
tags:
- { name: ibexa.rest.output.value_object.visitor, type: Ibexa\AdminUi\REST\Value\ContentTree\Root }
+ Ibexa\AdminUi\REST\Output\ValueObjectVisitor\ContentTree\NodeExtendedInfoVisitor:
+ parent: Ibexa\Contracts\Rest\Output\ValueObjectVisitor
+ tags:
+ - { name: ibexa.rest.output.value_object.visitor, type: Ibexa\AdminUi\REST\Value\ContentTree\NodeExtendedInfo }
+
#
# Content type create/edit form
#
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/config/services/ui_config/common.yaml vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/config/services/ui_config/common.yaml
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/config/services/ui_config/common.yaml 2024-07-02 10:19:28.413331809 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/config/services/ui_config/common.yaml 2024-07-02 10:23:24.951906975 +0200
@@ -147,9 +147,10 @@
arguments:
$config:
image:
- fieldDefinitionIdentifiers: '%ibexa.dam_widget.image.field_definition_identifiers%'
- contentTypeIdentifiers: '%ibexa.dam_widget.image.content_type_identifiers%'
+ mappings: '%ibexa.dam_widget.image.mappings%'
aggregations: '%ibexa.dam_widget.image.aggregations%'
+ folder:
+ contentTypeIdentifier: '%ibexa.dam_widget.folder.content_type_identifier%'
tags:
- { name: ibexa.admin_ui.config.provider, key: 'damWidget' }
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/_anchor-navigation.scss vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/_anchor-navigation.scss
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/_anchor-navigation.scss 2024-07-02 10:19:28.417331819 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/_anchor-navigation.scss 2024-07-02 10:23:24.954906982 +0200
@@ -15,6 +15,10 @@
}
}
+ &__section-group-header {
+ padding: calculateRem(16px) 0;
+ }
+
&__section-header {
padding-top: calculateRem(64px);
margin-top: calculateRem(64px);
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/_empty-chart.scss vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/_empty-chart.scss
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/_empty-chart.scss 2024-07-02 10:19:28.417331819 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/_empty-chart.scss 2024-07-02 10:23:24.954906982 +0200
@@ -1,5 +1,5 @@
.ibexa-chart-no-data {
- padding: calculateRem(16px);
+ padding: calculateRem(48px) calculateRem(16px);
margin: 0;
&__wrapper {
@@ -16,4 +16,10 @@
font-family: $ibexa-font-family-headings;
color: $ibexa-color-dark-400;
}
+
+ &__img {
+ width: 50%;
+ max-width: calculateRem(400px);
+ max-height: calculateRem(200px);
+ }
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/_extra-actions.scss vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/_extra-actions.scss
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/_extra-actions.scss 2024-07-02 10:19:28.417331819 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/_extra-actions.scss 2024-07-02 10:23:24.954906982 +0200
@@ -138,7 +138,6 @@
}
&__section-content--content-type {
- padding: calculateRem(32px) 0 0 0;
border: none;
}
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/fieldType/edit/_base-field.scss vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/fieldType/edit/_base-field.scss
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/fieldType/edit/_base-field.scss 2024-07-02 10:19:28.418331822 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/fieldType/edit/_base-field.scss 2024-07-02 10:23:24.954906982 +0200
@@ -128,6 +128,7 @@
left: 0;
z-index: 1080;
flex-direction: column;
+ flex-wrap: nowrap;
width: 100vw;
height: 100vh;
margin-top: 0;
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/_instant-filter.scss vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/_instant-filter.scss
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/_instant-filter.scss 2024-07-02 10:19:28.417331819 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/_instant-filter.scss 2024-07-02 10:23:24.954906982 +0200
@@ -1,4 +1,12 @@
.ibexa-instant-filter {
+ &__input-wrapper {
+ margin-top: calculateRem(16px);
+
+ &--hidden {
+ display: none;
+ }
+ }
+
&__input {
display: block;
width: 100%;
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/_main-container.scss vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/_main-container.scss
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/_main-container.scss 2024-07-02 10:19:28.418331822 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/_main-container.scss 2024-07-02 10:23:24.954906982 +0200
@@ -4,7 +4,7 @@
display: flex;
flex-wrap: nowrap;
overflow: hidden;
- height: calc(100vh - #{calculateRem(73px)});
+ height: calc(100vh - #{calculateRem(72px)});
&__content-column {
display: flex;
@@ -112,4 +112,9 @@
flex-direction: column;
flex: 1 1 80%;
}
+
+ ~ .ibexa-notifications-container {
+ right: calculateRem(48px);
+ bottom: calculateRem(16px);
+ }
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/mixins/_drag-and-drop.scss vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/mixins/_drag-and-drop.scss
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/mixins/_drag-and-drop.scss 2024-07-02 10:19:28.418331822 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/mixins/_drag-and-drop.scss 2024-07-02 10:23:24.954906982 +0200
@@ -1,3 +1,8 @@
+:root {
+ --ibexa-hover-color: var(--ibexa-hover-color, $ibexa-color-primary);
+ --ibexa-border-color: var(--ibexa-border-color, $ibexa-color-dark);
+}
+
@mixin drag-module-backdrop-background {
background-image: radial-gradient($ibexa-color-light 0.5px, transparent 0); // 0.5px is needed so that both on HD and Retina we have 1px
background-color: $ibexa-color-light-200;
@@ -290,11 +295,11 @@
cursor: pointer;
&:hover {
- color: $ibexa-color-primary;
+ color: var(--ibexa-hover-color);
#{$self}__toggler {
.ibexa-icon {
- fill: $ibexa-color-primary;
+ fill: var(--ibexa-hover-color);
}
}
}
@@ -330,7 +335,7 @@
&:hover {
#{$self}__content {
- border-color: $ibexa-color-dark;
+ border-color: var(--ibexa-border-color);
transform: scale(1.02) translateX(-10px);
box-shadow: calculateRem(4px) calculateRem(10px) calculateRem(17px) 0 rgba($ibexa-color-info, 0.2);
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/common/_popup.scss vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/common/_popup.scss
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/common/_popup.scss 2024-07-02 10:19:28.418331822 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/common/_popup.scss 2024-07-02 10:23:24.954906982 +0200
@@ -46,4 +46,8 @@
}
}
}
+
+ .ibexa-label--checkbox-radio {
+ padding-left: calculateRem(4px);
+ }
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/common/_simple.dropdown.scss vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/common/_simple.dropdown.scss
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/common/_simple.dropdown.scss 2024-07-02 10:19:28.418331822 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/common/_simple.dropdown.scss 2024-07-02 10:23:24.954906982 +0200
@@ -35,9 +35,12 @@
border-radius: $ibexa-border-radius;
box-shadow: calculateRem(4px) calculateRem(32px) calculateRem(47px) 0 rgba($ibexa-color-info, 0.1);
transition: opacity $ibexa-admin-transition-duration $ibexa-admin-transition;
- opacity: 0;
- height: 0;
- overflow: hidden;
+ transform: scaleX(1);
+
+ &--hidden {
+ transform: scaleX(0);
+ opacity: 0;
+ }
}
&__list-items {
@@ -114,11 +117,6 @@
}
}
- &--expanded .c-simple-dropdown__items {
- opacity: 1;
- height: auto;
- }
-
&--disabled {
opacity: 0.3;
cursor: not-allowed;
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/common/thumbnail.scss vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/common/thumbnail.scss
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/common/thumbnail.scss 2024-07-02 10:19:28.418331822 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/common/thumbnail.scss 2024-07-02 10:23:24.956906987 +0200
@@ -1,5 +1,6 @@
.c-thumbnail {
position: relative;
+ line-height: 1;
&__icon-wrapper {
position: absolute;
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/common/_tooltip.popup.scss vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/common/_tooltip.popup.scss
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/common/_tooltip.popup.scss 2024-07-02 10:19:28.418331822 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/common/_tooltip.popup.scss 2024-07-02 10:23:24.954906982 +0200
@@ -9,6 +9,12 @@
margin: 0;
}
+ &__subtitle {
+ @include modal-subtitle();
+
+ color: $ibexa-color-dark;
+ }
+
&__close {
@include close-button();
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_drop.area.scss vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_drop.area.scss
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_drop.area.scss 2024-07-02 10:19:28.418331822 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_drop.area.scss 2024-07-02 10:23:24.956906987 +0200
@@ -5,21 +5,81 @@
flex-direction: column;
justify-content: center;
align-items: center;
+ padding: calculateRem(47px);
&__message {
+ color: $ibexa-color-dark;
+ margin-bottom: calculateRem(16px);
+ }
+
+ &__message--main {
+ cursor: auto;
+ font-weight: 600;
+ }
+
+ &__message--filesize {
+ margin: calculateRem(16px) 0 0 0;
color: $ibexa-color-dark-400;
- margin-bottom: calculateRem(12px);
+ font-size: $ibexa-text-font-size-medium;
+ }
+
+ &__max-files-size {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ row-gap: calculateRem(8px);
+
+ &--expanded {
+ .c-drop-area {
+ &__max-file-size-item {
+ display: flex;
+ }
- &--main {
- cursor: auto;
- font-weight: bold;
- margin-top: calculateRem(44px);
+ &__max-file-size-toggle-btn {
+ &::after {
+ transform: rotate(-180deg);
+ }
+ }
+ }
}
+ }
+
+ &__max-file-size-item {
+ display: none;
+ gap: calculateRem(4px);
+ justify-content: center;
+ align-items: center;
+ font-size: $ibexa-text-font-size-small;
- &--filesize {
- color: $ibexa-color-dark-300;
+ &:first-child {
font-size: $ibexa-text-font-size-medium;
- margin: calculateRem(12px) 0 calculateRem(44px);
+ display: flex;
+ }
+ }
+
+ &__max-file-size-toggle-btn {
+ width: calculateRem(16px);
+ height: calculateRem(16px);
+ position: relative;
+ display: inline-block;
+ cursor: pointer;
+ border: none;
+
+ &::after {
+ content: '';
+ position: absolute;
+ width: calculateRem(6px);
+ height: calculateRem(3px);
+ top: calc(50% - calculateRem(3px));
+ right: 0;
+ border-left: calculateRem(6px) solid transparent;
+ border-right: calculateRem(6px) solid transparent;
+ border-top: calculateRem(6px) solid $ibexa-color-dark-400;
+ transition: all $ibexa-admin-transition-duration $ibexa-admin-transition;
}
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_progress.bar.scss vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_progress.bar.scss
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_progress.bar.scss 2024-07-02 10:19:28.418331822 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_progress.bar.scss 2024-07-02 10:23:24.956906987 +0200
@@ -9,13 +9,13 @@
border-radius: calculateRem(4px);
transition: width 0.2s linear;
height: calculateRem(8px);
- width: 10vw;
+ width: calculateRem(176px);
position: relative;
&::after {
content: '';
width: calc(100% - var(--progress));
- height: calculateRem(10px);
+ height: calculateRem(11px);
border-radius: calculateRem(4px);
position: absolute;
right: 0;
@@ -29,7 +29,7 @@
}
&__label {
- font-size: $ibexa-text-font-size-small;
+ font-size: $ibexa-text-font-size-medium;
color: $ibexa-color-dark-400;
}
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_upload.item.scss vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_upload.item.scss
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_upload.item.scss 2024-07-02 10:19:28.418331822 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_upload.item.scss 2024-07-02 10:23:24.956906987 +0200
@@ -1,20 +1,39 @@
.c-upload-list-item {
display: flex;
+ flex-wrap: wrap;
background: $ibexa-color-white;
- padding: calculateRem(8px) 0;
- min-height: calculateRem(60px);
+ padding: 0;
+ margin: calculateRem(12px) 0;
+ height: calculateRem(48px);
&--errored {
- background: $ibexa-color-danger-100;
- color: $ibexa-color-danger;
+ background: $ibexa-color-danger-200;
+ color: $ibexa-color-danger-600;
border-radius: $ibexa-border-radius;
.ibexa-icon {
- fill: $ibexa-color-danger;
+ fill: $ibexa-color-danger-600;
}
.c-upload-list-item__size {
- color: $ibexa-color-danger;
+ color: $ibexa-color-danger-600;
+ }
+ }
+
+ &--expanded-multiple-errors {
+ padding-bottom: 0;
+ height: auto;
+
+ .c-upload-list-item {
+ &__multiple-errors-list {
+ display: block;
+ padding: calculateRem(4px) 0 calculateRem(8px) calculateRem(26px);
+ margin-top: calculateRem(4px);
+ }
+
+ &__multiple-errors-toggle-btn {
+ transform: rotate(180deg);
+ }
}
}
@@ -26,26 +45,25 @@
}
&__meta {
- padding: 0 calculateRem(16px);
- line-height: 1.4;
+ padding: 0 calculateRem(8px);
max-width: 25vw;
+ height: calculateRem(48px);
display: flex;
justify-content: center;
align-items: center;
}
&__name {
- font-size: calculateRem(16px);
margin-right: calculateRem(8px);
- max-width: 15vw;
+ max-width: calculateRem(172px);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
&__size {
- color: $ibexa-color-dark-300;
- font-size: $ibexa-text-font-size-medium;
+ color: $ibexa-color-dark-400;
+ font-size: $ibexa-text-font-size-small;
}
&__info {
@@ -56,8 +74,8 @@
}
&__message {
- font-style: italic;
- font-size: $ibexa-text-font-size-small;
+ font-size: $ibexa-text-font-size-medium;
+ line-height: $ibexa-text-font-size-medium;
.ibexa-icon {
margin-right: calculateRem(4px);
@@ -70,6 +88,14 @@
fill: $ibexa-color-success;
}
}
+
+ &--error {
+ display: flex;
+ align-items: center;
+ font-size: $ibexa-text-font-size-small;
+ line-height: $ibexa-text-font-size-small;
+ padding-right: calculateRem(32px);
+ }
}
&__actions {
@@ -93,4 +119,27 @@
margin-right: 0;
}
}
+
+ &__multiple-errors-toggle-btn {
+ border: none;
+ outline: none;
+ margin: 0 0 0 calculateRem(8px);
+ padding: 0;
+ transition: all $ibexa-admin-transition-duration $ibexa-admin-transition;
+ }
+
+ &__multiple-errors-list {
+ display: none;
+ flex-basis: 100%;
+ background: $ibexa-color-danger-100;
+ padding: 0;
+ margin: 0;
+ list-style: none;
+ border-radius: 0 0 $ibexa-border-radius $ibexa-border-radius;
+ }
+
+ &__multiple-errors-item {
+ margin: calculateRem(4px) 0;
+ font-size: $ibexa-text-font-size-medium;
+ }
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_upload.list.scss vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_upload.list.scss
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_upload.list.scss 2024-07-02 10:19:28.418331822 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_upload.list.scss 2024-07-02 10:23:24.956906987 +0200
@@ -1,14 +1,5 @@
.c-upload-list {
- &__items {
- margin-top: calculateRem(32px);
- padding: calculateRem(16px) 0;
-
- &:not(:empty) {
- border-top: calculateRem(1px) solid $ibexa-color-light-500;
- }
-
- &:last-child {
- padding-bottom: 0;
- }
- }
+ height: 100%;
+ overflow: auto;
+ margin-top: calculateRem(16px);
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_upload.popup.scss vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_upload.popup.scss
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_upload.popup.scss 2024-07-02 10:19:28.418331822 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/muti-file-upload/_upload.popup.scss 2024-07-02 10:23:24.956906987 +0200
@@ -8,32 +8,54 @@
width: 100vw;
color: $ibexa-color-dark;
+ &__label {
+ margin-bottom: calculateRem(8px);
+ color: $ibexa-color-dark-400;
+ font-size: $ibexa-text-font-size-small;
+ line-height: calculateRem(18px);
+ }
+
.c-tooltip-popup {
width: 100%;
- max-width: calculateRem(774px);
+ max-height: 100vh;
+ max-width: calculateRem(800px);
position: absolute;
z-index: 2;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
- padding: 0 calculateRem(24px);
+ overflow: hidden;
&__header {
@include modal-header();
- padding: $modal-header-padding-y $modal-header-padding-x;
- border-bottom: $modal-header-border-width solid $modal-header-border-color;
+ height: calculateRem(92px);
+ padding: calculateRem(32px) calculateRem(32px) 0;
+ margin-bottom: calculateRem(36px);
+ }
+
+ &__title {
+ line-height: calculateRem(42px);
+ }
+
+ &__close {
+ top: 0;
+ }
+
+ &__subtitle {
+ margin-top: calculateRem(8px);
}
&__content {
@include modal-body();
- padding: $modal-inner-padding;
+ padding: 0 calculateRem(32px);
+ max-height: calc(100vh - calculateRem(208px));
+ overflow: auto;
}
- }
- .c-upload-list {
- overflow-y: auto;
- max-height: 30vw;
+ &__footer {
+ padding: calculateRem(16px) calculateRem(32px) calculateRem(32px) calculateRem(32px);
+ }
}
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/universal-discovery/_finder.branch.scss vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/universal-discovery/_finder.branch.scss
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/universal-discovery/_finder.branch.scss 2024-07-02 10:19:28.419331824 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/public/scss/ui/modules/universal-discovery/_finder.branch.scss 2024-07-02 10:23:24.956906987 +0200
@@ -1,7 +1,6 @@
.c-finder-branch {
display: flex;
position: relative;
- padding: calculateRem(18px) 0 calculateRem(18px) calculateRem(8px);
border-right: calculateRem(1px) solid $ibexa-color-light;
&--collapsed {
@@ -53,7 +52,7 @@
&__items-wrapper {
overflow: auto;
width: calculateRem(291px);
- padding-right: calculateRem(8px);
+ padding: calculateRem(8px);
}
&__resize-handler {
@@ -70,6 +69,6 @@
display: flex;
align-items: center;
justify-content: center;
- margin-top: calculateRem(50px);
+ margin: calculateRem(50px) 0;
}
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/account/forgot_password/mail.html.twig vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/account/forgot_password/mail.html.twig
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/account/forgot_password/mail.html.twig 2024-07-02 10:19:28.420331826 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/account/forgot_password/mail.html.twig 2024-07-02 10:23:24.957906990 +0200
@@ -10,7 +10,7 @@
{{ 'ezplatform.forgot_user_password.message'|trans({ '%reset_password%': url('ibexa.user.reset_password', {'hashKey': hash_key}) })|raw
|desc('Hi,
<br /><br />
- We have received a request to reset the password for your eZ Platform account. Click “reset password” below to choose a new password:
+ We have received a request to reset the password for your Ibexa DXP account. Click “reset password” below to choose a new password:
<br /><br />
<a href="%reset_password%">Reset password</a>
<br /><br />
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/account/notifications/list.html.twig vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/account/notifications/list.html.twig
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/account/notifications/list.html.twig 2024-07-02 10:19:28.420331826 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/account/notifications/list.html.twig 2024-07-02 10:23:24.957906990 +0200
@@ -10,6 +10,7 @@
attr: {
'data-notifications': path('ibexa.notifications.render.page'),
'data-notifications-count': path('ibexa.notifications.count'),
+ 'data-notifications-count-interval': notifications_count_interval,
'data-notifications-total': pager.nbResults,
}
} %}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/components/meta_fields.html.twig vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/components/meta_fields.html.twig
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/components/meta_fields.html.twig 2024-07-02 10:19:28.420331826 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/components/meta_fields.html.twig 2024-07-02 10:23:24.957906990 +0200
@@ -1,6 +1,15 @@
{% extends '@ibexadesign/ui/component/anchor_navigation/section_group.html.twig' %}
+{% trans_default_domain 'ibexa_fields_groups' %}
+
{% set data_id = 'ibexa-edit-content-sections-meta' %}
+{% set is_section_visible = show_meta_fields|default(false) %}
+
+{% block header %}
+ {% if show_meta_fields_header|default(false) %}
+ <h2 class="ibexa-anchor-navigation__section-group-header">{{ 'metadata'|trans()|desc('Metadata') }}</h2>
+ {% endif %}
+{% endblock %}
{% block sections %}
{% for identifier in meta_fields %}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/edit/edit.html.twig vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/edit/edit.html.twig
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/edit/edit.html.twig 2024-07-02 10:19:28.420331826 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/edit/edit.html.twig 2024-07-02 10:23:24.957906990 +0200
@@ -77,7 +77,9 @@
'content_type': content_type,
'location': location,
'parent_location': parent_location,
- 'language': language
+ 'language': language,
+ 'show_meta_fields': show_meta_fields|default(false),
+ 'show_meta_fields_header': show_meta_fields_header|default(false),
}) }}
{% endblock %}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/location_view.html.twig vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/location_view.html.twig
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/location_view.html.twig 2024-07-02 10:19:28.420331826 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/location_view.html.twig 2024-07-02 10:23:24.957906990 +0200
@@ -140,6 +140,7 @@
'contentType': content_type,
'draft_pagination_params': draft_pagination_params,
'reverse_relation_pagination_params': reverse_relation_pagination_params,
+ 'relation_pagination_params': relation_pagination_params,
'custom_urls_pagination_params': custom_urls_pagination_params,
'system_urls_pagination_params': system_urls_pagination_params,
'roles_pagination_params': roles_pagination_params,
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/tab/relations/tab.html.twig vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/tab/relations/tab.html.twig
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/tab/relations/tab.html.twig 2024-07-02 10:19:28.420331826 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/tab/relations/tab.html.twig 2024-07-02 10:23:24.957906990 +0200
@@ -1,10 +1,24 @@
{% trans_default_domain 'ibexa_locationview' %}
<section>
- {{ include('@ibexadesign/content/tab/relations/table_relations.html.twig', {
- relations: relations,
- content: content,
- }) }}
+ {% if relation_pager is defined %}
+ {{ include('@ibexadesign/content/tab/relations/table_relations.html.twig', {
+ relations: relation_pager.currentPageResults,
+ content: content,
+ }) }}
+ {% if relation_pager.haveToPaginate %}
+ {% include '@ibexadesign/ui/pagination.html.twig' with {
+ 'pager': relation_pager,
+ 'paginaton_params': {
+ 'routeName': relation_pagination_params.route_name,
+ 'routeParams': relation_pagination_params.route_params|merge({
+ '_fragment': constant('Ibexa\\AdminUi\\Tab\\LocationView\\RelationsTab::URI_FRAGMENT'),
+ }),
+ 'pageParameter': '[page][relation]'
+ }
+ } %}
+ {% endif %}
+ {% endif %}
{% if reverse_relation_pager is defined %}
{{ include('@ibexadesign/content/tab/relations/table_relations_reverse.html.twig', {
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/tab/relations/table_relations.html.twig vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/tab/relations/table_relations.html.twig
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/tab/relations/table_relations.html.twig 2024-07-02 10:19:28.421331829 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/tab/relations/table_relations.html.twig 2024-07-02 10:23:24.957906990 +0200
@@ -6,36 +6,46 @@
{% if relations is not empty %}
{% for relation in relations %}
{% set body_row_cols = [] %}
- {% set destination = relation.destinationContentInfo %}
-
- {% set col_raw %}
- {% if destination.mainLocationId is not null %}
- <a href="{{ path('ibexa.content.view', { 'contentId': destination.id, 'locationId': relation.resolvedDestinationLocation.id }) }}">
+ {% if relation.isAccessible %}
+ {% set destination = relation.destinationContentInfo %}
+ {% set col_raw %}
+ {% if destination.mainLocationId is not null %}
+ <a href="{{ path('ibexa.content.view', { 'contentId': destination.id, 'locationId': relation.resolvedDestinationLocation.id }) }}">
+ {{ ibexa_content_name(destination) }}
+ </a>
+ {% else %}
{{ ibexa_content_name(destination) }}
- </a>
- {% else %}
- {{ ibexa_content_name(destination) }}
- {% endif %}
- {% endset %}
- {% set body_row_cols = body_row_cols|merge([{
- content: col_raw,
- raw: true,
- }]) %}
-
- {% set body_row_cols = body_row_cols|merge([
- { content: content_types[destination.contentTypeId].name },
- ]) %}
-
- {% set col_raw %}
- {{ macros.relation_type(relation) }}
- {% if (relation.relationFieldDefinitionName) %}
- ({{ relation.relationFieldDefinitionName }})
- {% endif %}
- {% endset %}
- {% set body_row_cols = body_row_cols|merge([{
- content: col_raw,
- raw: true,
- }]) %}
+ {% endif %}
+ {% endset %}
+ {% set body_row_cols = body_row_cols|merge([{
+ content: col_raw,
+ raw: true,
+ }]) %}
+
+ {% set body_row_cols = body_row_cols|merge([
+ { content: content_types[destination.contentTypeId].name },
+ ]) %}
+
+ {% set col_raw %}
+ {{ macros.relation_type(relation) }}
+ {% if (relation.relationFieldDefinitionName) %}
+ ({{ relation.relationFieldDefinitionName }})
+ {% endif %}
+ {% endset %}
+ {% set body_row_cols = body_row_cols|merge([{
+ content: col_raw,
+ raw: true,
+ }]) %}
+ {% else %}
+ {% set body_row_cols = body_row_cols|merge([{
+ attr: { colspan: 8 },
+ content: 'dashboard.table.relation.unauthorized'|trans({
+ '%module%': relation.unauthorizedRelation.module,
+ '%function%': relation.unauthorizedRelation.function,
+ '%contentId%': relation.unauthorizedRelation.payload.contentId,
+ })|desc('You do not have the \'%function%\' \'%module%\' permission for content ID: %contentId%'),
+ }]) %}
+ {% endif %}
{% set body_rows = body_rows|merge([{ cols: body_row_cols }]) %}
{% endfor %}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/widget/content_create.html.twig vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/widget/content_create.html.twig
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/widget/content_create.html.twig 2024-07-02 10:19:28.421331829 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/content/widget/content_create.html.twig 2024-07-02 10:23:24.957906990 +0200
@@ -25,10 +25,17 @@
{{ form_widget(form.language, {'attr': {'class': 'form-control'}}) }}
{% endif %}
</div>
-
+
<div class="ibexa-extra-actions__section-content ibexa-extra-actions__section-content--content-type">
<div class="ibexa-instant-filter">
- <div class="ibexa-instant-filter__input-wrapper">
+ {% set minimum_items_count_for_search_to_appear = 10 %}
+ <div
+ class="
+ ibexa-instant-filter__input-wrapper
+ {% if form.content_type.children|length <= minimum_items_count_for_search_to_appear %}
+ ibexa-instant-filter__input-wrapper--hidden
+ {% endif %}"
+ >
<input
type="text"
class="ibexa-instant-filter__input ibexa-input ibexa-input--text form-control"
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/component/anchor_navigation/section_group.html.twig vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/component/anchor_navigation/section_group.html.twig
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/component/anchor_navigation/section_group.html.twig 2024-07-02 10:19:28.421331829 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/component/anchor_navigation/section_group.html.twig 2024-07-02 10:23:24.957906990 +0200
@@ -1,8 +1,10 @@
<div
- class="ibexa-anchor-navigation__section-group"
+ class="ibexa-anchor-navigation__section-group
+ {% if is_section_visible|default(false) %}ibexa-anchor-navigation__section-group--active{% endif %}"
data-id="#{{ data_id }}"
>
<div class="ibexa-anchor-navigation-sections">
+ {% block header %}{% endblock %}
{% block sections %}{% endblock %}
</div>
</div>
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/component/sub_items/multifile_upload.html.twig vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/component/sub_items/multifile_upload.html.twig
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/component/sub_items/multifile_upload.html.twig 2024-07-02 10:19:28.421331829 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/component/sub_items/multifile_upload.html.twig 2024-07-02 10:23:24.957906990 +0200
@@ -3,5 +3,6 @@
data-parent-location-path="{{ location.pathString }}"
data-parent-content-type-identifier="{{ contentType.identifier }}"
data-parent-content-type-id="{{ contentType.id }}"
+ data-parent-name="{{ location.contentInfo.name }}"
data-current-language="{{ app.request.get('languageCode') ?: content.prioritizedFieldLanguageCode }}"
></div>
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/component/tab/tabs_header.html.twig vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/component/tab/tabs_header.html.twig
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/component/tab/tabs_header.html.twig 2024-07-02 10:19:28.421331829 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/component/tab/tabs_header.html.twig 2024-07-02 10:23:24.957906990 +0200
@@ -3,8 +3,11 @@
{% set tabs_attr = tabs_attr|default({})|merge({
class: (tabs_attr.class|default('') ~ ' ibexa-tabs')|trim,
}) %}
+{% set header_attr = attr|default({})|merge({
+ class: (attr.class|default('') ~ ' ibexa-header')|trim,
+}) %}
-<div class="ibexa-header">
+<div {{ html.attributes(header_attr) }}>
<div {{ html.attributes(tabs_attr) }}>
<ul class="nav nav-tabs ibexa-tabs__list ibexa-adaptive-items" role="tablist">
{% block tabs_list %}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/field_type/preview/content_fields.html.twig vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/field_type/preview/content_fields.html.twig
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/field_type/preview/content_fields.html.twig 2024-07-02 10:19:28.421331829 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/field_type/preview/content_fields.html.twig 2024-07-02 10:23:24.957906990 +0200
@@ -443,10 +443,12 @@
<td>{{ 'ezimage.master_dimensions'|trans|desc('Master dimensions') }}:</td>
<td>{{ 'ezimage.width_and_height'|trans({'%width%': field.value.width, '%height%': field.value.height})|desc('Width: %width%px height: %height%px') }}</td>
</tr>
- <tr class="ibexa-field-preview__meta-value-row">
- <td>{{ 'ezimage.ratio'|trans|desc('Ratio') }}:</td>
- <td>{{ (field.value.width/field.value.height)|round(2) }}</td>
- </tr>
+ {% if field.value.height != '0' %}
+ <tr class="ibexa-field-preview__meta-value-row">
+ <td>{{ 'ezimage.ratio'|trans|desc('Ratio') }}:</td>
+ <td>{{ (field.value.width/field.value.height)|round(2) }}</td>
+ </tr>
+ {% endif %}
</tbody>
</table>
</div>
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/menu/user.html.twig vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/menu/user.html.twig
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/menu/user.html.twig 2024-07-02 10:19:28.421331829 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/menu/user.html.twig 2024-07-02 10:23:24.957906990 +0200
@@ -15,6 +15,7 @@
</svg>
<span class="ibexa-header-user-menu__notice-dot ibexa-header-user-menu__notice-dot--no-notice"></span>
</div>
+ {{ ibexa_render_component_group('header-user-menu-middle') }}
<button class="ibexa-header-user-menu__toggler">
<div class="ibexa-header-user-menu__thumbnail-wrapper">
{% include '@ibexadesign/ui/component/user_thumbnail/user_thumbnail.html.twig' with {
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/search/spellcheck.html.twig vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/search/spellcheck.html.twig
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/search/spellcheck.html.twig 2024-07-02 10:19:28.421331829 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/ui/search/spellcheck.html.twig 2024-07-02 10:23:24.958906992 +0200
@@ -2,11 +2,11 @@
{% if spellcheck is not null and spellcheck.incorrect %}
<div class="ibexa-search-form__spellcheck-suggestion">
- {% set suggestion_link %}
+ {%- set suggestion_link -%}
<a href="{{ path('ibexa.search', app.request.query|merge({'search[query]': spellcheck.query})) }}">
- {{ spellcheck.query }}
+ {{- spellcheck.query|spaceless -}}
</a>
- {% endset %}
+ {%- endset -%}
{{ 'search.spellcheck.suggestion'|trans|desc('Did you mean %s?')|e('html')|format(suggestion_link)|raw }}
</div>
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/user/role_assignment/create.html.twig vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/user/role_assignment/create.html.twig
--- vendor-4.6.2/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/user/role_assignment/create.html.twig 2024-07-02 10:19:28.421331829 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/bundle/Resources/views/themes/admin/user/role_assignment/create.html.twig 2024-07-02 10:23:24.958906992 +0200
@@ -34,9 +34,9 @@
id: user.content.versionInfo.contentInfo.id,
name: ibexa_content_name(user)
}) %}
- {% set items_map = form.users.vars.data|reduce((output, user) => output|merge({
- "{{user.content.versionInfo.contentInfo.id}}": user.id
- }), {}) %}
+ {% set items_map = form.users.vars.data|reduce((output, user) => output + {
+ (user.id): user.content.versionInfo.contentInfo.mainLocationId,
+ }, {}) %}
{% set users_udw_title = "role_assignment.view.add.panel.users_and_groups.users.udw_title"
|trans({}, 'ibexa_role')
|desc("Select Users to assign to the Role") %}
@@ -66,9 +66,9 @@
id: group.content.versionInfo.contentInfo.id,
name: ibexa_content_name(group.content)
}) %}
- {% set items_map = form.groups.vars.data|reduce((output, group) => output|merge({
- "{{group.content.versionInfo.contentInfo.i}}": group.id
- }), {}) %}
+ {% set items_map = form.groups.vars.data|reduce((output, group) => output + {
+ (group.id): group.content.versionInfo.contentInfo.mainLocationId,
+ }, {}) %}
{% set groups_udw_title = "role_assignment.view.add.panel.users_and_groups.groups.udw_title"
|trans({}, 'ibexa_role')
|desc("Select User Groups to assign to the Role") %}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/contracts/Permission/PermissionCheckerInterface.php vendor-4.6.7/ibexa/admin-ui/src/contracts/Permission/PermissionCheckerInterface.php
--- vendor-4.6.2/ibexa/admin-ui/src/contracts/Permission/PermissionCheckerInterface.php 2024-07-02 10:19:28.424331836 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/contracts/Permission/PermissionCheckerInterface.php 2024-07-02 10:23:24.959906995 +0200
@@ -41,7 +41,7 @@
* @deprecated 4.6.0 The "\Ibexa\Contracts\AdminUi\Permission\PermissionCheckerInterface::getContentUpdateLimitations()" method is deprecated, will be removed in 5.0.
* Use { @see \Ibexa\AdminUi\Permission\LimitationResolverInterface::getContentUpdateLimitations } instead.
*/
- public function getContentUpdateLimitations(Location $parentLocation): LookupLimitationResult;
+ public function getContentUpdateLimitations(Location $location): LookupLimitationResult;
}
class_alias(PermissionCheckerInterface::class, 'EzSystems\EzPlatformAdminUi\Permission\PermissionCheckerInterface');
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/Behat/Component/ContentTypePicker.php vendor-4.6.7/ibexa/admin-ui/src/lib/Behat/Component/ContentTypePicker.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/Behat/Component/ContentTypePicker.php 2024-07-02 10:19:28.424331836 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/Behat/Component/ContentTypePicker.php 2024-07-02 10:23:24.960906997 +0200
@@ -17,6 +17,8 @@
{
private IbexaDropdown $ibexaDropdown;
+ public const MINIMUM_ITEMS_COUNT_FOR_SEARCH_INPUT = 10;
+
public function __construct(Session $session, IbexaDropdown $ibexaDropdown)
{
parent::__construct($session);
@@ -26,12 +28,21 @@
public function select(string $contentTypeName): void
{
$countBeforeFiltering = $this->getDisplayedItemsCount();
- $this->getHTMLPage()->find($this->getLocator('filterInput'))->setValue($contentTypeName);
- $this->getHTMLPage()->setTimeout(3)->waitUntil(function () use ($countBeforeFiltering) {
- return $countBeforeFiltering === 1 || $this->getDisplayedItemsCount() < $countBeforeFiltering;
- }, 'The number of displayed content types did not decrease after filtering.');
+ if ($countBeforeFiltering > self::MINIMUM_ITEMS_COUNT_FOR_SEARCH_INPUT) {
+ $this->getHTMLPage()->find($this->getLocator('filterInput'))->clear();
+ $this->getHTMLPage()->find($this->getLocator('filterInput'))->setValue($contentTypeName);
+ $this->getHTMLPage()->setTimeout(3)->waitUntil(function () use ($countBeforeFiltering) {
+ return $this->getDisplayedItemsCount() < $countBeforeFiltering;
+ }, 'The number of displayed content types did not decrease after filtering.');
+ }
+
+ $this->clickOnItem($contentTypeName);
+ }
+
+ public function clickOnItem(string $contentTypeName): void
+ {
$this->getHTMLPage()
- ->findAll($this->getLocator('filteredItem'))
+ ->findAll($this->getLocator('contentTypeItem'))
->getByCriterion(new ElementTextCriterion($contentTypeName))
->click();
}
@@ -44,13 +55,12 @@
protected function getDisplayedItemsCount(): int
{
- return $this->getHTMLPage()->findAll($this->getLocator('filteredItem'))->count();
+ return $this->getHTMLPage()->findAll($this->getLocator('contentTypeItem'))->count();
}
public function verifyIsLoaded(): void
{
$this->getHTMLPage()->setTimeout(3)->find($this->getLocator('header'))->assert()->textEquals('Create content');
- $this->getHTMLPage()->find($this->getLocator('filterInput'))->clear();
}
public function confirm(): void
@@ -62,7 +72,7 @@
{
return [
new VisibleCSSLocator('filterInput', '.ibexa-content-menu-wrapper .ibexa-extra-actions__section-content--content-type .ibexa-instant-filter__input, .c-udw-tab .ibexa-extra-actions__section-content--content-type .ibexa-instant-filter__input'),
- new VisibleCSSLocator('filteredItem', '.ibexa-content-menu-wrapper .ibexa-extra-actions__section-content--content-type .ibexa-instant-filter__group-item:not([hidden]) .form-check-label, .c-udw-tab .ibexa-extra-actions__section-content--content-type .ibexa-instant-filter__group-item:not([hidden]) .form-check-label'),
+ new VisibleCSSLocator('contentTypeItem', '.ibexa-content-menu-wrapper .ibexa-extra-actions__section-content--content-type .ibexa-instant-filter__group-item:not([hidden]) .form-check-label, .c-udw-tab .ibexa-extra-actions__section-content--content-type .ibexa-instant-filter__group-item:not([hidden]) .form-check-label'),
new VisibleCSSLocator('header', '.ibexa-content-menu-wrapper .ibexa-extra-actions--create .ibexa-extra-actions__header h2'),
new VisibleCSSLocator('languageDropdown', '.ibexa-content-menu-wrapper .ibexa-dropdown__selection-info'),
new VisibleCSSLocator('createButton', '.c-content-create__confirm-button, [id="content_create_create"]'),
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/Behat/Page/AdminUpdateItemPage.php vendor-4.6.7/ibexa/admin-ui/src/lib/Behat/Page/AdminUpdateItemPage.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/Behat/Page/AdminUpdateItemPage.php 2024-07-02 10:19:28.424331836 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/Behat/Page/AdminUpdateItemPage.php 2024-07-02 10:23:24.960906997 +0200
@@ -85,7 +85,7 @@
new VisibleCSSLocator('closeButton', '.ibexa-content-edit-container__close'),
new VisibleCSSLocator('button', '.container button'),
new VisibleCSSLocator('tab', '.ibexa-anchor-navigation-menu__sections-item'),
- new VisibleCSSLocator('fieldInput', 'input'),
+ new VisibleCSSLocator('fieldInput', 'input,textarea'),
];
}
@@ -94,6 +94,6 @@
return $this->getHTMLPage()
->findAll(new XPathLocator('input', '//label/..'))
->getByCriterion(new ChildElementTextCriterion(new VisibleCSSLocator('input', 'label'), $fieldName))
- ->find(new VisibleCSSLocator('input', 'input'));
+ ->find($this->getLocator('fieldInput'));
}
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/Event/AddContentTypeGroupToUIConfigEvent.php vendor-4.6.7/ibexa/admin-ui/src/lib/Event/AddContentTypeGroupToUIConfigEvent.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/Event/AddContentTypeGroupToUIConfigEvent.php 1970-01-01 01:00:00.000000000 +0100
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/Event/AddContentTypeGroupToUIConfigEvent.php 2024-07-02 10:23:24.960906997 +0200
@@ -0,0 +1,40 @@
+<?php
+
+/**
+ * @copyright Copyright (C) Ibexa AS. All rights reserved.
+ * @license For full copyright and license information view LICENSE file distributed with this source code.
+ */
+declare(strict_types=1);
+
+namespace Ibexa\AdminUi\Event;
+
+use Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeGroup;
+use Symfony\Contracts\EventDispatcher\Event;
+
+final class AddContentTypeGroupToUIConfigEvent extends Event
+{
+ /** @var array<\Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeGroup> */
+ private array $contentTypeGroups;
+
+ /**
+ * @param array<\Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeGroup> $contentTypeGroups
+ */
+ public function __construct(array $contentTypeGroups)
+ {
+ $this->contentTypeGroups = $contentTypeGroups;
+ }
+
+ /**
+ * @return array<\Ibexa\Contracts\Core\Repository\Values\ContentType\ContentTypeGroup>
+ */
+ public function getContentTypeGroups(): array
+ {
+ return $this->contentTypeGroups;
+ }
+
+ public function addContentTypeGroup(
+ ContentTypeGroup $contentTypeGroup
+ ): void {
+ $this->contentTypeGroups[] = $contentTypeGroup;
+ }
+}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/EventListener/InContextTranslationListener.php vendor-4.6.7/ibexa/admin-ui/src/lib/EventListener/InContextTranslationListener.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/EventListener/InContextTranslationListener.php 2024-07-02 10:19:28.424331836 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/EventListener/InContextTranslationListener.php 2024-07-02 10:23:24.960906997 +0200
@@ -59,7 +59,7 @@
return;
}
- $inContextSetting = $this->userSettingService->getUserSetting('in_context_translation')->value;
+ $inContextSetting = $this->userSettingService->getUserSetting('in_context_translation')->getValue();
if ($inContextSetting !== InContextTranslation::ENABLED_OPTION) {
return;
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/Pagination/Pagerfanta/RelationAdapter.php vendor-4.6.7/ibexa/admin-ui/src/lib/Pagination/Pagerfanta/RelationAdapter.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/Pagination/Pagerfanta/RelationAdapter.php 1970-01-01 01:00:00.000000000 +0100
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/Pagination/Pagerfanta/RelationAdapter.php 2024-07-02 10:23:24.960906997 +0200
@@ -0,0 +1,51 @@
+<?php
+
+/**
+ * @copyright Copyright (C) Ibexa AS. All rights reserved.
+ * @license For full copyright and license information view LICENSE file distributed with this source code.
+ */
+declare(strict_types=1);
+
+namespace Ibexa\AdminUi\Pagination\Pagerfanta;
+
+use Ibexa\AdminUi\UI\Dataset\DatasetFactory;
+use Ibexa\Contracts\Core\Repository\ContentService;
+use Ibexa\Contracts\Core\Repository\Values\Content\Content;
+use Pagerfanta\Adapter\AdapterInterface;
+
+final class RelationAdapter implements AdapterInterface
+{
+ private ContentService $contentService;
+
+ private DatasetFactory $datasetFactory;
+
+ private Content $content;
+
+ public function __construct(
+ ContentService $contentService,
+ DatasetFactory $datasetFactory,
+ Content $content
+ ) {
+ $this->contentService = $contentService;
+ $this->datasetFactory = $datasetFactory;
+ $this->content = $content;
+ }
+
+ public function getNbResults(): int
+ {
+ return $this->contentService->countRelations($this->content->getVersionInfo());
+ }
+
+ /**
+ * @return \Ibexa\AdminUi\UI\Value\Content\RelationInterface[]
+ *
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException
+ */
+ public function getSlice($offset, $length): array
+ {
+ return $this->datasetFactory
+ ->relationList()
+ ->load($this->content, $offset, $length)
+ ->getRelations();
+ }
+}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/REST/Input/Parser/ContentTree/LoadSubtreeRequest.php vendor-4.6.7/ibexa/admin-ui/src/lib/REST/Input/Parser/ContentTree/LoadSubtreeRequest.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/REST/Input/Parser/ContentTree/LoadSubtreeRequest.php 2024-07-02 10:19:28.424331836 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/REST/Input/Parser/ContentTree/LoadSubtreeRequest.php 2024-07-02 10:23:24.960906997 +0200
@@ -9,14 +9,15 @@
namespace Ibexa\AdminUi\REST\Input\Parser\ContentTree;
use Ibexa\AdminUi\REST\Value\ContentTree\LoadSubtreeRequest as LoadSubtreeRequestValue;
+use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion;
use Ibexa\Contracts\Rest\Exceptions;
use Ibexa\Contracts\Rest\Input\ParsingDispatcher;
-use Ibexa\Rest\Input\BaseParser;
+use Ibexa\Rest\Server\Input\Parser\Criterion as CriterionParser;
-class LoadSubtreeRequest extends BaseParser
+class LoadSubtreeRequest extends CriterionParser
{
/**
- * {@inheritdoc}
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidCriterionArgumentException
*/
public function parse(array $data, ParsingDispatcher $parsingDispatcher): LoadSubtreeRequestValue
{
@@ -31,7 +32,31 @@
$nodes[] = $parsingDispatcher->parse($node, $node['_media-type']);
}
- return new LoadSubtreeRequestValue($nodes);
+ $filter = null;
+ if (array_key_exists('Filter', $data) && is_array($data['Filter'])) {
+ $filter = $this->processCriteriaArray($data['Filter'], $parsingDispatcher);
+ }
+
+ return new LoadSubtreeRequestValue($nodes, $filter);
+ }
+
+ /**
+ * @param array<string, mixed> $criteriaArray
+ *
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidCriterionArgumentException
+ */
+ private function processCriteriaArray(array $criteriaArray, ParsingDispatcher $parsingDispatcher): ?Criterion
+ {
+ if (count($criteriaArray) === 0) {
+ return null;
+ }
+
+ $criteria = [];
+ foreach ($criteriaArray as $criterionName => $criterionData) {
+ $criteria[] = $this->dispatchCriterion($criterionName, $criterionData, $parsingDispatcher);
+ }
+
+ return (count($criteria) === 1) ? $criteria[0] : new Criterion\LogicalAnd($criteria);
}
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/REST/Output/ValueObjectVisitor/ContentTree/NodeExtendedInfoVisitor.php vendor-4.6.7/ibexa/admin-ui/src/lib/REST/Output/ValueObjectVisitor/ContentTree/NodeExtendedInfoVisitor.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/REST/Output/ValueObjectVisitor/ContentTree/NodeExtendedInfoVisitor.php 1970-01-01 01:00:00.000000000 +0100
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/REST/Output/ValueObjectVisitor/ContentTree/NodeExtendedInfoVisitor.php 2024-07-02 10:23:24.960906997 +0200
@@ -0,0 +1,88 @@
+<?php
+
+/**
+ * @copyright Copyright (C) Ibexa AS. All rights reserved.
+ * @license For full copyright and license information view LICENSE file distributed with this source code.
+ */
+declare(strict_types=1);
+
+namespace Ibexa\AdminUi\REST\Output\ValueObjectVisitor\ContentTree;
+
+use Ibexa\Contracts\Rest\Output\Generator;
+use Ibexa\Contracts\Rest\Output\ValueObjectVisitor;
+use Ibexa\Contracts\Rest\Output\Visitor;
+use Symfony\Component\HttpFoundation\Response;
+
+/**
+ * @phpstan-import-type TPermissionRestrictions from \Ibexa\AdminUi\REST\Value\ContentTree\NodeExtendedInfo
+ */
+final class NodeExtendedInfoVisitor extends ValueObjectVisitor
+{
+ public const MAIN_ELEMENT = 'ContentTreeNodeExtendedInfo';
+
+ /**
+ * @param \Ibexa\AdminUi\REST\Value\ContentTree\NodeExtendedInfo $data
+ */
+ public function visit(Visitor $visitor, Generator $generator, $data): void
+ {
+ $generator->startObjectElement(self::MAIN_ELEMENT);
+ $visitor->setHeader('Content-Type', $generator->getMediaType(self::MAIN_ELEMENT));
+ $visitor->setStatus(Response::HTTP_OK);
+
+ $this->buildPermissionNode($data->getPermissionRestrictions(), $generator);
+ $this->buildPreviewableTranslationsNode($data->getPreviewableTranslations(), $generator);
+
+ $generator->endObjectElement(self::MAIN_ELEMENT);
+ }
+
+ /**
+ * @param string[] $previewableTranslations
+ */
+ protected function buildPreviewableTranslationsNode(
+ array $previewableTranslations,
+ Generator $generator
+ ): void {
+ $generator->startHashElement('previewableTranslations');
+ $generator->startList('values');
+ foreach ($previewableTranslations as $value) {
+ $generator->valueElement('value', $value);
+ }
+ $generator->endList('values');
+ $generator->endHashElement('previewableTranslations');
+ }
+
+ /**
+ * @phpstan-param TPermissionRestrictions $permissionRestrictions
+ */
+ protected function buildPermissionNode(
+ ?array $permissionRestrictions,
+ Generator $generator
+ ): void {
+ if (null === $permissionRestrictions) {
+ return;
+ }
+
+ $generator->startList('permissions');
+
+ foreach ($permissionRestrictions as $function => $restrictions) {
+ $generator->startHashElement('function');
+ $generator->attribute('name', $function);
+ foreach ($restrictions as $restrictionKey => $restrictionValue) {
+ if (is_array($restrictionValue)) {
+ $generator->startHashElement($restrictionKey . 'List');
+ $generator->startList($restrictionKey);
+ foreach ($restrictionValue as $value) {
+ $generator->valueElement('value', $value);
+ }
+ $generator->endList($restrictionKey);
+ $generator->endHashElement($restrictionKey . 'List');
+ } elseif (is_bool($restrictionValue)) {
+ $generator->valueElement($restrictionKey, $generator->serializeBool($restrictionValue));
+ }
+ }
+ $generator->endHashElement('function');
+ }
+
+ $generator->endList('permissions');
+ }
+}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/REST/Output/ValueObjectVisitor/ContentTree/Node.php vendor-4.6.7/ibexa/admin-ui/src/lib/REST/Output/ValueObjectVisitor/ContentTree/Node.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/REST/Output/ValueObjectVisitor/ContentTree/Node.php 2024-07-02 10:19:28.424331836 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/REST/Output/ValueObjectVisitor/ContentTree/Node.php 2024-07-02 10:23:24.960906997 +0200
@@ -41,7 +41,7 @@
$generator->valueElement('translations', implode(',', $data->translations));
- $generator->valueElement('previewableTranslations', implode(',', $data->previewableTranslations));
+ $generator->valueElement('mainLanguageCode', $data->mainLanguageCode);
$generator->startValueElement('name', $data->name);
$generator->endValueElement('name');
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/REST/Value/ContentTree/LoadSubtreeRequest.php vendor-4.6.7/ibexa/admin-ui/src/lib/REST/Value/ContentTree/LoadSubtreeRequest.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/REST/Value/ContentTree/LoadSubtreeRequest.php 2024-07-02 10:19:28.425331839 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/REST/Value/ContentTree/LoadSubtreeRequest.php 2024-07-02 10:23:24.960906997 +0200
@@ -8,19 +8,23 @@
namespace Ibexa\AdminUi\REST\Value\ContentTree;
+use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion;
use Ibexa\Rest\Value as RestValue;
class LoadSubtreeRequest extends RestValue
{
/** @var \Ibexa\AdminUi\REST\Value\ContentTree\LoadSubtreeRequestNode[] */
- public $nodes;
+ public array $nodes;
+
+ public ?Criterion $filter;
/**
* @param array $nodes
*/
- public function __construct(array $nodes = [])
+ public function __construct(array $nodes = [], ?Criterion $filter = null)
{
$this->nodes = $nodes;
+ $this->filter = $filter;
}
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/REST/Value/ContentTree/NodeExtendedInfo.php vendor-4.6.7/ibexa/admin-ui/src/lib/REST/Value/ContentTree/NodeExtendedInfo.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/REST/Value/ContentTree/NodeExtendedInfo.php 1970-01-01 01:00:00.000000000 +0100
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/REST/Value/ContentTree/NodeExtendedInfo.php 2024-07-02 10:23:24.960906997 +0200
@@ -0,0 +1,62 @@
+<?php
+
+/**
+ * @copyright Copyright (C) Ibexa AS. All rights reserved.
+ * @license For full copyright and license information view LICENSE file distributed with this source code.
+ */
+declare(strict_types=1);
+
+namespace Ibexa\AdminUi\REST\Value\ContentTree;
+
+use Ibexa\Rest\Value as RestValue;
+
+/**
+ * @phpstan-type TRestrictions array{
+ * hasAccess: bool,
+ * restrictedContentTypeIds?: array<int>,
+ * restrictedLanguageCodes?: array<string>,
+ * }
+ * @phpstan-type TPermissionRestrictions array{
+ * create: TRestrictions,
+ * edit: TRestrictions,
+ * delete: TRestrictions,
+ * hide: TRestrictions,
+ * }
+ */
+final class NodeExtendedInfo extends RestValue
+{
+ /** @phpstan-var TPermissionRestrictions|null */
+ private ?array $permissions;
+
+ /** @var string[] */
+ private array $previewableTranslations;
+
+ /**
+ * @phpstan-param TPermissionRestrictions|null $permissions
+ *
+ * @param string[] $previewableTranslation
+ */
+ public function __construct(
+ ?array $permissions = null,
+ array $previewableTranslation = []
+ ) {
+ $this->permissions = $permissions;
+ $this->previewableTranslations = $previewableTranslation;
+ }
+
+ /**
+ * @return TPermissionRestrictions|null
+ */
+ public function getPermissionRestrictions(): ?array
+ {
+ return $this->permissions;
+ }
+
+ /**
+ * @return string[]
+ */
+ public function getPreviewableTranslations(): array
+ {
+ return $this->previewableTranslations;
+ }
+}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/REST/Value/ContentTree/Node.php vendor-4.6.7/ibexa/admin-ui/src/lib/REST/Value/ContentTree/Node.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/REST/Value/ContentTree/Node.php 2024-07-02 10:19:28.425331839 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/REST/Value/ContentTree/Node.php 2024-07-02 10:23:24.960906997 +0200
@@ -26,9 +26,6 @@
/** @var string[] */
public array $translations;
- /** @var string[] */
- public array $previewableTranslations;
-
/** @var string */
public $name;
@@ -56,12 +53,13 @@
public string $pathString;
+ public string $mainLanguageCode;
+
/**
* @param int $depth
* @param int $locationId
* @param int $contentId
* @param string[] $translations
- * @param string[] $previewableTranslations
* @param string $name
* @param string $contentTypeIdentifier
* @param bool $isContainer
@@ -76,7 +74,6 @@
int $contentId,
int $versionNo,
array $translations,
- array $previewableTranslations,
string $name,
string $contentTypeIdentifier,
bool $isContainer,
@@ -85,6 +82,7 @@
int $totalChildrenCount,
int $reverseRelationsCount,
bool $isBookmarked,
+ string $mainLanguageCode,
array $children = [],
string $pathString = ''
) {
@@ -93,7 +91,6 @@
$this->contentId = $contentId;
$this->versionNo = $versionNo;
$this->translations = $translations;
- $this->previewableTranslations = $previewableTranslations;
$this->name = $name;
$this->isInvisible = $isInvisible;
$this->contentTypeIdentifier = $contentTypeIdentifier;
@@ -104,6 +101,7 @@
$this->isBookmarked = $isBookmarked;
$this->children = $children;
$this->pathString = $pathString;
+ $this->mainLanguageCode = $mainLanguageCode;
}
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/Siteaccess/AbstractSiteaccessPreviewVoter.php vendor-4.6.7/ibexa/admin-ui/src/lib/Siteaccess/AbstractSiteaccessPreviewVoter.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/Siteaccess/AbstractSiteaccessPreviewVoter.php 2024-07-02 10:19:28.425331839 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/Siteaccess/AbstractSiteaccessPreviewVoter.php 2024-07-02 10:23:24.960906997 +0200
@@ -36,7 +36,7 @@
$location = $context->getLocation();
$languageCode = $context->getLanguageCode();
- if (empty(array_intersect($this->getRootLocationIds($siteAccess), $location->path))) {
+ if (empty(array_intersect($this->getRootLocationIds($siteAccess), $location->getPath()))) {
return false;
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/Siteaccess/SiteaccessResolver.php vendor-4.6.7/ibexa/admin-ui/src/lib/Siteaccess/SiteaccessResolver.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/Siteaccess/SiteaccessResolver.php 2024-07-02 10:19:28.425331839 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/Siteaccess/SiteaccessResolver.php 2024-07-02 10:23:24.960906997 +0200
@@ -81,7 +81,7 @@
): array {
$contentInfo = $location->getContentInfo();
$versionInfo = $this->contentService->loadVersionInfo($contentInfo, $versionNo);
- $languageCode = $languageCode ?? $contentInfo->mainLanguageCode;
+ $languageCode = $languageCode ?? $contentInfo->getMainLanguageCode();
$eligibleSiteAccesses = [];
/** @var \Ibexa\Core\MVC\Symfony\SiteAccess $siteAccess */
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/Strategy/ContentTypeThumbnailStrategy.php vendor-4.6.7/ibexa/admin-ui/src/lib/Strategy/ContentTypeThumbnailStrategy.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/Strategy/ContentTypeThumbnailStrategy.php 2024-07-02 10:19:28.425331839 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/Strategy/ContentTypeThumbnailStrategy.php 2024-07-02 10:23:24.960906997 +0200
@@ -34,7 +34,7 @@
?VersionInfo $versionInfo = null
): ?Thumbnail {
try {
- $contentTypeIcon = $this->contentTypeIconResolver->getContentTypeIcon($contentType->identifier);
+ $contentTypeIcon = $this->contentTypeIconResolver->getContentTypeIcon($contentType->getIdentifier());
return new Thumbnail([
'resource' => $contentTypeIcon,
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/Tab/LocationView/RelationsTab.php vendor-4.6.7/ibexa/admin-ui/src/lib/Tab/LocationView/RelationsTab.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/Tab/LocationView/RelationsTab.php 2024-07-02 10:19:28.425331839 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/Tab/LocationView/RelationsTab.php 2024-07-02 10:23:24.960906997 +0200
@@ -8,6 +8,7 @@
namespace Ibexa\AdminUi\Tab\LocationView;
+use Ibexa\AdminUi\Pagination\Pagerfanta\RelationAdapter;
use Ibexa\AdminUi\Pagination\Pagerfanta\ReverseRelationAdapter;
use Ibexa\AdminUi\UI\Dataset\DatasetFactory;
use Ibexa\Contracts\AdminUi\Tab\AbstractEventDispatchingTab;
@@ -130,21 +131,26 @@
));
$contentTypeIds = [];
-
- $relationListDataset = $this->datasetFactory->relationList();
- $relationListDataset->load($content);
- $relations = $relationListDataset->getRelations();
+ $relationPagination = new Pagerfanta(
+ new RelationAdapter($this->contentService, $this->datasetFactory, $content)
+ );
+ $relationPaginationParams = $contextParameters['relation_pagination_params'];
+ $relationPagination->setMaxPerPage($relationPaginationParams['limit']);
+ $relationPagination->setCurrentPage(min(
+ max($relationPaginationParams['page'], 1),
+ $relationPagination->getNbPages()
+ ));
$viewParameters = [];
-
+ $relations = $relationPagination->getCurrentPageResults();
foreach ($relations as $relation) {
if ($relation->isAccessible()) {
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Relation $relation */
$contentTypeIds[] = $relation->getDestinationContentInfo()->contentTypeId;
}
}
-
- $viewParameters['relations'] = $relations;
+ $viewParameters['relation_pager'] = $relationPagination;
+ $viewParameters['relation_pagination_params'] = $relationPaginationParams;
if ($this->permissionResolver->canUser('content', 'reverserelatedlist', $content)) {
$reverseRelations = $reverseRelationPagination->getCurrentPageResults();
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/UI/Config/Provider/ContentTypeMappings.php vendor-4.6.7/ibexa/admin-ui/src/lib/UI/Config/Provider/ContentTypeMappings.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/UI/Config/Provider/ContentTypeMappings.php 2024-07-02 10:19:28.425331839 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/UI/Config/Provider/ContentTypeMappings.php 2024-07-02 10:23:24.960906997 +0200
@@ -8,36 +8,41 @@
namespace Ibexa\AdminUi\UI\Config\Provider;
use Ibexa\Contracts\AdminUi\UI\Config\ProviderInterface;
+use Ibexa\Contracts\Core\Repository\ContentTypeService;
/**
* Class responsible for generating PlatformUI configuration for Multi File Upload functionality.
*/
class ContentTypeMappings implements ProviderInterface
{
- /** @var array */
- protected $locationMappings = [];
+ private ContentTypeService $contentTypeService;
- /** @var array */
- protected $defaultMappings = [];
+ /** @var array<string, mixed> */
+ protected array $locationMappings = [];
- /** @var array */
- protected $fallbackContentType = [];
+ /** @var array<string, mixed> */
+ protected array $defaultMappings = [];
- /** @var int */
+ /** @var array<string, mixed> */
+ protected array $fallbackContentType = [];
+
+ /** @var numeric */
protected $maxFileSize = 0;
/**
- * @param array $locationMappings
- * @param array $defaultMappings
- * @param array $fallbackContentType
- * @param int $maxFileSize
+ * @param array<string, mixed> $locationMappings
+ * @param array<string, mixed> $defaultMappings
+ * @param array<string, mixed> $fallbackContentType
+ * @param numeric $maxFileSize
*/
public function __construct(
+ ContentTypeService $contentTypeService,
array $locationMappings,
array $defaultMappings,
array $fallbackContentType,
$maxFileSize
) {
+ $this->contentTypeService = $contentTypeService;
$this->locationMappings = $locationMappings;
$this->defaultMappings = $defaultMappings;
$this->fallbackContentType = $fallbackContentType;
@@ -45,9 +50,9 @@
}
/**
- * Returns configuration structure compatible with PlatformUI.
+ * Returns configuration structure compatible with AdminUI.
*
- * @return array
+ * @return array<string, mixed>
*/
public function getConfig(): array
{
@@ -78,33 +83,73 @@
}
/**
- * @param array $mappingGroup
+ * @param array<string> $mappingGroup
*
- * @return array
+ * @return array<string, mixed>
*/
- private function buildMappingGroupStructure(array $mappingGroup)
+ private function buildMappingGroupStructure(array $mappingGroup): array
{
+ $contentTypeIdentifier = $mappingGroup['content_type_identifier'];
+ $contentFieldIdentifier = $mappingGroup['content_field_identifier'];
+
return [
'mimeTypes' => $mappingGroup['mime_types'],
- 'contentTypeIdentifier' => $mappingGroup['content_type_identifier'],
- 'contentFieldIdentifier' => $mappingGroup['content_field_identifier'],
+ 'contentTypeIdentifier' => $contentTypeIdentifier,
+ 'contentFieldIdentifier' => $contentFieldIdentifier,
'nameFieldIdentifier' => $mappingGroup['name_field_identifier'],
+ 'maxFileSize' => $this->getContentTypeConfiguredMaxFileSize(
+ $contentTypeIdentifier,
+ $contentFieldIdentifier
+ ),
];
}
/**
- * @param array $fallbackContentType
+ * @param array<string> $fallbackContentType
*
- * @return array
+ * @return array<string, mixed>
*/
- private function buildFallbackContentTypeStructure(array $fallbackContentType)
+ private function buildFallbackContentTypeStructure(array $fallbackContentType): array
{
+ $fallbackContentTypeIdentifier = $fallbackContentType['content_type_identifier'];
+ $fallbackContentFieldIdentifier = $fallbackContentType['content_field_identifier'];
+
return [
'contentTypeIdentifier' => $fallbackContentType['content_type_identifier'],
'contentFieldIdentifier' => $fallbackContentType['content_field_identifier'],
'nameFieldIdentifier' => $fallbackContentType['name_field_identifier'],
+ 'maxFileSize' => $this->getContentTypeConfiguredMaxFileSize(
+ $fallbackContentTypeIdentifier,
+ $fallbackContentFieldIdentifier
+ ),
];
}
+
+ /**
+ * @return numeric
+ *
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
+ */
+ private function getContentTypeConfiguredMaxFileSize(
+ string $contentTypeIdentifier,
+ string $imageFieldTypeIdentifier
+ ) {
+ $contentType = $this->contentTypeService->loadContentTypeByIdentifier(
+ $contentTypeIdentifier
+ );
+
+ $imgFieldType = $contentType->getFieldDefinition($imageFieldTypeIdentifier);
+ if ($imgFieldType === null) {
+ return $this->maxFileSize;
+ }
+
+ $validatorConfig = $imgFieldType->getValidatorConfiguration();
+ if (isset($validatorConfig['FileSizeValidator']['maxFileSize'])) {
+ return $validatorConfig['FileSizeValidator']['maxFileSize'] * 1024 * 1024;
+ }
+
+ return $this->maxFileSize;
+ }
}
class_alias(ContentTypeMappings::class, 'EzSystems\EzPlatformAdminUi\UI\Config\Provider\ContentTypeMappings');
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/UI/Config/Provider/ContentTypes.php vendor-4.6.7/ibexa/admin-ui/src/lib/UI/Config/Provider/ContentTypes.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/UI/Config/Provider/ContentTypes.php 2024-07-02 10:19:28.425331839 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/UI/Config/Provider/ContentTypes.php 2024-07-02 10:23:24.960906997 +0200
@@ -7,6 +7,7 @@
namespace Ibexa\AdminUi\UI\Config\Provider;
+use Ibexa\AdminUi\Event\AddContentTypeGroupToUIConfigEvent;
use Ibexa\AdminUi\Event\FilterContentTypesEvent;
use Ibexa\AdminUi\UI\Service\ContentTypeIconResolver;
use Ibexa\Contracts\AdminUi\UI\Config\ProviderInterface;
@@ -24,6 +25,7 @@
* isContainer: bool,
* thumbnail: string,
* href: string,
+ * isHidden: bool,
* }
*/
class ContentTypes implements ProviderInterface
@@ -73,7 +75,16 @@
$loadedContentTypeGroups = $this->contentTypeService->loadContentTypeGroups(
$preferredLanguages
);
+
+ $eventContentTypeGroups = [];
foreach ($loadedContentTypeGroups as $contentTypeGroup) {
+ $eventContentTypeGroups[] = $contentTypeGroup;
+ }
+
+ /** @var \Ibexa\AdminUi\Event\AddContentTypeGroupToUIConfigEvent $event */
+ $event = $this->eventDispatcher->dispatch(new AddContentTypeGroupToUIConfigEvent($eventContentTypeGroups));
+
+ foreach ($event->getContentTypeGroups() as $contentTypeGroup) {
$contentTypes = $this->contentTypeService->loadContentTypes(
$contentTypeGroup,
$preferredLanguages
@@ -84,7 +95,10 @@
});
foreach ($contentTypes as $contentType) {
- $contentTypeGroups[$contentTypeGroup->identifier][] = $this->getContentTypeData($contentType);
+ $contentTypeGroups[$contentTypeGroup->identifier][] = $this->getContentTypeData(
+ $contentType,
+ $contentTypeGroup->isSystem,
+ );
}
}
@@ -97,7 +111,7 @@
/**
* @phpstan-return TContentTypeData
*/
- private function getContentTypeData(ContentType $contentType): array
+ private function getContentTypeData(ContentType $contentType, bool $isHidden): array
{
return [
'id' => $contentType->id,
@@ -108,6 +122,7 @@
'href' => $this->urlGenerator->generate('ibexa.rest.load_content_type', [
'contentTypeId' => $contentType->id,
]),
+ 'isHidden' => $isHidden,
];
}
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/UI/Config/Provider/Module/DamWidget.php vendor-4.6.7/ibexa/admin-ui/src/lib/UI/Config/Provider/Module/DamWidget.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/UI/Config/Provider/Module/DamWidget.php 2024-07-02 10:19:28.425331839 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/UI/Config/Provider/Module/DamWidget.php 2024-07-02 10:23:24.961907000 +0200
@@ -11,52 +11,150 @@
use Ibexa\Bundle\Core\ApiLoader\Exception\InvalidSearchEngine;
use Ibexa\Bundle\Core\ApiLoader\RepositoryConfigurationProvider;
use Ibexa\Contracts\AdminUi\UI\Config\ProviderInterface;
+use Ibexa\Contracts\Core\Repository\ContentTypeService;
+use Ibexa\Contracts\Core\Repository\NameSchema\SchemaIdentifierExtractorInterface;
+use Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType;
/**
- * @template TConfig of array{
+ * @phpstan-type TConfig array{
* image: array{
- * fieldDefinitionIdentifiers: array<string>,
- * contentTypeIdentifiers: array<string>,
* aggregations: array<string, array<string, string>>,
+ * mappings: array<
+ * string,
+ * array{
+ * imageFieldIdentifier: string
+ * },
+ * >,
+ * },
+ * folder: array{
+ * contentTypeIdentifier: string,
* }
- * }
+ * }
+ * @phpstan-type TImageConfig array{
+ * fieldDefinitionIdentifiers: array<string>,
+ * contentTypeIdentifiers: array<string>,
+ * aggregations: array<string, array<string, string>>,
+ * showImageFilters: bool,
+ * enableMultipleDownload: bool,
+ * mappings: array<
+ * string,
+ * array{
+ * imageFieldIdentifier: string,
+ * nameSchemaIdentifiers: array<string>,
+ * }
+ * >,
+ * }
+ * @phpstan-type TFolderConfig array{
+ * contentTypeIdentifier: string,
+ * nameSchemaIdentifiers: array<string>
+ * }
*/
final class DamWidget implements ProviderInterface
{
/** @phpstan-var TConfig */
private array $config;
+ private ContentTypeService $contentTypeService;
+
private RepositoryConfigurationProvider $repositoryConfigurationProvider;
+ private SchemaIdentifierExtractorInterface $schemaIdentifierExtractor;
+
/**
* @phpstan-param TConfig $config
*/
public function __construct(
array $config,
- RepositoryConfigurationProvider $repositoryConfigurationProvider
+ ContentTypeService $contentTypeService,
+ RepositoryConfigurationProvider $repositoryConfigurationProvider,
+ SchemaIdentifierExtractorInterface $schemaIdentifierExtractor
) {
$this->config = $config;
+ $this->contentTypeService = $contentTypeService;
$this->repositoryConfigurationProvider = $repositoryConfigurationProvider;
+ $this->schemaIdentifierExtractor = $schemaIdentifierExtractor;
}
/**
* @phpstan-return array{
- * image: array{
- * fieldDefinitionIdentifiers: array<string>,
- * contentTypeIdentifiers: array<string>,
- * aggregations: array<string, array<string, string>>,
- * showImageFilters: bool,
- * }
+ * image: TImageConfig,
+ * folder: TFolderConfig
* }
*
- * @throws \Ibexa\Bundle\Core\ApiLoader\Exception\InvalidSearchEngine
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
*/
public function getConfig(): array
{
- $widgetConfig = $this->config;
- $widgetConfig['image']['showImageFilters'] = $this->showImageFilters();
+ return [
+ 'image' => $this->getImageConfig(),
+ 'folder' => $this->getFolderConfig(),
+ ];
+ }
- return $widgetConfig;
+ /**
+ * @phpstan-return TImageConfig
+ *
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
+ */
+ private function getImageConfig(): array
+ {
+ $imageConfig = [
+ 'showImageFilters' => $this->showImageFilters(),
+ 'aggregations' => $this->config['image']['aggregations'],
+ 'enableMultipleDownload' => extension_loaded('zip'),
+ ];
+
+ $mappings = [];
+ $contentTypeIdentifiers = [];
+ $fieldDefinitionIdentifiers = [];
+
+ foreach ($this->config['image']['mappings'] as $contentTypeIdentifier => $mapping) {
+ $contentTypeIdentifiers[] = $contentTypeIdentifier;
+ $fieldDefinitionIdentifiers[] = $mapping['imageFieldIdentifier'];
+ $mappings[$contentTypeIdentifier] = $mapping;
+
+ $contentType = $this->loadContentType($contentTypeIdentifier);
+ $mappings[$contentTypeIdentifier]['nameSchemaIdentifiers'] = $this->extractNameSchemaIdentifiers($contentType);
+ }
+
+ $imageConfig['mappings'] = $mappings;
+ $imageConfig['contentTypeIdentifiers'] = $contentTypeIdentifiers;
+ $imageConfig['fieldDefinitionIdentifiers'] = $fieldDefinitionIdentifiers;
+
+ return $imageConfig;
+ }
+
+ /**
+ * @phpstan-return TFolderConfig
+ *
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
+ */
+ private function getFolderConfig(): array
+ {
+ $contentTypeIdentifier = $this->config['folder']['contentTypeIdentifier'];
+
+ return [
+ 'contentTypeIdentifier' => $contentTypeIdentifier,
+ 'nameSchemaIdentifiers' => $this->extractNameSchemaIdentifiers(
+ $this->loadContentType($contentTypeIdentifier)
+ ),
+ ];
+ }
+
+ /**
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
+ */
+ private function loadContentType(string $contentTypeIdentifier): ContentType
+ {
+ return $this->contentTypeService->loadContentTypeByIdentifier($contentTypeIdentifier);
+ }
+
+ /**
+ * @return array<string>
+ */
+ private function extractNameSchemaIdentifiers(ContentType $contentType): array
+ {
+ return $this->schemaIdentifierExtractor->extract($contentType->nameSchema)['field'] ?? [];
}
/**
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/UI/Dataset/RelationListDataset.php vendor-4.6.7/ibexa/admin-ui/src/lib/UI/Dataset/RelationListDataset.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/UI/Dataset/RelationListDataset.php 2024-07-02 10:19:28.425331839 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/UI/Dataset/RelationListDataset.php 2024-07-02 10:23:24.961907000 +0200
@@ -11,7 +11,7 @@
use Ibexa\AdminUi\UI\Value\ValueFactory;
use Ibexa\Contracts\Core\Repository\ContentService;
use Ibexa\Contracts\Core\Repository\Values\Content\Content;
-use Ibexa\Contracts\Core\Repository\Values\Content\Relation;
+use Ibexa\Contracts\Core\Repository\Values\Content\RelationList\RelationListItemInterface;
final class RelationListDataset
{
@@ -43,15 +43,29 @@
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException
*/
public function load(
- Content $content
+ Content $content,
+ int $offset = 0,
+ int $limit = 10
): self {
$versionInfo = $content->getVersionInfo();
+ $relationListItems = $this->contentService->loadRelationList($versionInfo, $offset, $limit)->items;
$this->relations = array_map(
- function (Relation $relation) use ($content) {
- return $this->valueFactory->createRelation($relation, $content);
+ function (RelationListItemInterface $relationListItem) use ($content) {
+ if ($relationListItem->hasRelation()) {
+ /** @var \Ibexa\Contracts\Core\Repository\Values\Content\RelationList\Item\RelationListItem $relationListItem */
+ return $this->valueFactory->createRelationItem(
+ $relationListItem,
+ $content
+ );
+ }
+
+ /** @var \Ibexa\Contracts\Core\Repository\Values\Content\RelationList\Item\UnauthorizedRelationListItem $relationListItem */
+ return $this->valueFactory->createUnauthorizedRelationItem(
+ $relationListItem
+ );
},
- $this->contentService->loadRelations($versionInfo)
+ $relationListItems
);
return $this;
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/UI/Module/ContentTree/NodeFactory.php vendor-4.6.7/ibexa/admin-ui/src/lib/UI/Module/ContentTree/NodeFactory.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/UI/Module/ContentTree/NodeFactory.php 2024-07-02 10:19:28.425331839 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/UI/Module/ContentTree/NodeFactory.php 2024-07-02 10:23:24.961907000 +0200
@@ -10,7 +10,6 @@
use Ibexa\AdminUi\REST\Value\ContentTree\LoadSubtreeRequestNode;
use Ibexa\AdminUi\REST\Value\ContentTree\Node;
-use Ibexa\AdminUi\Siteaccess\SiteaccessResolverInterface;
use Ibexa\Contracts\Core\Repository\BookmarkService;
use Ibexa\Contracts\Core\Repository\ContentService;
use Ibexa\Contracts\Core\Repository\Exceptions\NotImplementedException;
@@ -36,6 +35,10 @@
final class NodeFactory
{
private const TOP_NODE_CONTENT_ID = 0;
+
+ /**
+ * @var array<string, class-string<\Ibexa\Contracts\Core\Repository\Values\Filter\FilteringSortClause>>
+ */
private const SORT_CLAUSE_MAP = [
'DatePublished' => SortClause\DatePublished::class,
'ContentName' => SortClause\ContentName::class,
@@ -59,8 +62,6 @@
private Repository $repository;
- private SiteaccessResolverInterface $siteaccessResolver;
-
/** @var int */
private $maxLocationIdsInSingleAggregation;
@@ -72,7 +73,6 @@
ConfigResolverInterface $configResolver,
PermissionResolver $permissionResolver,
Repository $repository,
- SiteaccessResolverInterface $siteaccessResolver,
int $maxLocationIdsInSingleAggregation
) {
$this->bookmarkService = $bookmarkService;
@@ -82,7 +82,6 @@
$this->configResolver = $configResolver;
$this->permissionResolver = $permissionResolver;
$this->repository = $repository;
- $this->siteaccessResolver = $siteaccessResolver;
$this->maxLocationIdsInSingleAggregation = $maxLocationIdsInSingleAggregation;
}
@@ -97,7 +96,8 @@
bool $loadChildren = false,
int $depth = 0,
?string $sortClause = null,
- string $sortOrder = Query::SORT_ASC
+ string $sortOrder = Query::SORT_ASC,
+ ?Criterion $requestFilter = null
): Node {
$uninitializedContentInfoList = [];
$containerLocations = [];
@@ -114,17 +114,18 @@
$depth,
$sortClause,
$sortOrder,
- $bookmarkedLocations
+ $bookmarkedLocations,
+ $requestFilter
);
$versionInfoById = $this->contentService->loadVersionInfoListByContentInfo($uninitializedContentInfoList);
$aggregatedChildrenCount = null;
if ($this->searchService->supports(SearchService::CAPABILITY_AGGREGATIONS)) {
- $aggregatedChildrenCount = $this->countAggregatedSubitems($containerLocations);
+ $aggregatedChildrenCount = $this->countAggregatedSubitems($containerLocations, $requestFilter);
}
$this->supplyTranslatedContentName($node, $versionInfoById);
- $this->supplyChildrenCount($node, $aggregatedChildrenCount);
+ $this->supplyChildrenCount($node, $aggregatedChildrenCount, $requestFilter);
return $node;
}
@@ -149,9 +150,10 @@
int $limit = 10,
int $offset = 0,
?string $sortClause = null,
- string $sortOrder = Query::SORT_ASC
+ string $sortOrder = Query::SORT_ASC,
+ ?Criterion $requestFilter = null
): SearchResult {
- $searchQuery = $this->getSearchQuery($parentLocation->id);
+ $searchQuery = $this->getSearchQuery($parentLocation->getId(), $requestFilter);
$searchQuery->limit = $limit;
$searchQuery->offset = $offset;
@@ -163,7 +165,7 @@
/**
* @param \Ibexa\Contracts\Core\Repository\Values\Content\Location $parentLocation
*/
- private function getSearchQuery(int $parentLocationId): LocationQuery
+ private function getSearchQuery(int $parentLocationId, ?Criterion $requestFilter = null): LocationQuery
{
$searchQuery = new LocationQuery();
$searchQuery->filter = new Criterion\ParentLocationId($parentLocationId);
@@ -174,7 +176,7 @@
$contentTypeCriterion = new Criterion\ContentTypeIdentifier($this->getSetting('allowed_content_types'));
}
- if (empty($this->allowedContentTypes) && !empty($this->getSetting('ignored_content_types'))) {
+ if (!empty($this->getSetting('ignored_content_types'))) {
$contentTypeCriterion = new Criterion\LogicalNot(
new Criterion\ContentTypeIdentifier($this->getSetting('ignored_content_types'))
);
@@ -184,6 +186,10 @@
$searchQuery->filter = new Criterion\LogicalAnd([$searchQuery->filter, $contentTypeCriterion]);
}
+ if (null !== $requestFilter) {
+ $searchQuery->filter = new Criterion\LogicalAnd([$searchQuery->filter, $requestFilter]);
+ }
+
return $searchQuery;
}
@@ -201,9 +207,9 @@
/**
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
*/
- private function countSubitems(int $parentLocationId): int
+ private function countSubitems(int $parentLocationId, ?Criterion $requestFilter = null): int
{
- $searchQuery = $this->getSearchQuery($parentLocationId);
+ $searchQuery = $this->getSearchQuery($parentLocationId, $requestFilter);
$searchQuery->limit = 0;
$searchQuery->offset = 0;
@@ -214,8 +220,11 @@
/**
* @param \Ibexa\Contracts\Core\Repository\Values\Content\Location[] $containerLocations
+ *
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidCriterionArgumentException
*/
- private function countAggregatedSubitems(array $containerLocations): array
+ private function countAggregatedSubitems(array $containerLocations, ?Criterion $requestFilter): array
{
if (empty($containerLocations)) {
return [];
@@ -226,7 +235,7 @@
$result = [];
foreach ($containerLocationsChunks as $containerLocationsChunk) {
- $result = array_replace($result, $this->countAggregatedSubitems($containerLocationsChunk));
+ $result = array_replace($result, $this->countAggregatedSubitems($containerLocationsChunk, $requestFilter));
}
return $result;
@@ -240,6 +249,10 @@
$locationChildrenTermAggregation->setLimit(\count($parentLocationIds));
$searchQuery->aggregations[] = $locationChildrenTermAggregation;
+ if (null !== $requestFilter) {
+ $searchQuery->filter = new Criterion\LogicalAnd([$searchQuery->filter, $requestFilter]);
+ }
+
$result = $this->searchService->findLocations($searchQuery);
if ($result->aggregations->has('childrens')) {
@@ -325,20 +338,21 @@
int $depth = 0,
?string $sortClause = null,
string $sortOrder = Query::SORT_ASC,
- array $bookmarkLocations = []
+ array $bookmarkLocations = [],
+ ?Criterion $requestFilter = null
): Node {
$contentInfo = $location->getContentInfo();
- $contentId = $location->contentId;
+ $contentId = $location->getContentId();
if (!isset($uninitializedContentInfoList[$contentId])) {
$uninitializedContentInfoList[$contentId] = $contentInfo;
}
// Top Level Location (id = 1) does not have a content type
- $contentType = $location->depth > 0
+ $contentType = $location->getDepth() > 0
? $contentInfo->getContentType()
: null;
- if ($contentType !== null && $contentType->isContainer) {
+ if ($contentType !== null && $contentType->isContainer()) {
$containerLocations[] = $location;
}
@@ -353,13 +367,13 @@
$totalChildrenCount = 0;
$children = [];
if ($loadChildren && $depth < $this->getSetting('tree_max_depth')) {
- $searchResult = $this->findSubitems($location, $limit, $offset, $sortClause, $sortOrder);
+ $searchResult = $this->findSubitems($location, $limit, $offset, $sortClause, $sortOrder, $requestFilter);
$totalChildrenCount = (int) $searchResult->totalCount;
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Location $childLocation */
foreach (array_column($searchResult->searchHits, 'valueObject') as $childLocation) {
$childLoadSubtreeRequestNode = null !== $loadSubtreeRequestNode
- ? $this->findChild($childLocation->id, $loadSubtreeRequestNode)
+ ? $this->findChild($childLocation->getId(), $loadSubtreeRequestNode)
: null;
$children[] = $this->buildNode(
@@ -371,32 +385,30 @@
$depth + 1,
null,
Query::SORT_ASC,
- $bookmarkLocations
+ $bookmarkLocations,
+ $requestFilter
);
}
}
- $translations = $versionInfo->languageCodes;
- $previewableTranslations = array_filter(
- $translations,
- fn (string $languageCode): bool => $this->isPreviewable($location, $content, $languageCode)
- );
+ $translations = $versionInfo->getLanguageCodes();
+ $mainLanguageCode = $versionInfo->getContentInfo()->getMainLanguageCode();
return new Node(
$depth,
- $location->id,
- $location->contentId,
- $versionInfo->versionNo,
+ $location->getId(),
+ $location->getContentId(),
+ $versionInfo->getVersionNo(),
$translations,
- $previewableTranslations,
'', // node name will be provided later by `supplyTranslatedContentName` method
- $contentType ? $contentType->identifier : '',
- $contentType ? $contentType->isContainer : true,
- $location->invisible || $location->hidden,
+ null !== $contentType ? $contentType->getIdentifier() : '',
+ null === $contentType || $contentType->isContainer(),
+ $location->isInvisible() || $location->isHidden(),
$limit,
$totalChildrenCount,
$this->getReverseRelationsCount($contentInfo),
- isset($bookmarkLocations[$location->id]),
+ isset($bookmarkLocations[$location->getId()]),
+ $mainLanguageCode,
$children,
$location->getPathString()
);
@@ -429,49 +441,25 @@
/**
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
*/
- private function supplyChildrenCount(Node $node, ?array $aggregationResult = null): void
- {
+ private function supplyChildrenCount(
+ Node $node,
+ ?array $aggregationResult = null,
+ ?Criterion $requestFilter = null
+ ): void {
if ($node->isContainer) {
if ($aggregationResult !== null) {
$totalCount = $aggregationResult[$node->locationId] ?? 0;
} else {
- $totalCount = $this->countSubitems($node->locationId);
+ $totalCount = $this->countSubitems($node->locationId, $requestFilter);
}
$node->totalChildrenCount = $totalCount;
}
foreach ($node->children as $child) {
- $this->supplyChildrenCount($child, $aggregationResult);
+ $this->supplyChildrenCount($child, $aggregationResult, $requestFilter);
}
}
-
- /**
- * @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
- * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
- */
- private function isPreviewable(
- Location $location,
- Content $content,
- string $languageCode
- ): bool {
- $versionNo = $content->getVersionInfo()->versionNo;
-
- $siteAccesses = $this->siteaccessResolver->getSiteAccessesListForLocation(
- $location,
- $versionNo,
- $languageCode
- );
-
- $canPreview = $this->permissionResolver->canUser(
- 'content',
- 'versionread',
- $content,
- [$location]
- );
-
- return $canPreview && !empty($siteAccesses);
- }
}
class_alias(NodeFactory::class, 'EzSystems\EzPlatformAdminUi\UI\Module\ContentTree\NodeFactory');
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/UI/Module/Subitems/ContentViewParameterSupplier.php vendor-4.6.7/ibexa/admin-ui/src/lib/UI/Module/Subitems/ContentViewParameterSupplier.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/UI/Module/Subitems/ContentViewParameterSupplier.php 2024-07-02 10:19:28.426331841 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/UI/Module/Subitems/ContentViewParameterSupplier.php 2024-07-02 10:23:24.961907000 +0200
@@ -16,11 +16,13 @@
use Ibexa\Contracts\Core\Repository\ContentTypeService;
use Ibexa\Contracts\Core\Repository\LocationService;
use Ibexa\Contracts\Core\Repository\PermissionResolver;
+use Ibexa\Contracts\Core\Repository\SearchService;
use Ibexa\Contracts\Core\Repository\Values\Content\Content;
use Ibexa\Contracts\Core\Repository\Values\Content\Location;
use Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType;
use Ibexa\Contracts\Rest\Output\Visitor;
use Ibexa\Core\MVC\Symfony\View\ContentView;
+use Ibexa\Core\Query\QueryFactoryInterface;
use Ibexa\Rest\Output\Generator\Json as JsonOutputGenerator;
use Ibexa\Rest\Server\Output\ValueObjectVisitor\ContentTypeInfoList as ContentTypeInfoListValueObjectVisitor;
use Ibexa\Rest\Server\Values\ContentTypeInfoList;
@@ -63,18 +65,10 @@
/** @var \Ibexa\User\UserSetting\UserSettingService */
private $userSettingService;
- /**
- * @param \Ibexa\Contracts\Rest\Output\Visitor $outputVisitor
- * @param \Ibexa\Rest\Output\Generator\Json $outputGenerator
- * @param \Ibexa\Rest\Server\Output\ValueObjectVisitor\ContentTypeInfoList $contentTypeInfoListValueObjectVisitor
- * @param \Ibexa\AdminUi\UI\Module\Subitems\ValueObjectVisitor\SubitemsList $subitemsListValueObjectVisitor
- * @param \Ibexa\Contracts\Core\Repository\LocationService $locationService
- * @param \Ibexa\Contracts\Core\Repository\ContentService $contentService
- * @param \Ibexa\Contracts\Core\Repository\ContentTypeService $contentTypeService
- * @param \Ibexa\Contracts\Core\Repository\PermissionResolver $permissionResolver
- * @param \Ibexa\AdminUi\UI\Config\Provider\ContentTypeMappings $contentTypeMappings
- * @param \Ibexa\User\UserSetting\UserSettingService $userSettingService
- */
+ private QueryFactoryInterface $queryFactory;
+
+ private SearchService $searchService;
+
public function __construct(
Visitor $outputVisitor,
JsonOutputGenerator $outputGenerator,
@@ -85,7 +79,9 @@
ContentTypeService $contentTypeService,
PermissionResolver $permissionResolver,
ContentTypeMappings $contentTypeMappings,
- UserSettingService $userSettingService
+ UserSettingService $userSettingService,
+ QueryFactoryInterface $queryFactory,
+ SearchService $searchService
) {
$this->outputVisitor = $outputVisitor;
$this->outputGenerator = $outputGenerator;
@@ -97,6 +93,8 @@
$this->permissionResolver = $permissionResolver;
$this->contentTypeMappings = $contentTypeMappings;
$this->userSettingService = $userSettingService;
+ $this->queryFactory = $queryFactory;
+ $this->searchService = $searchService;
}
/**
@@ -121,12 +119,17 @@
$contentTypes = [];
$subitemsRows = [];
$location = $view->getLocation();
- $childrenCount = $this->locationService->getLocationChildCount($location);
-
$subitemsLimit = (int)$this->userSettingService->getUserSetting('subitems_limit')->value;
- $locationChildren = $this->locationService->loadLocationChildren($location, 0, $subitemsLimit);
- foreach ($locationChildren->locations as $locationChild) {
+ /** @var \Ibexa\Contracts\Core\Repository\Values\Content\LocationQuery $locationChildrenQuery */
+ $locationChildrenQuery = $this->queryFactory->create('Children', ['location' => $location]);
+ $locationChildrenQuery->offset = 0;
+ $locationChildrenQuery->limit = $subitemsLimit;
+
+ $searchResult = $this->searchService->findLocations($locationChildrenQuery);
+ foreach ($searchResult->searchHits as $searchHit) {
+ /** @var \Ibexa\Contracts\Core\Repository\Values\Content\Location $locationChild */
+ $locationChild = $searchHit->valueObject;
$contentType = $locationChild->getContent()->getContentType();
if (!isset($contentTypes[$contentType->identifier])) {
@@ -136,7 +139,7 @@
$subitemsRows[] = $this->createSubitemsRow($locationChild, $contentType);
}
- $subitemsList = new SubitemsList($subitemsRows, $childrenCount);
+ $subitemsList = new SubitemsList($subitemsRows, $searchResult->totalCount ?? 0);
$contentTypeInfoList = new ContentTypeInfoList($contentTypes, '');
$subitemsListJson = $this->visitSubitemsList($subitemsList);
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/admin-ui/src/lib/UniversalDiscovery/UniversalDiscoveryProvider.php vendor-4.6.7/ibexa/admin-ui/src/lib/UniversalDiscovery/UniversalDiscoveryProvider.php
--- vendor-4.6.2/ibexa/admin-ui/src/lib/UniversalDiscovery/UniversalDiscoveryProvider.php 2024-07-02 10:19:28.426331841 +0200
+++ vendor-4.6.7/ibexa/admin-ui/src/lib/UniversalDiscovery/UniversalDiscoveryProvider.php 2024-07-02 10:23:24.961907000 +0200
@@ -194,7 +194,7 @@
);
$updateLimitationsValues = $this->lookupLimitationsTransformer->getGroupedLimitationValues(
- $lookupCreateLimitationsResult,
+ $lookupUpdateLimitationsResult,
[Limitation::CONTENTTYPE, Limitation::LANGUAGE]
);
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/content-forms/src/lib/Form/EventSubscriber/SuppressValidationSubscriber.php vendor-4.6.7/ibexa/content-forms/src/lib/Form/EventSubscriber/SuppressValidationSubscriber.php
--- vendor-4.6.2/ibexa/content-forms/src/lib/Form/EventSubscriber/SuppressValidationSubscriber.php 2024-07-02 10:19:17.631305615 +0200
+++ vendor-4.6.7/ibexa/content-forms/src/lib/Form/EventSubscriber/SuppressValidationSubscriber.php 2024-07-02 10:23:18.164890460 +0200
@@ -42,10 +42,11 @@
{
$form = $event->getForm();
- if ($form->has('saveDraft')) {
- if ($form->get('saveDraft')->isClicked()) {
- $event->stopPropagation();
- }
+ if (
+ ($form->has('saveDraft') && $form->get('saveDraft')->isClicked())
+ || ($form->has('saveDraftAndClose') && $form->get('saveDraftAndClose')->isClicked())
+ ) {
+ $event->stopPropagation();
}
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/phpunit-integration-legacy-solr.xml vendor-4.6.7/ibexa/core/phpunit-integration-legacy-solr.xml
--- vendor-4.6.2/ibexa/core/phpunit-integration-legacy-solr.xml 2024-07-02 10:19:17.518305341 +0200
+++ vendor-4.6.7/ibexa/core/phpunit-integration-legacy-solr.xml 2024-07-02 10:23:18.054890192 +0200
@@ -21,6 +21,7 @@
<env name="KERNEL_CLASS" value="Ibexa\Contracts\Solr\Test\IbexaSolrTestKernel"/>
<env name="SEARCH_ENGINE" value="solr"/>
<env name="DATABASE_URL" value="sqlite://:memory:" />
+ <env name="SYMFONY_DEPRECATIONS_HELPER" value="disabled"/>
</php>
<testsuites>
<!-- Search service is used all over the place, so we must run entire integration test suite -->
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/phpunit-integration-legacy.xml vendor-4.6.7/ibexa/core/phpunit-integration-legacy.xml
--- vendor-4.6.2/ibexa/core/phpunit-integration-legacy.xml 2024-07-02 10:19:17.518305341 +0200
+++ vendor-4.6.7/ibexa/core/phpunit-integration-legacy.xml 2024-07-02 10:23:18.054890192 +0200
@@ -19,6 +19,7 @@
<env name="DATABASE_URL" value="sqlite://:memory:" />
<env name="KERNEL_CLASS" value="Ibexa\Contracts\Core\Test\IbexaTestKernel"/>
<env name="SEARCH_ENGINE" value="legacy"/>
+ <env name="SYMFONY_DEPRECATIONS_HELPER" value="disabled"/>
</php>
<testsuites>
<testsuite name="integration_core">
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/.sonarcloud.properties vendor-4.6.7/ibexa/core/.sonarcloud.properties
--- vendor-4.6.2/ibexa/core/.sonarcloud.properties 2024-07-02 10:19:17.510305321 +0200
+++ vendor-4.6.7/ibexa/core/.sonarcloud.properties 2024-07-02 10:23:18.046890173 +0200
@@ -1 +1 @@
-sonar.exclusions=**/Tests/**/_fixtures/*
+sonar.exclusions=tests/**/_fixtures/**/*
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/bundle/Core/DependencyInjection/IbexaCoreExtension.php vendor-4.6.7/ibexa/core/src/bundle/Core/DependencyInjection/IbexaCoreExtension.php
--- vendor-4.6.2/ibexa/core/src/bundle/Core/DependencyInjection/IbexaCoreExtension.php 2024-07-02 10:19:17.518305341 +0200
+++ vendor-4.6.7/ibexa/core/src/bundle/Core/DependencyInjection/IbexaCoreExtension.php 2024-07-02 10:23:18.054890192 +0200
@@ -127,9 +127,6 @@
$loader->load('routing/js_routing.yml');
}
- // Default settings
- $this->handleDefaultSettingsLoading($container, $loader);
-
$this->registerRepositoriesConfiguration($config, $container);
$this->registerSiteAccessConfiguration($config, $container);
$this->registerImageMagickConfiguration($config, $container);
@@ -198,6 +195,9 @@
$this->prependDoctrineConfiguration($container);
$this->prependJMSTranslation($container);
+ // Default settings
+ $this->handleDefaultSettingsLoading($container);
+
$this->configureGenericSetup($container);
$this->configurePlatformShSetup($container);
}
@@ -236,15 +236,14 @@
}
/**
- * Handle default settings.
- *
- * @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
- * @param \Symfony\Component\DependencyInjection\Loader\FileLoader $loader
- *
* @throws \Exception
*/
- private function handleDefaultSettingsLoading(ContainerBuilder $container, FileLoader $loader)
+ private function handleDefaultSettingsLoading(ContainerBuilder $container): void
{
+ $loader = new Loader\YamlFileLoader(
+ $container,
+ new FileLocator(__DIR__ . '/../Resources/config')
+ );
$loader->load('default_settings.yml');
foreach ($this->defaultSettingsCollection as $fileLocation => $files) {
@@ -831,12 +830,6 @@
{
$projectDir = $container->getParameter('kernel.project_dir');
- // Run for all hooks, incl build step
- if ($_SERVER['PLATFORM_PROJECT_ENTROPY'] ?? false) {
- // Disable PHPStormPass as we don't have write access & it's not localhost
- $container->setParameter('ezdesign.phpstorm.enabled', false);
- }
-
// Will not be executed on build step
$relationships = $_SERVER['PLATFORM_RELATIONSHIPS'] ?? false;
if (!$relationships) {
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/bundle/Core/Translation/Policy/PolicyTranslationDefinitionProvider.php vendor-4.6.7/ibexa/core/src/bundle/Core/Translation/Policy/PolicyTranslationDefinitionProvider.php
--- vendor-4.6.2/ibexa/core/src/bundle/Core/Translation/Policy/PolicyTranslationDefinitionProvider.php 2024-07-02 10:19:17.519305343 +0200
+++ vendor-4.6.7/ibexa/core/src/bundle/Core/Translation/Policy/PolicyTranslationDefinitionProvider.php 2024-07-02 10:23:18.054890192 +0200
@@ -21,6 +21,8 @@
public static function getTranslationMessages(): array
{
return [
+ (new Message('role.policy.all_modules_all_functions', self::TRANSLATION_DOMAIN))
+ ->setDesc('All modules / All functions'),
(new Message('role.policy.content', self::TRANSLATION_DOMAIN))
->setDesc('Content'),
(new Message('role.policy.content.all_functions', self::TRANSLATION_DOMAIN))
@@ -35,6 +37,8 @@
->setDesc('Content / Edit'),
(new Message('role.policy.content.hide', self::TRANSLATION_DOMAIN))
->setDesc('Content / Hide'),
+ (new Message('role.policy.content.view_embed', self::TRANSLATION_DOMAIN))
+ ->setDesc('Content / View embed'),
(new Message('role.policy.content.manage_locations', self::TRANSLATION_DOMAIN))
->setDesc('Content / Manage locations'),
(new Message('role.policy.content.pendinglist', self::TRANSLATION_DOMAIN))
@@ -121,6 +125,15 @@
(new Message('role.policy.setup.system_info', self::TRANSLATION_DOMAIN))
->setDesc('Setup / System info'),
+ (new Message('role.policy.url', self::TRANSLATION_DOMAIN))
+ ->setDesc('URL'),
+ (new Message('role.policy.url.all_functions', self::TRANSLATION_DOMAIN))
+ ->setDesc('URL / All functions'),
+ (new Message('role.policy.url.view', self::TRANSLATION_DOMAIN))
+ ->setDesc('URL / View'),
+ (new Message('role.policy.url.update', self::TRANSLATION_DOMAIN))
+ ->setDesc('URL / Update'),
+
(new Message('role.policy.user', self::TRANSLATION_DOMAIN))
->setDesc('User'),
(new Message('role.policy.user.all_functions', self::TRANSLATION_DOMAIN))
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/bundle/Debug/DependencyInjection/IbexaDebugExtension.php vendor-4.6.7/ibexa/core/src/bundle/Debug/DependencyInjection/IbexaDebugExtension.php
--- vendor-4.6.2/ibexa/core/src/bundle/Debug/DependencyInjection/IbexaDebugExtension.php 2024-07-02 10:19:17.519305343 +0200
+++ vendor-4.6.7/ibexa/core/src/bundle/Debug/DependencyInjection/IbexaDebugExtension.php 2024-07-02 10:23:18.054890192 +0200
@@ -6,16 +6,21 @@
*/
namespace Ibexa\Bundle\Debug\DependencyInjection;
-use Ibexa\Bundle\Debug\Twig\DebugTemplate;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
-use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
use Symfony\Component\DependencyInjection\Loader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
-class IbexaDebugExtension extends Extension implements PrependExtensionInterface
+/**
+ * @internal
+ * @final
+ */
+class IbexaDebugExtension extends Extension
{
- public function load(array $configs, ContainerBuilder $container)
+ /**
+ * @throws \Exception
+ */
+ public function load(array $configs, ContainerBuilder $container): void
{
$loader = new Loader\YamlFileLoader(
$container,
@@ -25,19 +30,6 @@
// Base services and services overrides
$loader->load('services.yml');
}
-
- /**
- * Sets the twig base template class to this bundle's in order to collect template infos.
- */
- public function prepend(ContainerBuilder $container)
- {
- if ($container->getParameter('kernel.debug')) {
- $container->prependExtensionConfig(
- 'twig',
- ['base_template_class' => DebugTemplate::class]
- );
- }
- }
}
class_alias(IbexaDebugExtension::class, 'eZ\Bundle\EzPublishDebugBundle\DependencyInjection\EzPublishDebugExtension');
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/bundle/Debug/Twig/DebugTemplate.php vendor-4.6.7/ibexa/core/src/bundle/Debug/Twig/DebugTemplate.php
--- vendor-4.6.2/ibexa/core/src/bundle/Debug/Twig/DebugTemplate.php 2024-07-02 10:19:17.519305343 +0200
+++ vendor-4.6.7/ibexa/core/src/bundle/Debug/Twig/DebugTemplate.php 1970-01-01 01:00:00.000000000 +0100
@@ -1,101 +0,0 @@
-<?php
-
-/**
- * @copyright Copyright (C) Ibexa AS. All rights reserved.
- * @license For full copyright and license information view LICENSE file distributed with this source code.
- */
-namespace Ibexa\Bundle\Debug\Twig;
-
-use Symfony\Component\Filesystem\Filesystem;
-use Twig\Template;
-
-/**
- * Meant to be used as a Twig base template class.
- *
- * Wraps the display method to:
- * - Inject debug info into template to be able to see in the markup which one is used
- */
-class DebugTemplate extends Template
-{
- private $fileSystem;
-
- public function display(array $context, array $blocks = [])
- {
- $this->fileSystem = $this->fileSystem ?: new Filesystem();
-
- // Bufferize to be able to insert template name as HTML comments if applicable.
- // Layout template name will only appear at the end, to avoid potential quirks with old browsers
- // when comments appear before doctype declaration.
- ob_start();
- parent::display($context, $blocks);
- $templateResult = ob_get_clean();
-
- $templateName = trim($this->fileSystem->makePathRelative($this->getSourceContext()->getPath(), dirname(getcwd())), '/');
- // Check if template name ends with "html.twig", indicating this is an HTML template.
- $isHtmlTemplate = substr($templateName, -strlen('html.twig')) === 'html.twig';
- $templateName = $isHtmlTemplate ? $templateName . ' (' . $this->getSourceContext()->getName() . ')' : $templateName;
-
- // Display start template comment, if applicable.
- if ($isHtmlTemplate) {
- if (stripos(trim($templateResult), '<!doctype') !== false) {
- $templateResult = preg_replace(
- '#(<!doctype[^>]+>)#im',
- "$1\n<!-- START " . $templateName . ' -->',
- $templateResult
- );
- } else {
- echo "\n<!-- START $templateName -->\n";
- }
- }
-
- // Display stop template comment after result, if applicable.
- if ($isHtmlTemplate) {
- $bodyPos = stripos($templateResult, '</body>');
- if ($bodyPos !== false) {
- // Add layout template name before </body>, to avoid display quirks in some browsers.
- echo substr($templateResult, 0, $bodyPos)
- . "\n<!-- STOP $templateName -->\n"
- . substr($templateResult, $bodyPos);
- } else {
- echo $templateResult;
- echo "\n<!-- STOP $templateName -->\n";
- }
- } else {
- echo $templateResult;
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function getTemplateName()
- {
- return '';
- }
-
- /**
- * {@inheritdoc}
- */
- public function getSourceContext()
- {
- return '';
- }
-
- /**
- * {@inheritdoc}
- */
- protected function doDisplay(array $context, array $blocks = [])
- {
- return '';
- }
-
- /**
- * {@inheritdoc}
- */
- public function getDebugInfo()
- {
- return [];
- }
-}
-
-class_alias(DebugTemplate::class, 'eZ\Bundle\EzPublishDebugBundle\Twig\DebugTemplate');
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/contracts/Collection/AbstractInMemoryCollection.php vendor-4.6.7/ibexa/core/src/contracts/Collection/AbstractInMemoryCollection.php
--- vendor-4.6.2/ibexa/core/src/contracts/Collection/AbstractInMemoryCollection.php 2024-07-02 10:19:17.519305343 +0200
+++ vendor-4.6.7/ibexa/core/src/contracts/Collection/AbstractInMemoryCollection.php 2024-07-02 10:23:18.054890192 +0200
@@ -20,11 +20,11 @@
*/
abstract class AbstractInMemoryCollection implements CollectionInterface, StreamableInterface
{
- /** @var TValue[] */
+ /** @phpstan-var TValue[] */
protected array $items;
/**
- * @param TValue[] $items
+ * @phpstan-param TValue[] $items
*/
public function __construct(array $items = [])
{
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/contracts/Collection/ArrayList.php vendor-4.6.7/ibexa/core/src/contracts/Collection/ArrayList.php
--- vendor-4.6.2/ibexa/core/src/contracts/Collection/ArrayList.php 2024-07-02 10:19:17.519305343 +0200
+++ vendor-4.6.7/ibexa/core/src/contracts/Collection/ArrayList.php 2024-07-02 10:23:18.054890192 +0200
@@ -19,7 +19,7 @@
class ArrayList extends AbstractInMemoryCollection implements ListInterface
{
/**
- * @param TValue[] $items
+ * @phpstan-param TValue[] $items
*/
public function __construct(array $items = [])
{
@@ -45,7 +45,7 @@
}
/**
- * @param TValue $value
+ * @phpstan-param TValue $value
*/
public function contains($value): bool
{
@@ -53,9 +53,9 @@
}
/**
- * @param TValue[] $items
+ * @phpstan-param TValue[] $items
*
- * @return \Ibexa\Contracts\Core\Collection\ArrayList<TValue>
+ * @phpstan-return \Ibexa\Contracts\Core\Collection\ArrayList<TValue>
*/
protected function createFrom(array $items): self
{
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/contracts/Collection/ArrayMap.php vendor-4.6.7/ibexa/core/src/contracts/Collection/ArrayMap.php
--- vendor-4.6.2/ibexa/core/src/contracts/Collection/ArrayMap.php 2024-07-02 10:19:17.519305343 +0200
+++ vendor-4.6.7/ibexa/core/src/contracts/Collection/ArrayMap.php 2024-07-02 10:23:18.054890192 +0200
@@ -34,9 +34,9 @@
}
/**
- * @param TValue[] $items
+ * @phpstan-param TValue[] $items
*
- * @return \Ibexa\Contracts\Core\Collection\ArrayMap<TKey,TValue>
+ * @phpstan-return \Ibexa\Contracts\Core\Collection\ArrayMap<TKey,TValue>
*/
protected function createFrom(array $items): self
{
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/contracts/Event/Mapper/ResolveMissingFieldEvent.php vendor-4.6.7/ibexa/core/src/contracts/Event/Mapper/ResolveMissingFieldEvent.php
--- vendor-4.6.2/ibexa/core/src/contracts/Event/Mapper/ResolveMissingFieldEvent.php 1970-01-01 01:00:00.000000000 +0100
+++ vendor-4.6.7/ibexa/core/src/contracts/Event/Mapper/ResolveMissingFieldEvent.php 2024-07-02 10:23:18.054890192 +0200
@@ -0,0 +1,77 @@
+<?php
+
+/**
+ * @copyright Copyright (C) Ibexa AS. All rights reserved.
+ * @license For full copyright and license information view LICENSE file distributed with this source code.
+ */
+declare(strict_types=1);
+
+namespace Ibexa\Contracts\Core\Event\Mapper;
+
+use Ibexa\Contracts\Core\Persistence\Content;
+use Ibexa\Contracts\Core\Persistence\Content\Field;
+use Ibexa\Contracts\Core\Persistence\Content\Type\FieldDefinition;
+use Symfony\Contracts\EventDispatcher\Event;
+
+final class ResolveMissingFieldEvent extends Event
+{
+ private Content $content;
+
+ private FieldDefinition $fieldDefinition;
+
+ private string $languageCode;
+
+ /** @var array<mixed> */
+ private array $context;
+
+ private ?Field $field;
+
+ /**
+ * @param array<mixed> $context
+ */
+ public function __construct(
+ Content $content,
+ FieldDefinition $fieldDefinition,
+ string $languageCode,
+ array $context = []
+ ) {
+ $this->content = $content;
+ $this->fieldDefinition = $fieldDefinition;
+ $this->languageCode = $languageCode;
+ $this->context = $context;
+ $this->field = null;
+ }
+
+ public function getContent(): Content
+ {
+ return $this->content;
+ }
+
+ public function getFieldDefinition(): FieldDefinition
+ {
+ return $this->fieldDefinition;
+ }
+
+ public function getLanguageCode(): string
+ {
+ return $this->languageCode;
+ }
+
+ /**
+ * @return array<mixed>
+ */
+ public function getContext(): array
+ {
+ return $this->context;
+ }
+
+ public function setField(?Field $field): void
+ {
+ $this->field = $field;
+ }
+
+ public function getField(): ?Field
+ {
+ return $this->field;
+ }
+}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/contracts/FieldType/DefaultDataFieldStorage.php vendor-4.6.7/ibexa/core/src/contracts/FieldType/DefaultDataFieldStorage.php
--- vendor-4.6.2/ibexa/core/src/contracts/FieldType/DefaultDataFieldStorage.php 1970-01-01 01:00:00.000000000 +0100
+++ vendor-4.6.7/ibexa/core/src/contracts/FieldType/DefaultDataFieldStorage.php 2024-07-02 10:23:18.054890192 +0200
@@ -0,0 +1,24 @@
+<?php
+
+/**
+ * @copyright Copyright (C) Ibexa AS. All rights reserved.
+ * @license For full copyright and license information view LICENSE file distributed with this source code.
+ */
+declare(strict_types=1);
+
+namespace Ibexa\Contracts\Core\FieldType;
+
+use Ibexa\Contracts\Core\Persistence\Content\Field;
+use Ibexa\Contracts\Core\Persistence\Content\VersionInfo;
+
+interface DefaultDataFieldStorage extends FieldStorage
+{
+ /**
+ * Populates <code>$field</code> value property with default data based on the external data.
+ *
+ * <code>$field->value</code> is a {@see \Ibexa\Contracts\Core\Persistence\Content\FieldValue} object.
+ * This value holds the data as a {@see \Ibexa\Core\FieldType\Value} based object, according to
+ * the field type (e.g. for <code>TextLine</code>, it will be a {@see \Ibexa\Core\FieldType\TextLine\Value} object).
+ */
+ public function getDefaultFieldData(VersionInfo $versionInfo, Field $field): void;
+}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/contracts/Ibexa.php vendor-4.6.7/ibexa/core/src/contracts/Ibexa.php
--- vendor-4.6.2/ibexa/core/src/contracts/Ibexa.php 2024-07-02 10:19:17.519305343 +0200
+++ vendor-4.6.7/ibexa/core/src/contracts/Ibexa.php 2024-07-02 10:23:18.055890195 +0200
@@ -13,5 +13,5 @@
/**
* Ibexa DXP Version.
*/
- public const VERSION = '4.6.2';
+ public const VERSION = '4.6.7';
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/contracts/Persistence/Content/Handler.php vendor-4.6.7/ibexa/core/src/contracts/Persistence/Content/Handler.php
--- vendor-4.6.2/ibexa/core/src/contracts/Persistence/Content/Handler.php 2024-07-02 10:19:17.519305343 +0200
+++ vendor-4.6.7/ibexa/core/src/contracts/Persistence/Content/Handler.php 2024-07-02 10:23:18.055890195 +0200
@@ -283,6 +283,8 @@
/**
* Loads relations from $sourceContentId. Optionally, loads only those with $type and $sourceContentVersionNo.
*
+ * @deprecated 4.5.7 The "ContentService::loadRelations()" method is deprecated, will be removed in 5.0.
+ *
* @param mixed $sourceContentId Source Content ID
* @param mixed|null $sourceContentVersionNo Source Content Version, null if not specified
* @param int|null $type {@see \Ibexa\Contracts\Core\Repository\Values\Content\Relation::COMMON,
@@ -295,6 +297,26 @@
public function loadRelations($sourceContentId, $sourceContentVersionNo = null, $type = null);
/**
+ * Counts all outgoing relations for the given version.
+ */
+ public function countRelations(
+ int $sourceContentId,
+ ?int $sourceContentVersionNo = null,
+ ?int $type = null
+ ): int;
+
+ /**
+ * @return \Ibexa\Contracts\Core\Persistence\Content\Relation[]
+ */
+ public function loadRelationList(
+ int $sourceContentId,
+ int $limit,
+ int $offset = 0,
+ ?int $sourceContentVersionNo = null,
+ ?int $type = null
+ ): array;
+
+ /**
* Counts relations from $destinationContentId only against published versions. Optionally, count only those with $type.
*
* @param int $destinationContentId Destination Content ID
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/contracts/Repository/ContentService.php vendor-4.6.7/ibexa/core/src/contracts/Repository/ContentService.php
--- vendor-4.6.2/ibexa/core/src/contracts/Repository/ContentService.php 2024-07-02 10:19:17.520305345 +0200
+++ vendor-4.6.7/ibexa/core/src/contracts/Repository/ContentService.php 2024-07-02 10:23:18.055890195 +0200
@@ -30,6 +30,8 @@
*/
interface ContentService
{
+ public const DEFAULT_PAGE_SIZE = 25;
+
/**
* Loads a content info object.
*
@@ -398,13 +400,37 @@
*
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException if the user is not allowed to read this version
*
- * @param \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo $versionInfo
+ * @deprecated 4.5.7 The "ContentService::loadRelations()" method is deprecated, will be removed in 5.0.
*
* @return \Ibexa\Contracts\Core\Repository\Values\Content\Relation[]
*/
public function loadRelations(VersionInfo $versionInfo): iterable;
/**
+ * Loads all outgoing relations for the given version.
+ *
+ * If the user is not allowed to read specific version then a returned `RelationList` will contain `UnauthorizedRelationListItem`
+ *
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
+ *
+ * @see \Ibexa\Contracts\Core\Repository\Values\Content\RelationList\Item\UnauthorizedRelationListItem
+ */
+ public function loadRelationList(
+ VersionInfo $versionInfo,
+ int $offset = 0,
+ int $limit = self::DEFAULT_PAGE_SIZE
+ ): RelationList;
+
+ /**
+ * Counts all outgoing relations for the given version.
+ *
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
+ */
+ public function countRelations(VersionInfo $versionInfo): int;
+
+ /**
* Counts all incoming relations for the given content object.
*
* @param \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/contracts/Repository/Decorator/ContentServiceDecorator.php vendor-4.6.7/ibexa/core/src/contracts/Repository/Decorator/ContentServiceDecorator.php
--- vendor-4.6.2/ibexa/core/src/contracts/Repository/Decorator/ContentServiceDecorator.php 2024-07-02 10:19:17.520305345 +0200
+++ vendor-4.6.7/ibexa/core/src/contracts/Repository/Decorator/ContentServiceDecorator.php 2024-07-02 10:23:18.055890195 +0200
@@ -193,6 +193,16 @@
return $this->innerService->loadRelations($versionInfo);
}
+ public function countRelations(VersionInfo $versionInfo): int
+ {
+ return $this->innerService->countRelations($versionInfo);
+ }
+
+ public function loadRelationList(VersionInfo $versionInfo, int $offset = 0, int $limit = self::DEFAULT_PAGE_SIZE): RelationList
+ {
+ return $this->innerService->loadRelationList($versionInfo, $offset, $limit);
+ }
+
public function countReverseRelations(ContentInfo $contentInfo): int
{
return $this->innerService->countReverseRelations($contentInfo);
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/contracts/Repository/LocationService.php vendor-4.6.7/ibexa/core/src/contracts/Repository/LocationService.php
--- vendor-4.6.2/ibexa/core/src/contracts/Repository/LocationService.php 2024-07-02 10:19:17.520305345 +0200
+++ vendor-4.6.7/ibexa/core/src/contracts/Repository/LocationService.php 2024-07-02 10:23:18.055890195 +0200
@@ -97,6 +97,10 @@
/**
* Loads children which are readable by the current user of a location object sorted by sortField and sortOrder.
*
+ * Use this method with caution. It performs heavy queries on the database.
+ * Consider using {@see \eZ\Publish\API\Repository\SearchService::findLocations()} with
+ * {@see \eZ\Publish\Core\QueryType\BuiltIn\ChildrenQueryType} as an alternative.
+ *
* @param \Ibexa\Contracts\Core\Repository\Values\Content\Location $location
* @param int $offset the start offset for paging
* @param int $limit the number of locations returned
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/contracts/Repository/Values/Content/ContentInfo.php vendor-4.6.7/ibexa/core/src/contracts/Repository/Values/Content/ContentInfo.php
--- vendor-4.6.2/ibexa/core/src/contracts/Repository/Values/Content/ContentInfo.php 2024-07-02 10:19:17.520305345 +0200
+++ vendor-4.6.7/ibexa/core/src/contracts/Repository/Values/Content/ContentInfo.php 2024-07-02 10:23:18.055890195 +0200
@@ -15,9 +15,9 @@
/**
* This class provides all version independent information of the Content object.
*
- * @property-read int $id @deprecated Use {@see ContentInfo::getId} instead. The unique id of the Content object
+ * @property-read int $id @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see ContentInfo::getId()} instead.
* @property-read int $contentTypeId The unique id of the content type item the Content object is an instance of
- * @property-read string $name the computed name (via name schema) in the main language of the Content object
+ * @property-read string $name @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see ContentInfo::getName()} instead.
* @property-read int $sectionId @deprecated 4.6.2 Use {@see ContentInfo::getSectionId} instead. The section to which the Content object is assigned
* @property-read int $currentVersionNo Current Version number is the version number of the published version or the version number of a newly created draft (which is 1).
* @property-read bool $published true if there exists a published version false otherwise
@@ -29,7 +29,7 @@
* @property-read string $mainLanguageCode The main language code of the Content object. If the available flag is set to true the Content is shown in this language if the requested language does not exist.
* @property-read int|null $mainLocationId @deprecated Use {@see ContentInfo::getMainLocationId} instead
* @property-read int $status status of the Content object
- * @property-read bool $isHidden status of the Content object
+ * @property-read bool $isHidden @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see ContentInfo::isHidden()} instead.
*/
class ContentInfo extends ValueObject
{
@@ -185,6 +185,11 @@
return $this->status === self::STATUS_TRASHED;
}
+ public function isHidden(): bool
+ {
+ return $this->isHidden;
+ }
+
public function getContentType(): ContentType
{
return $this->contentType;
@@ -229,6 +234,11 @@
{
return $this->id;
}
+
+ public function getName(): string
+ {
+ return $this->name;
+ }
}
class_alias(ContentInfo::class, 'eZ\Publish\API\Repository\Values\Content\ContentInfo');
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/contracts/Repository/Values/Content/Content.php vendor-4.6.7/ibexa/core/src/contracts/Repository/Values/Content/Content.php
--- vendor-4.6.2/ibexa/core/src/contracts/Repository/Values/Content/Content.php 2024-07-02 10:19:17.520305345 +0200
+++ vendor-4.6.7/ibexa/core/src/contracts/Repository/Values/Content/Content.php 2024-07-02 10:23:18.055890195 +0200
@@ -15,14 +15,24 @@
/**
* this class represents a content object in a specific version.
*
- * @property-read \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo convenience getter for getVersionInfo()->getContentInfo()
- * @property-read int $id convenience getter for retrieving the contentId: $versionInfo->contentInfo->id
+ * @property-read \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Content::getContentInfo()} instead.
+ * @property-read int $id @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Content::getId()} instead.
* @property-read \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo $versionInfo calls getVersionInfo()
* @property-read \Ibexa\Contracts\Core\Repository\Values\Content\Field[] $fields access fields, calls getFields()
* @property-read \Ibexa\Contracts\Core\Repository\Values\Content\Thumbnail|null $thumbnail calls getThumbnail()
*/
abstract class Content extends ValueObject
{
+ public function getId(): int
+ {
+ return $this->getContentInfo()->getId();
+ }
+
+ public function getContentInfo(): ContentInfo
+ {
+ return $this->getVersionInfo()->getContentInfo();
+ }
+
/**
* Returns the VersionInfo for this version.
*
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/contracts/Repository/Values/Content/Field.php vendor-4.6.7/ibexa/core/src/contracts/Repository/Values/Content/Field.php
--- vendor-4.6.2/ibexa/core/src/contracts/Repository/Values/Content/Field.php 2024-07-02 10:19:17.520305345 +0200
+++ vendor-4.6.7/ibexa/core/src/contracts/Repository/Values/Content/Field.php 2024-07-02 10:23:18.055890195 +0200
@@ -24,7 +24,8 @@
/**
* The field id.
*
- * @todo may be not needed
+ * Value of `null` indicates the field is virtual
+ * and is not persisted (yet).
*
* @var mixed
*/
@@ -58,7 +59,7 @@
*/
protected $fieldTypeIdentifier;
- public function getId(): int
+ public function getId(): ?int
{
return $this->id;
}
@@ -85,6 +86,14 @@
{
return $this->fieldTypeIdentifier;
}
+
+ /**
+ * @phpstan-assert-if-true !null $this->getId()
+ */
+ public function isVirtual(): bool
+ {
+ return null === $this->id;
+ }
}
class_alias(Field::class, 'eZ\Publish\API\Repository\Values\Content\Field');
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/contracts/Repository/Values/Content/Location.php vendor-4.6.7/ibexa/core/src/contracts/Repository/Values/Content/Location.php
--- vendor-4.6.2/ibexa/core/src/contracts/Repository/Values/Content/Location.php 2024-07-02 10:19:17.520305345 +0200
+++ vendor-4.6.7/ibexa/core/src/contracts/Repository/Values/Content/Location.php 2024-07-02 10:23:18.055890195 +0200
@@ -16,17 +16,17 @@
* This class represents a location in the repository.
*
* @property-read \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo calls getContentInfo()
- * @property-read int $contentId calls getContentInfo()->id
- * @property-read int $id the id of the location
+ * @property-read int $contentId @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getContentId()} instead.
+ * @property-read int $id @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getId()} instead.
* @property-read int $priority Position of the Location among its siblings when sorted using priority
- * @property-read bool $hidden Indicates that the Location entity is hidden (explicitly or hidden by content).
- * @property-read bool $invisible Indicates that the Location is not visible, being either marked as hidden itself, or implicitly hidden by its Content or an ancestor Location
+ * @property-read bool $hidden @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::isHidden()} instead.
+ * @property-read bool $invisible @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::isInvisible()} instead.
* @property-read bool $explicitlyHidden Indicates that the Location entity has been explicitly marked as hidden.
* @property-read string $remoteId a global unique id of the content object
* @property-read int $parentLocationId the id of the parent location
- * @property-read string $pathString @deprecated use {@see Location::getPathString()} instead.
- * @property-read array $path Same as $pathString but as array, e.g. [ 1, 2, 4, 23 ]
- * @property-read int $depth Depth location has in the location tree
+ * @property-read string $pathString @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getPathString()} instead.
+ * @property-read array $path @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getPath()} instead.
+ * @property-read int $depth @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see Location::getDepth()} instead.
* @property-read int $sortField Specifies which property the child locations should be sorted on. Valid values are found at {@link Location::SORT_FIELD_*}
* @property-read int $sortOrder Specifies whether the sort order should be ascending or descending. Valid values are {@link Location::SORT_ORDER_*}
*/
@@ -159,6 +159,13 @@
protected $pathString;
/**
+ * Same as {@see Location::$pathString} but as array, e.g.: <code>[ '1', '2', '4', '23' ]</code>.
+ *
+ * @var string[]
+ */
+ protected array $path;
+
+ /**
* Depth location has in the location tree.
*
* @var int
@@ -194,12 +201,22 @@
abstract public function getContentInfo(): ContentInfo;
/**
- * Return the parent location of of this location.
+ * Return the parent location of this location.
*
* @return \Ibexa\Contracts\Core\Repository\Values\Content\Location|null
*/
abstract public function getParentLocation(): ?Location;
+ public function getId(): int
+ {
+ return $this->id;
+ }
+
+ public function getContentId(): int
+ {
+ return $this->getContentInfo()->getId();
+ }
+
/**
* Returns true if current location is a draft.
*
@@ -248,6 +265,62 @@
{
return $this->pathString;
}
+
+ /**
+ * Same as {@see Location::getPathString()} but as array, e.g.: <code>[ '1', '2', '4', '23' ]</code>.
+ *
+ * @return string[]
+ */
+ public function getPath(): array
+ {
+ if (isset($this->path)) {
+ return $this->path;
+ }
+
+ $pathString = trim($this->pathString ?? '', '/');
+
+ return $this->path = !empty($pathString) ? explode('/', $pathString) : [];
+ }
+
+ /**
+ * Indicates that the Location is not visible, being either marked as hidden itself, or implicitly hidden by
+ * its Content or an ancestor Location.
+ */
+ public function isInvisible(): bool
+ {
+ return $this->invisible;
+ }
+
+ /**
+ * Indicates that the Location is hidden either explicitly or by content.
+ */
+ public function isHidden(): bool
+ {
+ return $this->hidden;
+ }
+
+ public function getDepth(): int
+ {
+ return $this->depth;
+ }
+
+ public function __isset($property)
+ {
+ if ($property === 'path') {
+ return true;
+ }
+
+ return parent::__isset($property);
+ }
+
+ public function __get($property)
+ {
+ if ($property === 'path') {
+ return $this->getPath();
+ }
+
+ return parent::__get($property);
+ }
}
class_alias(Location::class, 'eZ\Publish\API\Repository\Values\Content\Location');
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/contracts/Repository/Values/Content/Query/Criterion/IsContainer.php vendor-4.6.7/ibexa/core/src/contracts/Repository/Values/Content/Query/Criterion/IsContainer.php
--- vendor-4.6.2/ibexa/core/src/contracts/Repository/Values/Content/Query/Criterion/IsContainer.php 1970-01-01 01:00:00.000000000 +0100
+++ vendor-4.6.7/ibexa/core/src/contracts/Repository/Values/Content/Query/Criterion/IsContainer.php 2024-07-02 10:23:18.055890195 +0200
@@ -0,0 +1,32 @@
+<?php
+
+/**
+ * @copyright Copyright (C) Ibexa AS. All rights reserved.
+ * @license For full copyright and license information view LICENSE file distributed with this source code.
+ */
+declare(strict_types=1);
+
+namespace Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion;
+
+use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion;
+use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Operator\Specifications;
+use Ibexa\Contracts\Core\Repository\Values\Filter\FilteringCriterion;
+
+final class IsContainer extends Criterion implements FilteringCriterion
+{
+ public function __construct(bool $value = true)
+ {
+ parent::__construct(null, null, $value);
+ }
+
+ public function getSpecifications(): array
+ {
+ return [
+ new Specifications(
+ Operator::EQ,
+ Specifications::FORMAT_SINGLE,
+ Specifications::TYPE_BOOLEAN
+ ),
+ ];
+ }
+}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/contracts/Repository/Values/Content/URLAlias.php vendor-4.6.7/ibexa/core/src/contracts/Repository/Values/Content/URLAlias.php
--- vendor-4.6.2/ibexa/core/src/contracts/Repository/Values/Content/URLAlias.php 2024-07-02 10:19:17.520305345 +0200
+++ vendor-4.6.7/ibexa/core/src/contracts/Repository/Values/Content/URLAlias.php 2024-07-02 10:23:18.055890195 +0200
@@ -17,7 +17,7 @@
* @property-read int $type The type of the URL Alias i.e. one of URLAlias::LOCATION, URLAlias::RESOURCE, URLAlias::VIRTUAL
* @property-read mixed $destination If type = URLAlias::LOCATION it is a Location id otherwise a string (e.g. /content/search)
* @property-read string $path the alias path
- * @property-read string[] languageCodes the languages for which this alias is valid
+ * @property-read string[] $languageCodes the languages for which this alias is valid
* @property-read bool $alwaysAvailable Fallback indicator for other languages
* @property-read bool $isHistory Indicates that this alias was autogenerated for an in the meanwhile archived version of the content
* @property-read bool $isCustom If false this alias was autogenerated otherwise manuel created
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/contracts/Repository/Values/Content/VersionInfo.php vendor-4.6.7/ibexa/core/src/contracts/Repository/Values/Content/VersionInfo.php
--- vendor-4.6.2/ibexa/core/src/contracts/Repository/Values/Content/VersionInfo.php 2024-07-02 10:19:17.521305348 +0200
+++ vendor-4.6.7/ibexa/core/src/contracts/Repository/Values/Content/VersionInfo.php 2024-07-02 10:23:18.055890195 +0200
@@ -18,7 +18,7 @@
*
* @property-read \Ibexa\Contracts\Core\Repository\Values\Content\ContentInfo $contentInfo calls getContentInfo()
* @property-read mixed $id the internal id of the version
- * @property-read int $versionNo the version number of this version (which only increments in scope of a single Content object)
+ * @property-read int $versionNo @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see VersionInfo::getVersionNo()} instead.
* @property-read \DateTime $modificationDate the last modified date of this version
* @property-read \DateTime $creationDate the creation date of this version
* @property-read mixed $creatorId the user id of the user which created this version
@@ -89,7 +89,7 @@
*
* @var string[]
*/
- protected $languageCodes = [];
+ protected array $languageCodes = [];
/**
* Content of the content this version belongs to.
@@ -108,6 +108,19 @@
abstract public function getLanguages(): iterable;
/**
+ * @return array<string>
+ */
+ public function getLanguageCodes(): array
+ {
+ return $this->languageCodes;
+ }
+
+ public function getVersionNo(): int
+ {
+ return $this->versionNo;
+ }
+
+ /**
* Returns true if version is a draft.
*
* @return bool
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/contracts/Repository/Values/ContentType/ContentType.php vendor-4.6.7/ibexa/core/src/contracts/Repository/Values/ContentType/ContentType.php
--- vendor-4.6.2/ibexa/core/src/contracts/Repository/Values/ContentType/ContentType.php 2024-07-02 10:19:17.521305348 +0200
+++ vendor-4.6.7/ibexa/core/src/contracts/Repository/Values/ContentType/ContentType.php 2024-07-02 10:23:18.056890197 +0200
@@ -19,7 +19,7 @@
* @property-read \Ibexa\Contracts\Core\Repository\Values\ContentType\FieldDefinitionCollection $fieldDefinitions calls getFieldDefinitions() or on access getFieldDefinition($fieldDefIdentifier)
* @property-read mixed $id the id of the content type
* @property-read int $status the status of the content type. One of ContentType::STATUS_DEFINED|ContentType::STATUS_DRAFT|ContentType::STATUS_MODIFIED
- * @property-read string $identifier the identifier of the content type
+ * @property-read string $identifier @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see ContentType::getIdentifier()} instead.
* @property-read \DateTime $creationDate the date of the creation of this content type
* @property-read \DateTime $modificationDate the date of the last modification of this content type
* @property-read mixed $creatorId the user id of the creator of this content type
@@ -176,6 +176,11 @@
*/
abstract public function getFieldDefinitions(): FieldDefinitionCollection;
+ public function getIdentifier(): string
+ {
+ return $this->identifier;
+ }
+
/**
* This method returns the field definition for the given identifier.
*
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/contracts/Repository/Values/ContentType/FieldDefinition.php vendor-4.6.7/ibexa/core/src/contracts/Repository/Values/ContentType/FieldDefinition.php
--- vendor-4.6.2/ibexa/core/src/contracts/Repository/Values/ContentType/FieldDefinition.php 2024-07-02 10:19:17.521305348 +0200
+++ vendor-4.6.7/ibexa/core/src/contracts/Repository/Values/ContentType/FieldDefinition.php 2024-07-02 10:23:18.056890197 +0200
@@ -15,20 +15,20 @@
/**
* This class represents a field definition.
*
- * @property-read array $fieldSettings calls getFieldSettings()
- * @property-read array $validatorConfiguration calls getValidatorConfiguration()
- * @property-read int $id the id of the field definition
- * @property-read string $identifier the identifier of the field definition
- * @property-read string $fieldGroup the field group name
- * @property-read int $position the position of the field definition in the content type
- * @property-read string $fieldTypeIdentifier String identifier of the field type
- * @property-read bool $isTranslatable indicates if fields of this definition are translatable
- * @property-read bool $isRequired indicates if this field is required in the content object
- * @property-read bool $isSearchable indicates if the field is searchable
- * @property-read bool $isThumbnail indicates if the field can be thumbnail
- * @property-read bool $isInfoCollector indicates if this field is used for information collection
- * @property-read mixed $defaultValue the default value of the field
- * @property-read string $mainLanguageCode main Translation (language code) of a multilingual Field Definition
+ * @property-read array $fieldSettings @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see FieldDefinition::getFieldSettings()} instead.
+ * @property-read array $validatorConfiguration @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see FieldDefinition::getValidatorConfiguration()} instead.
+ * @property-read int $id @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see FieldDefinition::getId()} instead.
+ * @property-read string $identifier @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see FieldDefinition::getIdentifier()} instead.
+ * @property-read string $fieldGroup @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see FieldDefinition::getFieldGroup()} instead.
+ * @property-read int $position @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see FieldDefinition::getPosition()} instead.
+ * @property-read string $fieldTypeIdentifier @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see FieldDefinition::getFieldTypeIdentifier()} instead.
+ * @property-read bool $isTranslatable @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see FieldDefinition::$isTranslatable()} instead.
+ * @property-read bool $isRequired @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see FieldDefinition::$isRequired()} instead.
+ * @property-read bool $isSearchable @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see FieldDefinition::getIdentifier()} instead.
+ * @property-read bool $isThumbnail @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see FieldDefinition::isThumbnail()} instead.
+ * @property-read bool $isInfoCollector @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see FieldDefinition::$isInfoCollector()} instead.
+ * @property-read mixed $defaultValue @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see FieldDefinition::getDefaultValue()} instead.
+ * @property-read string $mainLanguageCode @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see FieldDefinition::getMainLanguageCode()} instead.
*/
abstract class FieldDefinition extends ValueObject implements MultiLanguageName, MultiLanguageDescription
{
@@ -129,6 +129,69 @@
* @var string
*/
protected $mainLanguageCode;
+
+ public function getId(): int
+ {
+ return $this->id;
+ }
+
+ public function getFieldGroup(): string
+ {
+ return $this->fieldGroup;
+ }
+
+ public function getPosition(): int
+ {
+ return $this->position;
+ }
+
+ public function isTranslatable(): bool
+ {
+ return $this->isTranslatable;
+ }
+
+ public function isRequired(): bool
+ {
+ return $this->isRequired;
+ }
+
+ public function isInfoCollector(): bool
+ {
+ return $this->isInfoCollector;
+ }
+
+ /**
+ * @return mixed
+ */
+ public function getDefaultValue()
+ {
+ return $this->defaultValue;
+ }
+
+ public function isSearchable(): bool
+ {
+ return $this->isSearchable;
+ }
+
+ public function getMainLanguageCode(): string
+ {
+ return $this->mainLanguageCode;
+ }
+
+ public function isThumbnail(): bool
+ {
+ return $this->isThumbnail;
+ }
+
+ public function getIdentifier(): string
+ {
+ return $this->identifier;
+ }
+
+ public function getFieldTypeIdentifier(): string
+ {
+ return $this->fieldTypeIdentifier;
+ }
}
class_alias(FieldDefinition::class, 'eZ\Publish\API\Repository\Values\ContentType\FieldDefinition');
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/contracts/Repository/Values/User/LookupLimitationResult.php vendor-4.6.7/ibexa/core/src/contracts/Repository/Values/User/LookupLimitationResult.php
--- vendor-4.6.2/ibexa/core/src/contracts/Repository/Values/User/LookupLimitationResult.php 2024-07-02 10:19:17.521305348 +0200
+++ vendor-4.6.7/ibexa/core/src/contracts/Repository/Values/User/LookupLimitationResult.php 2024-07-02 10:23:18.056890197 +0200
@@ -16,16 +16,15 @@
final class LookupLimitationResult extends ValueObject
{
/** @var bool */
- protected $hasAccess;
+ protected bool $hasAccess;
/** @var \Ibexa\Contracts\Core\Repository\Values\User\Limitation[] */
- protected $roleLimitations;
+ protected array $roleLimitations;
/** @var \Ibexa\Contracts\Core\Repository\Values\User\LookupPolicyLimitations[] */
- protected $lookupPolicyLimitations;
+ protected array $lookupPolicyLimitations;
/**
- * @param bool $hasAccess
* @param \Ibexa\Contracts\Core\Repository\Values\User\Limitation[] $roleLimitations
* @param \Ibexa\Contracts\Core\Repository\Values\User\LookupPolicyLimitations[] $lookupPolicyLimitations
*/
@@ -40,6 +39,27 @@
$this->lookupPolicyLimitations = $lookupPolicyLimitations;
$this->roleLimitations = $roleLimitations;
}
+
+ public function hasAccess(): bool
+ {
+ return $this->hasAccess;
+ }
+
+ /**
+ * @return \Ibexa\Contracts\Core\Repository\Values\User\Limitation[]
+ */
+ public function getRoleLimitations(): array
+ {
+ return $this->roleLimitations;
+ }
+
+ /**
+ * @return \Ibexa\Contracts\Core\Repository\Values\User\LookupPolicyLimitations[]
+ */
+ public function getLookupPolicyLimitations(): array
+ {
+ return $this->lookupPolicyLimitations;
+ }
}
class_alias(LookupLimitationResult::class, 'eZ\Publish\API\Repository\Values\User\LookupLimitationResult');
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/contracts/Repository/Values/User/User.php vendor-4.6.7/ibexa/core/src/contracts/Repository/Values/User/User.php
--- vendor-4.6.2/ibexa/core/src/contracts/Repository/Values/User/User.php 2024-07-02 10:19:17.521305348 +0200
+++ vendor-4.6.7/ibexa/core/src/contracts/Repository/Values/User/User.php 2024-07-02 10:23:18.056890197 +0200
@@ -11,11 +11,9 @@
use Ibexa\Contracts\Core\Repository\Values\Content\Content;
/**
- * This class represents a user value.
- *
- * @property-read string $login
+ * @property-read string $login @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see User::getLogin()} instead.
* @property-read string $email
- * @property-read string $passwordHash
+ * @property-read string $passwordHash @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see User::getPasswordHash()} instead.
* @property-read string $hashAlgorithm Hash algorithm used to hash the password
* @property-read \DateTimeInterface|null $passwordUpdatedAt
* @property-read bool $enabled User can not login if false
@@ -94,14 +92,20 @@
*/
protected $maxLogin;
- /**
- * The User id of the User.
- *
- * @return int
- */
public function getUserId(): int
{
- return $this->id;
+ // ATM User Id is the same as Content Id
+ return $this->getId();
+ }
+
+ public function getLogin(): string
+ {
+ return $this->login;
+ }
+
+ public function getPasswordHash(): string
+ {
+ return $this->passwordHash;
}
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/FieldType/Image/SearchField.php vendor-4.6.7/ibexa/core/src/lib/FieldType/Image/SearchField.php
--- vendor-4.6.2/ibexa/core/src/lib/FieldType/Image/SearchField.php 2024-07-02 10:19:17.521305348 +0200
+++ vendor-4.6.7/ibexa/core/src/lib/FieldType/Image/SearchField.php 2024-07-02 10:23:18.056890197 +0200
@@ -18,8 +18,13 @@
{
public function getIndexData(Field $field, FieldDefinition $fieldDefinition)
{
- $width = $field->value->data['width'] ?? null;
- $height = $field->value->data['height'] ?? null;
+ $width = isset($field->value->data['width']) && $field->value->data['width'] !== null
+ ? (int)$field->value->data['width']
+ : null;
+
+ $height = isset($field->value->data['height']) && $field->value->data['height'] !== null
+ ? (int)$field->value->data['height']
+ : null;
return [
new Search\Field(
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/MVC/Symfony/Routing/Generator/UrlAliasGenerator.php vendor-4.6.7/ibexa/core/src/lib/MVC/Symfony/Routing/Generator/UrlAliasGenerator.php
--- vendor-4.6.2/ibexa/core/src/lib/MVC/Symfony/Routing/Generator/UrlAliasGenerator.php 2024-07-02 10:19:17.521305348 +0200
+++ vendor-4.6.7/ibexa/core/src/lib/MVC/Symfony/Routing/Generator/UrlAliasGenerator.php 2024-07-02 10:23:18.056890197 +0200
@@ -103,10 +103,12 @@
* Returns path corresponding to $rootLocationId.
*
* @param int $rootLocationId
- * @param array $languages
+ * @param array<string>|null $languages
* @param string $siteaccess
*
* @return string
+ *
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
*/
public function getPathPrefixByRootLocationId($rootLocationId, $languages = null, $siteaccess = null)
{
@@ -122,7 +124,7 @@
$this->pathPrefixMap[$siteaccess][$rootLocationId] = $this->repository
->getURLAliasService()
->reverseLookup(
- $this->loadLocation($rootLocationId),
+ $this->loadLocation($rootLocationId, $languages),
null,
false,
$languages
@@ -157,15 +159,16 @@
* Not to be used for link generation.
*
* @param int $locationId
+ * @param array<string>|null $languages
*
* @return \Ibexa\Core\Repository\Values\Content\Location
*/
- public function loadLocation($locationId)
+ public function loadLocation($locationId, ?array $languages = null)
{
return $this->repository->sudo(
- static function (Repository $repository) use ($locationId) {
+ static function (Repository $repository) use ($locationId, $languages) {
/* @var $repository \Ibexa\Core\Repository\Repository */
- return $repository->getLocationService()->loadLocation($locationId);
+ return $repository->getLocationService()->loadLocation($locationId, $languages);
}
);
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/MVC/Symfony/Routing/SimplifiedRequest.php vendor-4.6.7/ibexa/core/src/lib/MVC/Symfony/Routing/SimplifiedRequest.php
--- vendor-4.6.2/ibexa/core/src/lib/MVC/Symfony/Routing/SimplifiedRequest.php 2024-07-02 10:19:17.521305348 +0200
+++ vendor-4.6.7/ibexa/core/src/lib/MVC/Symfony/Routing/SimplifiedRequest.php 2024-07-02 10:23:18.056890197 +0200
@@ -9,13 +9,13 @@
use Ibexa\Contracts\Core\Repository\Values\ValueObject;
/**
- * @property-read string $scheme The request scheme - http or https
- * @property-read string $host The host name
- * @property-read string $port The port the request is made on
- * @property-read string $pathinfo The path being requested relative to the executed script
- * @property-read array $queryParams Array of parameters extracted from the query string
- * @property-read array $languages List of languages acceptable by the client browser
- * @property-read array $headers Hash of request headers
+ * @property-read string $scheme @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see SimplifiedRequest::getScheme()} instead.
+ * @property-read string $host @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see SimplifiedRequest::getHost()} instead.
+ * @property-read string $port @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see SimplifiedRequest::getPort()} instead.
+ * @property-read string $pathinfo @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see SimplifiedRequest::getPathInfo()} instead.
+ * @property-read array $queryParams @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see SimplifiedRequest::getQueryParams()} instead.
+ * @property-read array $languages @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see SimplifiedRequest::getLanguages()} instead.
+ * @property-read array $headers @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see SimplifiedRequest::getHeaders()} instead.
*/
class SimplifiedRequest extends ValueObject
{
@@ -158,6 +158,64 @@
return ['scheme', 'host', 'port', 'pathinfo', 'queryParams', 'languages', 'headers'];
}
+
+ /**
+ * The request scheme - http or https.
+ */
+ public function getScheme(): string
+ {
+ return $this->scheme;
+ }
+
+ public function getHost(): string
+ {
+ return $this->host;
+ }
+
+ public function getPort(): string
+ {
+ return $this->port;
+ }
+
+ /**
+ * The path being requested relative to the executed script.
+ */
+ public function getPathInfo(): string
+ {
+ return $this->pathinfo;
+ }
+
+ /**
+ * @return array<mixed>
+ */
+ public function getQueryParams(): array
+ {
+ return $this->queryParams;
+ }
+
+ /**
+ * @return string[]
+ */
+ public function getLanguages(): array
+ {
+ return $this->languages;
+ }
+
+ /**
+ * @return array<string>|null
+ */
+ public function getHeader(string $headerName): ?array
+ {
+ return $this->headers[$headerName] ?? null;
+ }
+
+ /**
+ * @return array<string, array<string>>
+ */
+ public function getHeaders(): array
+ {
+ return $this->headers;
+ }
}
class_alias(SimplifiedRequest::class, 'eZ\Publish\Core\MVC\Symfony\Routing\SimplifiedRequest');
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/MVC/Symfony/Security/User.php vendor-4.6.7/ibexa/core/src/lib/MVC/Symfony/Security/User.php
--- vendor-4.6.2/ibexa/core/src/lib/MVC/Symfony/Security/User.php 2024-07-02 10:19:17.521305348 +0200
+++ vendor-4.6.7/ibexa/core/src/lib/MVC/Symfony/Security/User.php 2024-07-02 10:23:18.056890197 +0200
@@ -57,12 +57,10 @@
*
* This should be the encoded password. On authentication, a plain-text
* password will be salted, encoded, and then compared to this value.
- *
- * @return string The password
*/
- public function getPassword()
+ public function getPassword(): string
{
- return $this->getAPIUser()->passwordHash;
+ return $this->getAPIUser()->getPasswordHash();
}
/**
@@ -79,12 +77,10 @@
/**
* Returns the username used to authenticate the user.
- *
- * @return string The username
*/
- public function getUsername()
+ public function getUsername(): string
{
- return $this->getAPIUser()->login;
+ return $this->getAPIUser()->getLogin();
}
/**
@@ -142,7 +138,7 @@
public function __toString()
{
- return $this->getAPIUser()->contentInfo->name;
+ return $this->getAPIUser()->getContentInfo()->getName();
}
/**
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/MVC/Symfony/SiteAccess/Router.php vendor-4.6.7/ibexa/core/src/lib/MVC/Symfony/SiteAccess/Router.php
--- vendor-4.6.2/ibexa/core/src/lib/MVC/Symfony/SiteAccess/Router.php 2024-07-02 10:19:17.521305348 +0200
+++ vendor-4.6.7/ibexa/core/src/lib/MVC/Symfony/SiteAccess/Router.php 2024-07-02 10:23:18.056890197 +0200
@@ -130,19 +130,20 @@
}
// Request header always have precedence
- // Note: request headers are always in lower cased.
- if (!empty($request->headers['x-siteaccess'])) {
- $siteaccessName = $request->headers['x-siteaccess'][0];
- if (!$this->siteAccessProvider->isDefined($siteaccessName)) {
+ // Note: request headers are always lower case.
+ $xSiteAccess = $request->getHeader('x-siteaccess');
+ if (!empty($xSiteAccess) && is_array($xSiteAccess)) {
+ $siteAccessName = $xSiteAccess[0];
+ if (!$this->siteAccessProvider->isDefined($siteAccessName)) {
throw new InvalidSiteAccessException(
- $siteaccessName,
+ $siteAccessName,
$this->siteAccessProvider,
'X-Siteaccess request header',
$this->debug
);
}
- $this->siteAccess = $this->siteAccessProvider->getSiteAccess($siteaccessName);
+ $this->siteAccess = $this->siteAccessProvider->getSiteAccess($siteAccessName);
$this->siteAccess->matchingType = self::HEADER_SA_MATCHING_TYPE;
return $this->siteAccess;
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/Persistence/Cache/ContentHandler.php vendor-4.6.7/ibexa/core/src/lib/Persistence/Cache/ContentHandler.php
--- vendor-4.6.2/ibexa/core/src/lib/Persistence/Cache/ContentHandler.php 2024-07-02 10:19:17.521305348 +0200
+++ vendor-4.6.7/ibexa/core/src/lib/Persistence/Cache/ContentHandler.php 2024-07-02 10:23:18.056890197 +0200
@@ -31,6 +31,10 @@
private const CONTENT_VERSION_LIST_IDENTIFIER = 'content_version_list';
private const CONTENT_VERSION_INFO_IDENTIFIER = 'content_version_info';
private const CONTENT_VERSION_IDENTIFIER = 'content_version';
+ private const CONTENT_RELATIONS_COUNT_WITH_VERSION_TYPE_IDENTIFIER = 'content_relations_count_with_by_version_type_suffix';
+ private const CONTENT_RELATION_IDENTIFIER = 'content_relation';
+ private const CONTENT_RELATIONS_LIST_IDENTIFIER = 'content_relations_list';
+ private const CONTENT_RELATIONS_LIST_WITH_VERSION_TYPE_IDENTIFIER = 'content_relations_list_with_by_version_type_suffix';
private const CONTENT_REVERSE_RELATIONS_COUNT_IDENTIFIER = 'content_reverse_relations_count';
private const RELATION_IDENTIFIER = 'relation';
@@ -517,6 +521,97 @@
return $this->persistenceHandler->contentHandler()->loadRelations($sourceContentId, $sourceContentVersionNo, $type);
}
+ public function countRelations(int $sourceContentId, ?int $sourceContentVersionNo = null, ?int $type = null): int
+ {
+ $cacheItem = $this->cache->getItem(
+ $this->cacheIdentifierGenerator->generateKey(
+ self::CONTENT_RELATIONS_COUNT_WITH_VERSION_TYPE_IDENTIFIER,
+ [$sourceContentId, $sourceContentVersionNo, $type],
+ true
+ )
+ );
+
+ if ($cacheItem->isHit()) {
+ $this->logger->logCacheHit(['content' => $sourceContentId, 'version' => $sourceContentVersionNo, 'type' => $type]);
+
+ return $cacheItem->get();
+ }
+
+ $this->logger->logCacheMiss(['content' => $sourceContentId, 'version' => $sourceContentVersionNo, 'type' => $type]);
+ $relationsCount = $this->persistenceHandler->contentHandler()->countRelations(
+ $sourceContentId,
+ $sourceContentVersionNo,
+ $type
+ );
+ $cacheItem->set($relationsCount);
+ $tags = [
+ $this->cacheIdentifierGenerator->generateTag(
+ self::CONTENT_IDENTIFIER,
+ [$sourceContentId]
+ ),
+ ];
+
+ $cacheItem->tag($tags);
+ $this->cache->save($cacheItem);
+
+ return $relationsCount;
+ }
+
+ public function loadRelationList(
+ int $sourceContentId,
+ int $limit,
+ int $offset = 0,
+ ?int $sourceContentVersionNo = null,
+ ?int $type = null
+ ): array {
+ return $this->getListCacheValue(
+ $this->cacheIdentifierGenerator->generateKey(
+ self::CONTENT_RELATIONS_LIST_WITH_VERSION_TYPE_IDENTIFIER,
+ [$sourceContentId, $limit, $offset, $sourceContentVersionNo, $type],
+ true
+ ),
+ function () use ($sourceContentId, $limit, $offset, $sourceContentVersionNo, $type): array {
+ return $this->persistenceHandler->contentHandler()->loadRelationList(
+ $sourceContentId,
+ $limit,
+ $offset,
+ $sourceContentVersionNo,
+ $type
+ );
+ },
+ function (Relation $relation): array {
+ return [
+ $this->cacheIdentifierGenerator->generateTag(
+ self::CONTENT_RELATION_IDENTIFIER,
+ [$relation->destinationContentId]
+ ),
+ $this->cacheIdentifierGenerator->generateTag(
+ self::CONTENT_IDENTIFIER,
+ [$relation->destinationContentId]
+ ),
+ ];
+ },
+ function (Relation $relation): array {
+ return [
+ $this->cacheIdentifierGenerator->generateKey(self::CONTENT_IDENTIFIER, [$relation->destinationContentId], true),
+ ];
+ },
+ function () use ($sourceContentId): array {
+ return [
+ $this->cacheIdentifierGenerator->generateTag(
+ self::CONTENT_RELATIONS_LIST_IDENTIFIER,
+ [$sourceContentId]
+ ),
+ $this->cacheIdentifierGenerator->generateTag(
+ self::CONTENT_IDENTIFIER,
+ [$sourceContentId]
+ ),
+ ];
+ },
+ [$sourceContentId, $limit, $offset, $sourceContentVersionNo, $type]
+ );
+ }
+
/**
* {@inheritdoc}
*/
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/Persistence/Legacy/Content/FieldHandler.php vendor-4.6.7/ibexa/core/src/lib/Persistence/Legacy/Content/FieldHandler.php
--- vendor-4.6.2/ibexa/core/src/lib/Persistence/Legacy/Content/FieldHandler.php 2024-07-02 10:19:17.522305350 +0200
+++ vendor-4.6.7/ibexa/core/src/lib/Persistence/Legacy/Content/FieldHandler.php 2024-07-02 10:23:18.056890197 +0200
@@ -148,9 +148,13 @@
*
* @param \Ibexa\Contracts\Core\Persistence\Content $content
*/
- public function createExistingFieldsInNewVersion(Content $content)
+ public function createExistingFieldsInNewVersion(Content $content): void
{
foreach ($content->fields as $field) {
+ if ($field->id === null) {
+ // Virtual field with default value, skip creating field as it has no id
+ continue;
+ }
$this->createExistingFieldInNewVersion($field, $content);
}
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/Persistence/Legacy/Content/Gateway/DoctrineDatabase.php vendor-4.6.7/ibexa/core/src/lib/Persistence/Legacy/Content/Gateway/DoctrineDatabase.php
--- vendor-4.6.2/ibexa/core/src/lib/Persistence/Legacy/Content/Gateway/DoctrineDatabase.php 2024-07-02 10:19:17.522305350 +0200
+++ vendor-4.6.7/ibexa/core/src/lib/Persistence/Legacy/Content/Gateway/DoctrineDatabase.php 2024-07-02 10:23:18.057890200 +0200
@@ -1387,18 +1387,61 @@
?int $relationType = null
): array {
$query = $this->queryBuilder->createRelationFindQueryBuilder();
+ $query = $this->prepareRelationQuery($query, $contentId, $contentVersionNo, $relationType);
+
+ return $query->execute()->fetchAllAssociative();
+ }
+
+ public function countRelations(
+ int $contentId,
+ ?int $contentVersionNo = null,
+ ?int $relationType = null
+ ): int {
+ $query = $this->connection->createQueryBuilder();
+ $query->select($this->databasePlatform->getCountExpression('l.id'))
+ ->from(self::CONTENT_RELATION_TABLE, 'l');
+
+ $query = $this->prepareRelationQuery($query, $contentId, $contentVersionNo, $relationType);
+
+ return (int)$query->execute()->fetchOne();
+ }
+
+ public function listRelations(
+ int $contentId,
+ int $limit,
+ int $offset = 0,
+ ?int $contentVersionNo = null,
+ ?int $relationType = null
+ ): array {
+ $query = $this->queryBuilder->createRelationFindQueryBuilder();
+ $query = $this->prepareRelationQuery($query, $contentId, $contentVersionNo, $relationType);
+
+ $query->setFirstResult($offset)
+ ->setMaxResults($limit);
+
+ $query->orderBy('l.id', 'DESC');
+
+ return $query->execute()->fetchAllAssociative();
+ }
+
+ private function prepareRelationQuery(
+ DoctrineQueryBuilder $query,
+ int $contentId,
+ ?int $contentVersionNo = null,
+ ?int $relationType = null
+ ): DoctrineQueryBuilder {
$expr = $query->expr();
$query
->innerJoin(
'l',
- 'ezcontentobject',
- 'ezcontentobject_to',
- $expr->andX(
- 'l.to_contentobject_id = ezcontentobject_to.id',
- 'ezcontentobject_to.status = :status'
+ self::CONTENT_ITEM_TABLE,
+ 'c_to',
+ $expr->and(
+ 'l.to_contentobject_id = c_to.id',
+ 'c_to.status = :status'
)
)
- ->where(
+ ->andWhere(
'l.from_contentobject_id = :content_id'
)
->setParameter(
@@ -1409,7 +1452,7 @@
->setParameter('content_id', $contentId, ParameterType::INTEGER);
// source version number
- if (null !== $contentVersionNo) {
+ if ($contentVersionNo !== null) {
$query
->andWhere('l.from_contentobject_version = :version_no')
->setParameter('version_no', $contentVersionNo, ParameterType::INTEGER);
@@ -1417,10 +1460,10 @@
// from published version only
$query
->innerJoin(
- 'ezcontentobject_to',
- 'ezcontentobject',
+ 'c_to',
+ self::CONTENT_ITEM_TABLE,
'c',
- $expr->andX(
+ $expr->and(
'c.id = l.from_contentobject_id',
'c.current_version = l.from_contentobject_version'
)
@@ -1442,7 +1485,7 @@
->setParameter('relation_type', $relationType, ParameterType::INTEGER);
}
- return $query->execute()->fetchAll(FetchMode::ASSOCIATIVE);
+ return $query;
}
public function countReverseRelations(int $toContentId, ?int $relationType = null): int
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/Persistence/Legacy/Content/Gateway/ExceptionConversion.php vendor-4.6.7/ibexa/core/src/lib/Persistence/Legacy/Content/Gateway/ExceptionConversion.php
--- vendor-4.6.2/ibexa/core/src/lib/Persistence/Legacy/Content/Gateway/ExceptionConversion.php 2024-07-02 10:19:17.522305350 +0200
+++ vendor-4.6.7/ibexa/core/src/lib/Persistence/Legacy/Content/Gateway/ExceptionConversion.php 2024-07-02 10:23:18.057890200 +0200
@@ -392,6 +392,38 @@
}
}
+ public function countRelations(
+ int $contentId,
+ ?int $contentVersionNo = null,
+ ?int $relationType = null
+ ): int {
+ try {
+ return $this->innerGateway->countRelations($contentId, $contentVersionNo, $relationType);
+ } catch (DBALException | PDOException $e) {
+ throw DatabaseException::wrap($e);
+ }
+ }
+
+ public function listRelations(
+ int $contentId,
+ int $limit,
+ int $offset = 0,
+ ?int $contentVersionNo = null,
+ ?int $relationType = null
+ ): array {
+ try {
+ return $this->innerGateway->listRelations(
+ $contentId,
+ $limit,
+ $offset,
+ $contentVersionNo,
+ $relationType
+ );
+ } catch (DBALException | PDOException $e) {
+ throw DatabaseException::wrap($e);
+ }
+ }
+
public function countReverseRelations(int $contentId, ?int $relationType = null): int
{
try {
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/Persistence/Legacy/Content/Gateway.php vendor-4.6.7/ibexa/core/src/lib/Persistence/Legacy/Content/Gateway.php
--- vendor-4.6.2/ibexa/core/src/lib/Persistence/Legacy/Content/Gateway.php 2024-07-02 10:19:17.522305350 +0200
+++ vendor-4.6.7/ibexa/core/src/lib/Persistence/Legacy/Content/Gateway.php 2024-07-02 10:23:18.057890200 +0200
@@ -361,7 +361,29 @@
): array;
/**
- * Count number of related to/from $contentId.
+ * Counts number of related to/from $contentId.
+ */
+ abstract public function countRelations(
+ int $contentId,
+ ?int $contentVersionNo = null,
+ ?int $relationType = null
+ ): int;
+
+ /**
+ * Loads paginated data of related to/from $contentId.
+ *
+ * @return array<array<string, mixed>>
+ */
+ abstract public function listRelations(
+ int $contentId,
+ int $limit,
+ int $offset = 0,
+ ?int $contentVersionNo = null,
+ ?int $relationType = null
+ ): array;
+
+ /**
+ * Counts number of related to/from $contentId.
*/
abstract public function countReverseRelations(int $contentId, ?int $relationType = null): int;
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/Persistence/Legacy/Content/Handler.php vendor-4.6.7/ibexa/core/src/lib/Persistence/Legacy/Content/Handler.php
--- vendor-4.6.2/ibexa/core/src/lib/Persistence/Legacy/Content/Handler.php 2024-07-02 10:19:17.522305350 +0200
+++ vendor-4.6.7/ibexa/core/src/lib/Persistence/Legacy/Content/Handler.php 2024-07-02 10:23:18.057890200 +0200
@@ -822,6 +822,23 @@
);
}
+ public function countRelations(int $sourceContentId, ?int $sourceContentVersionNo = null, ?int $type = null): int
+ {
+ return $this->contentGateway->countRelations($sourceContentId, $sourceContentVersionNo, $type);
+ }
+
+ public function loadRelationList(
+ int $sourceContentId,
+ int $limit,
+ int $offset = 0,
+ ?int $sourceContentVersionNo = null,
+ ?int $type = null
+ ): array {
+ return $this->mapper->extractRelationsFromRows(
+ $this->contentGateway->listRelations($sourceContentId, $limit, $offset, $sourceContentVersionNo, $type)
+ );
+ }
+
/**
* {@inheritdoc}
*/
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/Persistence/Legacy/Content/Mapper/ResolveVirtualFieldSubscriber.php vendor-4.6.7/ibexa/core/src/lib/Persistence/Legacy/Content/Mapper/ResolveVirtualFieldSubscriber.php
--- vendor-4.6.2/ibexa/core/src/lib/Persistence/Legacy/Content/Mapper/ResolveVirtualFieldSubscriber.php 1970-01-01 01:00:00.000000000 +0100
+++ vendor-4.6.7/ibexa/core/src/lib/Persistence/Legacy/Content/Mapper/ResolveVirtualFieldSubscriber.php 2024-07-02 10:23:18.057890200 +0200
@@ -0,0 +1,222 @@
+<?php
+
+/**
+ * @copyright Copyright (C) Ibexa AS. All rights reserved.
+ * @license For full copyright and license information view LICENSE file distributed with this source code.
+ */
+declare(strict_types=1);
+
+namespace Ibexa\Core\Persistence\Legacy\Content\Mapper;
+
+use Ibexa\Contracts\Core\Event\Mapper\ResolveMissingFieldEvent;
+use Ibexa\Contracts\Core\FieldType\DefaultDataFieldStorage;
+use Ibexa\Contracts\Core\Persistence\Content\Field;
+use Ibexa\Contracts\Core\Persistence\Content\FieldValue;
+use Ibexa\Contracts\Core\Persistence\Content\Type\FieldDefinition;
+use Ibexa\Contracts\Core\Persistence\Content\VersionInfo;
+use Ibexa\Core\FieldType\NullStorage;
+use Ibexa\Core\Persistence\Legacy\Content\FieldValue\Converter\Exception\NotFound;
+use Ibexa\Core\Persistence\Legacy\Content\FieldValue\ConverterRegistry;
+use Ibexa\Core\Persistence\Legacy\Content\Gateway as ContentGateway;
+use Ibexa\Core\Persistence\Legacy\Content\StorageFieldValue;
+use Ibexa\Core\Persistence\Legacy\Content\StorageRegistry;
+use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+
+final class ResolveVirtualFieldSubscriber implements EventSubscriberInterface
+{
+ private ConverterRegistry $converterRegistry;
+
+ private StorageRegistry $storageRegistry;
+
+ private ContentGateway $contentGateway;
+
+ public function __construct(
+ ConverterRegistry $converterRegistry,
+ StorageRegistry $storageRegistry,
+ ContentGateway $contentGateway
+ ) {
+ $this->converterRegistry = $converterRegistry;
+ $this->storageRegistry = $storageRegistry;
+ $this->contentGateway = $contentGateway;
+ }
+
+ public static function getSubscribedEvents(): array
+ {
+ return [
+ ResolveMissingFieldEvent::class => [
+ ['persistExternalStorageField', -100],
+ ['resolveVirtualExternalStorageField', -80],
+ ['resolveVirtualField', 0],
+ ],
+ ];
+ }
+
+ public function resolveVirtualField(ResolveMissingFieldEvent $event): void
+ {
+ if ($event->getField()) {
+ return;
+ }
+
+ $content = $event->getContent();
+
+ try {
+ $emptyField = $this->createEmptyField(
+ $content->versionInfo,
+ $event->getFieldDefinition(),
+ $event->getLanguageCode()
+ );
+
+ $event->setField($emptyField);
+ } catch (NotFound $exception) {
+ return;
+ }
+ }
+
+ /**
+ * @throws \Ibexa\Core\Persistence\Legacy\Content\FieldValue\Converter\Exception\NotFound
+ */
+ public function persistExternalStorageField(ResolveMissingFieldEvent $event): void
+ {
+ $field = $event->getField();
+
+ if ($field === null) {
+ // Nothing to persist
+ return;
+ }
+
+ if ($field->id !== null) {
+ // Not a virtual field
+ return;
+ }
+
+ $fieldDefinition = $event->getFieldDefinition();
+ $storage = $this->storageRegistry->getStorage($fieldDefinition->fieldType);
+
+ if ($storage instanceof NullStorage) {
+ // Not an external storage
+ return;
+ }
+
+ $content = $event->getContent();
+
+ $field->id = $this->contentGateway->insertNewField(
+ $content,
+ $field,
+ $this->getDefaultStorageValue()
+ );
+
+ if ($field->value->data !== null) {
+ $result = $storage->storeFieldData(
+ $content->versionInfo,
+ $field,
+ []
+ );
+
+ if ($result === true) {
+ $storageValue = new StorageFieldValue();
+ $converter = $this->converterRegistry->getConverter($fieldDefinition->fieldType);
+ $converter->toStorageValue(
+ $field->value,
+ $storageValue
+ );
+
+ $this->contentGateway->updateField(
+ $field,
+ $storageValue
+ );
+ }
+ }
+
+ $storage->getFieldData(
+ $content->versionInfo,
+ $field,
+ []
+ );
+
+ $event->setField($field);
+ }
+
+ public function resolveVirtualExternalStorageField(ResolveMissingFieldEvent $event): void
+ {
+ $field = $event->getField();
+
+ if ($field === null) {
+ // Nothing to resolve
+ return;
+ }
+
+ if ($field->id !== null) {
+ // Not a virtual field
+ return;
+ }
+
+ $fieldDefinition = $event->getFieldDefinition();
+ $storage = $this->storageRegistry->getStorage($fieldDefinition->fieldType);
+
+ if ($storage instanceof NullStorage) {
+ // Not an external storage
+ return;
+ }
+
+ if (!$storage instanceof DefaultDataFieldStorage) {
+ return;
+ }
+
+ $content = $event->getContent();
+
+ $storage->getDefaultFieldData(
+ $content->versionInfo,
+ $field
+ );
+
+ $event->setField($field);
+
+ // Do not persist the external storage field
+ $event->stopPropagation();
+ }
+
+ /**
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
+ */
+ private function createEmptyField(
+ VersionInfo $versionInfo,
+ FieldDefinition $fieldDefinition,
+ string $languageCode
+ ): Field {
+ $field = new Field();
+ $field->fieldDefinitionId = $fieldDefinition->id;
+ $field->type = $fieldDefinition->fieldType;
+ $field->value = $this->getDefaultValue($fieldDefinition);
+ $field->languageCode = $languageCode;
+ $field->versionNo = $versionInfo->versionNo;
+
+ return $field;
+ }
+
+ /**
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
+ */
+ private function getDefaultValue(FieldDefinition $fieldDefinition): FieldValue
+ {
+ $value = clone $fieldDefinition->defaultValue;
+ $storageValue = $this->getDefaultStorageValue();
+
+ $converter = $this->converterRegistry->getConverter($fieldDefinition->fieldType);
+ $converter->toStorageValue($value, $storageValue);
+ $converter->toFieldValue($storageValue, $value);
+
+ return $value;
+ }
+
+ private function getDefaultStorageValue(): StorageFieldValue
+ {
+ $storageValue = new StorageFieldValue();
+ $storageValue->dataFloat = 0;
+ $storageValue->dataInt = 0;
+ $storageValue->dataText = '';
+ $storageValue->sortKeyInt = 0;
+ $storageValue->sortKeyString = '';
+
+ return $storageValue;
+ }
+}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/Persistence/Legacy/Content/Mapper.php vendor-4.6.7/ibexa/core/src/lib/Persistence/Legacy/Content/Mapper.php
--- vendor-4.6.2/ibexa/core/src/lib/Persistence/Legacy/Content/Mapper.php 2024-07-02 10:19:17.523305353 +0200
+++ vendor-4.6.7/ibexa/core/src/lib/Persistence/Legacy/Content/Mapper.php 2024-07-02 10:23:18.057890200 +0200
@@ -6,6 +6,7 @@
*/
namespace Ibexa\Core\Persistence\Legacy\Content;
+use Ibexa\Contracts\Core\Event\Mapper\ResolveMissingFieldEvent;
use Ibexa\Contracts\Core\Persistence\Content;
use Ibexa\Contracts\Core\Persistence\Content\ContentInfo;
use Ibexa\Contracts\Core\Persistence\Content\CreateStruct;
@@ -14,41 +15,66 @@
use Ibexa\Contracts\Core\Persistence\Content\Language\Handler as LanguageHandler;
use Ibexa\Contracts\Core\Persistence\Content\Relation;
use Ibexa\Contracts\Core\Persistence\Content\Relation\CreateStruct as RelationCreateStruct;
+use Ibexa\Contracts\Core\Persistence\Content\Type\Handler as ContentTypeHandler;
use Ibexa\Contracts\Core\Persistence\Content\VersionInfo;
use Ibexa\Core\Base\Exceptions\NotFoundException;
use Ibexa\Core\Persistence\Legacy\Content\FieldValue\ConverterRegistry as Registry;
+use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
/**
* Mapper for Content Handler.
*
* Performs mapping of Content objects.
+ *
+ * @phpstan-type TVersionedLanguageFieldDefinitionsMap array<
+ * int, array<
+ * int, array<
+ * string, array<
+ * int, \Ibexa\Contracts\Core\Persistence\Content\Type\FieldDefinition,
+ * >
+ * >
+ * >
+ * >
+ * @phpstan-type TVersionedFieldMap array<
+ * int, array<
+ * int, array<
+ * int, \Ibexa\Contracts\Core\Persistence\Content\Field,
+ * >
+ * >
+ * >
+ * @phpstan-type TVersionedNameMap array<
+ * int, array<
+ * int, array<string, string>
+ * >
+ * >
+ * @phpstan-type TContentInfoMap array<int, \Ibexa\Contracts\Core\Persistence\Content\ContentInfo>
+ * @phpstan-type TVersionInfoMap array<
+ * int, array<
+ * int, \Ibexa\Contracts\Core\Persistence\Content\VersionInfo,
+ * >
+ * >
+ * @phpstan-type TRawContentRow array<string, scalar>
*/
class Mapper
{
- /**
- * FieldValue converter registry.
- *
- * @var \Ibexa\Core\Persistence\Legacy\Content\FieldValue\ConverterRegistry
- */
- protected $converterRegistry;
+ protected Registry $converterRegistry;
- /**
- * Caching language handler.
- *
- * @var \Ibexa\Contracts\Core\Persistence\Content\Language\Handler
- */
- protected $languageHandler;
+ protected LanguageHandler $languageHandler;
- /**
- * Creates a new mapper.
- *
- * @param \Ibexa\Core\Persistence\Legacy\Content\FieldValue\ConverterRegistry $converterRegistry
- * @param \Ibexa\Contracts\Core\Persistence\Content\Language\Handler $languageHandler
- */
- public function __construct(Registry $converterRegistry, LanguageHandler $languageHandler)
- {
+ private ContentTypeHandler $contentTypeHandler;
+
+ private EventDispatcherInterface $eventDispatcher;
+
+ public function __construct(
+ Registry $converterRegistry,
+ LanguageHandler $languageHandler,
+ ContentTypeHandler $contentTypeHandler,
+ EventDispatcherInterface $eventDispatcher
+ ) {
$this->converterRegistry = $converterRegistry;
$this->languageHandler = $languageHandler;
+ $this->contentTypeHandler = $contentTypeHandler;
+ $this->eventDispatcher = $eventDispatcher;
}
/**
@@ -174,59 +200,120 @@
*
* "$tableName_$columnName"
*
- * @param array $rows
- * @param array $nameRows
+ * @param array<array<string, scalar>> $rows
+ * @param array<array<string, scalar>> $nameRows
+ * @param string $prefix
*
* @return \Ibexa\Contracts\Core\Persistence\Content[]
*/
- public function extractContentFromRows(array $rows, array $nameRows, $prefix = 'ezcontentobject_')
- {
+ public function extractContentFromRows(
+ array $rows,
+ array $nameRows,
+ string $prefix = 'ezcontentobject_'
+ ): array {
$versionedNameData = [];
+
foreach ($nameRows as $row) {
- $contentId = (int)$row['ezcontentobject_name_contentobject_id'];
- $versionNo = (int)$row['ezcontentobject_name_content_version'];
- $versionedNameData[$contentId][$versionNo][$row['ezcontentobject_name_content_translation']] = $row['ezcontentobject_name_name'];
+ $contentId = (int)$row["{$prefix}name_contentobject_id"];
+ $versionNo = (int)$row["{$prefix}name_content_version"];
+ $languageCode = (string)$row["{$prefix}name_content_translation"];
+ $versionedNameData[$contentId][$versionNo][$languageCode] = (string)$row["{$prefix}name_name"];
}
$contentInfos = [];
$versionInfos = [];
$fields = [];
+ $fieldDefinitions = $this->loadCachedVersionFieldDefinitionsPerLanguage(
+ $rows,
+ $prefix
+ );
+
foreach ($rows as $row) {
$contentId = (int)$row["{$prefix}id"];
+ $versionId = (int)$row["{$prefix}version_id"];
+
if (!isset($contentInfos[$contentId])) {
$contentInfos[$contentId] = $this->extractContentInfoFromRow($row, $prefix);
}
+
if (!isset($versionInfos[$contentId])) {
$versionInfos[$contentId] = [];
}
- $versionId = (int)$row['ezcontentobject_version_id'];
if (!isset($versionInfos[$contentId][$versionId])) {
$versionInfos[$contentId][$versionId] = $this->extractVersionInfoFromRow($row);
}
- $fieldId = (int)$row['ezcontentobject_attribute_id'];
- if (!isset($fields[$contentId][$versionId][$fieldId])) {
+ $fieldId = (int)$row["{$prefix}attribute_id"];
+ $fieldDefinitionId = (int)$row["{$prefix}attribute_contentclassattribute_id"];
+ $languageCode = $row["{$prefix}attribute_language_code"];
+
+ if (!isset($fields[$contentId][$versionId][$fieldId])
+ && isset($fieldDefinitions[$contentId][$versionId][$languageCode][$fieldDefinitionId])
+ ) {
$fields[$contentId][$versionId][$fieldId] = $this->extractFieldFromRow($row);
+ unset($fieldDefinitions[$contentId][$versionId][$languageCode][$fieldDefinitionId]);
}
}
+ return $this->buildContentObjects(
+ $contentInfos,
+ $versionInfos,
+ $fields,
+ $fieldDefinitions,
+ $versionedNameData
+ );
+ }
+
+ /**
+ * @phpstan-param TContentInfoMap $contentInfos
+ * @phpstan-param TVersionInfoMap $versionInfos
+ * @phpstan-param TVersionedFieldMap $fields
+ * @phpstan-param TVersionedLanguageFieldDefinitionsMap $missingFieldDefinitions
+ * @phpstan-param TVersionedNameMap $versionedNames
+ *
+ * @return \Ibexa\Contracts\Core\Persistence\Content[]
+ */
+ private function buildContentObjects(
+ array $contentInfos,
+ array $versionInfos,
+ array $fields,
+ array $missingFieldDefinitions,
+ array $versionedNames
+ ): array {
$results = [];
+
foreach ($contentInfos as $contentId => $contentInfo) {
foreach ($versionInfos[$contentId] as $versionId => $versionInfo) {
// Fallback to just main language name if versioned name data is missing
- if (isset($versionedNameData[$contentId][$versionInfo->versionNo])) {
- $names = $versionedNameData[$contentId][$versionInfo->versionNo];
- } else {
- $names = [$contentInfo->mainLanguageCode => $contentInfo->name];
- }
+ $names = $versionedNames[$contentId][$versionInfo->versionNo]
+ ?? [$contentInfo->mainLanguageCode => $contentInfo->name];
$content = new Content();
$content->versionInfo = $versionInfo;
$content->versionInfo->names = $names;
$content->versionInfo->contentInfo = $contentInfo;
$content->fields = array_values($fields[$contentId][$versionId]);
+
+ $missingVersionFieldDefinitions = $missingFieldDefinitions[$contentId][$versionId];
+ foreach ($missingVersionFieldDefinitions as $languageCode => $versionFieldDefinitions) {
+ foreach ($versionFieldDefinitions as $fieldDefinition) {
+ $event = $this->eventDispatcher->dispatch(
+ new ResolveMissingFieldEvent(
+ $content,
+ $fieldDefinition,
+ $languageCode
+ )
+ );
+
+ $field = $event->getField();
+ if ($field !== null) {
+ $content->fields[] = $field;
+ }
+ }
+ }
+
$results[] = $content;
}
}
@@ -235,9 +322,49 @@
}
/**
+ * @phpstan-param TRawContentRow[] $rows
+ *
+ * @phpstan-return TVersionedLanguageFieldDefinitionsMap
+ *
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
+ */
+ private function loadCachedVersionFieldDefinitionsPerLanguage(
+ array $rows,
+ string $prefix
+ ): array {
+ $fieldDefinitions = [];
+ $contentTypes = [];
+ $allLanguages = $this->loadAllLanguagesWithIdKey();
+
+ foreach ($rows as $row) {
+ $contentId = (int)$row["{$prefix}id"];
+ $versionId = (int)$row["{$prefix}version_id"];
+ $contentTypeId = (int)$row["{$prefix}contentclass_id"];
+ $languageMask = (int)$row["{$prefix}version_language_mask"];
+
+ if (isset($fieldDefinitions[$contentId][$versionId])) {
+ continue;
+ }
+
+ $languageCodes = $this->extractLanguageCodesFromMask($languageMask, $allLanguages);
+ $contentTypes[$contentTypeId] = $contentTypes[$contentTypeId] ?? $this->contentTypeHandler->load($contentTypeId);
+ $contentType = $contentTypes[$contentTypeId];
+ foreach ($contentType->fieldDefinitions as $fieldDefinition) {
+ foreach ($languageCodes as $languageCode) {
+ $id = (int)$fieldDefinition->id;
+ $fieldDefinitions[$contentId][$versionId][$languageCode][$id] = $fieldDefinition;
+ }
+ }
+ }
+
+ return $fieldDefinitions;
+ }
+
+ /**
* Extracts a ContentInfo object from $row.
*
- * @param array $row
+ * @phpstan-param TRawContentRow $row
+ *
* @param string $prefix Prefix for row keys, which are initially mapped by ezcontentobject fields
* @param string $treePrefix Prefix for tree row key, which are initially mapped by ezcontentobject_tree_ fields
*
@@ -247,17 +374,16 @@
{
$contentInfo = new ContentInfo();
$contentInfo->id = (int)$row["{$prefix}id"];
- $contentInfo->name = $row["{$prefix}name"];
+ $contentInfo->name = (string)$row["{$prefix}name"];
$contentInfo->contentTypeId = (int)$row["{$prefix}contentclass_id"];
$contentInfo->sectionId = (int)$row["{$prefix}section_id"];
$contentInfo->currentVersionNo = (int)$row["{$prefix}current_version"];
- $contentInfo->isPublished = ($row["{$prefix}status"] == ContentInfo::STATUS_PUBLISHED);
$contentInfo->ownerId = (int)$row["{$prefix}owner_id"];
$contentInfo->publicationDate = (int)$row["{$prefix}published"];
$contentInfo->modificationDate = (int)$row["{$prefix}modified"];
- $contentInfo->alwaysAvailable = 1 === ($row["{$prefix}language_mask"] & 1);
+ $contentInfo->alwaysAvailable = 1 === ((int)$row["{$prefix}language_mask"] & 1);
$contentInfo->mainLanguageCode = $this->languageHandler->load($row["{$prefix}initial_language_id"])->languageCode;
- $contentInfo->remoteId = $row["{$prefix}remote_id"];
+ $contentInfo->remoteId = (string)$row["{$prefix}remote_id"];
$contentInfo->mainLocationId = ($row["{$treePrefix}main_node_id"] !== null ? (int)$row["{$treePrefix}main_node_id"] : null);
$contentInfo->status = (int)$row["{$prefix}status"];
$contentInfo->isPublished = ($contentInfo->status == ContentInfo::STATUS_PUBLISHED);
@@ -335,8 +461,8 @@
/**
* Extracts a VersionInfo object from $row.
*
- * @param array $rows
- * @param array $nameRows
+ * @phpstan-param TRawContentRow[] $rows
+ * @phpstan-param TRawContentRow[] $nameRows
*
* @return \Ibexa\Contracts\Core\Persistence\Content\VersionInfo[]
*/
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/Persistence/Legacy/Content/StorageHandler.php vendor-4.6.7/ibexa/core/src/lib/Persistence/Legacy/Content/StorageHandler.php
--- vendor-4.6.2/ibexa/core/src/lib/Persistence/Legacy/Content/StorageHandler.php 2024-07-02 10:19:17.523305353 +0200
+++ vendor-4.6.7/ibexa/core/src/lib/Persistence/Legacy/Content/StorageHandler.php 2024-07-02 10:23:18.057890200 +0200
@@ -79,7 +79,7 @@
public function getFieldData(VersionInfo $versionInfo, Field $field)
{
$storage = $this->storageRegistry->getStorage($field->type);
- if ($storage->hasFieldData()) {
+ if ($field->id !== null && $storage->hasFieldData()) {
$storage->getFieldData($versionInfo, $field, $this->context);
}
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/Persistence/Legacy/Content/Type/Handler.php vendor-4.6.7/ibexa/core/src/lib/Persistence/Legacy/Content/Type/Handler.php
--- vendor-4.6.2/ibexa/core/src/lib/Persistence/Legacy/Content/Type/Handler.php 2024-07-02 10:19:17.523305353 +0200
+++ vendor-4.6.7/ibexa/core/src/lib/Persistence/Legacy/Content/Type/Handler.php 2024-07-02 10:23:18.057890200 +0200
@@ -632,7 +632,6 @@
try {
$fromType = $this->load($contentTypeId, Type::STATUS_DEFINED);
- $this->updateHandler->updateContentObjects($fromType, $toType);
$this->updateHandler->deleteOldType($fromType);
} catch (Exception\TypeNotFound $e) {
// If no old type is found, no updates are necessary to it
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/Persistence/Legacy/Content/Type/Update/Handler/DoctrineDatabase.php vendor-4.6.7/ibexa/core/src/lib/Persistence/Legacy/Content/Type/Update/Handler/DoctrineDatabase.php
--- vendor-4.6.2/ibexa/core/src/lib/Persistence/Legacy/Content/Type/Update/Handler/DoctrineDatabase.php 2024-07-02 10:19:17.523305353 +0200
+++ vendor-4.6.7/ibexa/core/src/lib/Persistence/Legacy/Content/Type/Update/Handler/DoctrineDatabase.php 2024-07-02 10:23:18.057890200 +0200
@@ -9,7 +9,6 @@
namespace Ibexa\Core\Persistence\Legacy\Content\Type\Update\Handler;
use Ibexa\Contracts\Core\Persistence\Content\Type;
-use Ibexa\Core\Persistence\Legacy\Content\Type\ContentUpdater;
use Ibexa\Core\Persistence\Legacy\Content\Type\Gateway;
use Ibexa\Core\Persistence\Legacy\Content\Type\Update\Handler;
@@ -23,21 +22,14 @@
/** @var \Ibexa\Core\Persistence\Legacy\Content\Type\Gateway */
protected $contentTypeGateway;
- /** @var \Ibexa\Core\Persistence\Legacy\Content\Type\ContentUpdater */
- protected $contentUpdater;
-
- public function __construct(Gateway $contentTypeGateway, ContentUpdater $contentUpdater)
+ public function __construct(Gateway $contentTypeGateway)
{
$this->contentTypeGateway = $contentTypeGateway;
- $this->contentUpdater = $contentUpdater;
}
public function updateContentObjects(Type $fromType, Type $toType): void
{
- $this->contentUpdater->applyUpdates(
- $fromType->id,
- $this->contentUpdater->determineActions($fromType, $toType)
- );
+ // Do nothing, content objects are no longer updated
}
public function deleteOldType(Type $fromType): void
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/Persistence/Legacy/Filter/CriterionQueryBuilder/Content/IsContainerQueryBuilder.php vendor-4.6.7/ibexa/core/src/lib/Persistence/Legacy/Filter/CriterionQueryBuilder/Content/IsContainerQueryBuilder.php
--- vendor-4.6.2/ibexa/core/src/lib/Persistence/Legacy/Filter/CriterionQueryBuilder/Content/IsContainerQueryBuilder.php 1970-01-01 01:00:00.000000000 +0100
+++ vendor-4.6.7/ibexa/core/src/lib/Persistence/Legacy/Filter/CriterionQueryBuilder/Content/IsContainerQueryBuilder.php 2024-07-02 10:23:18.057890200 +0200
@@ -0,0 +1,52 @@
+<?php
+
+/**
+ * @copyright Copyright (C) Ibexa AS. All rights reserved.
+ * @license For full copyright and license information view LICENSE file distributed with this source code.
+ */
+declare(strict_types=1);
+
+namespace Ibexa\Core\Persistence\Legacy\Filter\CriterionQueryBuilder\Content;
+
+use Doctrine\DBAL\ParameterType;
+use Ibexa\Contracts\Core\Persistence\Filter\Doctrine\FilteringQueryBuilder;
+use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\IsContainer;
+use Ibexa\Contracts\Core\Repository\Values\Filter\CriterionQueryBuilder;
+use Ibexa\Contracts\Core\Repository\Values\Filter\FilteringCriterion;
+use Ibexa\Core\Persistence\Legacy\Content\Type\Gateway;
+
+/**
+ * @internal for internal use by Repository Filtering
+ */
+final class IsContainerQueryBuilder implements CriterionQueryBuilder
+{
+ public function accepts(FilteringCriterion $criterion): bool
+ {
+ return $criterion instanceof IsContainer;
+ }
+
+ /**
+ * @param \Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\IsContainer $criterion
+ */
+ public function buildQueryConstraint(
+ FilteringQueryBuilder $queryBuilder,
+ FilteringCriterion $criterion
+ ): ?string {
+ $queryBuilder
+ ->joinOnce(
+ 'content',
+ Gateway::CONTENT_TYPE_TABLE,
+ 'content_type',
+ 'content.contentclass_id = content_type.id',
+ );
+
+ /** @var array{bool} $criterionValue */
+ $criterionValue = $criterion->value;
+ $isContainer = reset($criterionValue);
+
+ return $queryBuilder->expr()->in(
+ 'content_type.is_container',
+ $queryBuilder->createNamedParameter((int)$isContainer, ParameterType::INTEGER)
+ );
+ }
+}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/Persistence/Legacy/SharedGateway/DatabasePlatform/SqliteGateway.php vendor-4.6.7/ibexa/core/src/lib/Persistence/Legacy/SharedGateway/DatabasePlatform/SqliteGateway.php
--- vendor-4.6.2/ibexa/core/src/lib/Persistence/Legacy/SharedGateway/DatabasePlatform/SqliteGateway.php 2024-07-02 10:19:17.523305353 +0200
+++ vendor-4.6.7/ibexa/core/src/lib/Persistence/Legacy/SharedGateway/DatabasePlatform/SqliteGateway.php 2024-07-02 10:23:18.058890202 +0200
@@ -8,8 +8,6 @@
namespace Ibexa\Core\Persistence\Legacy\SharedGateway\DatabasePlatform;
-use Doctrine\DBAL\Connection;
-use Doctrine\DBAL\FetchMode;
use Ibexa\Core\Base\Exceptions\DatabaseException;
use Ibexa\Core\Persistence\Legacy\SharedGateway\Gateway;
@@ -20,39 +18,19 @@
*/
private const FATAL_ERROR_CODE = 7;
- /** @var \Doctrine\DBAL\Connection */
- private $connection;
-
- /** @var \Doctrine\DBAL\Platforms\AbstractPlatform */
- private $databasePlatform;
-
- /** @var int[] */
+ /** @var array<string, int> */
private $lastInsertedIds = [];
- /**
- * @throws \Doctrine\DBAL\DBALException
- */
- public function __construct(Connection $connection)
- {
- $this->connection = $connection;
- $this->databasePlatform = $connection->getDatabasePlatform();
- }
-
public function getColumnNextIntegerValue(
string $tableName,
string $columnName,
string $sequenceName
): ?int {
- $query = $this->connection->createQueryBuilder();
- $query
- ->select($this->databasePlatform->getMaxExpression($columnName))
- ->from($tableName);
-
- $lastId = (int)$query->execute()->fetch(FetchMode::COLUMN);
-
- $this->lastInsertedIds[$sequenceName] = $lastId + 1;
+ $lastId = $this->lastInsertedIds[$sequenceName] ?? 0;
+ $nextId = (int)hrtime(true);
- return $this->lastInsertedIds[$sequenceName];
+ // $lastId === $nextId shouldn't happen using high-resolution time, but better safe than sorry
+ return $this->lastInsertedIds[$sequenceName] = $lastId === $nextId ? $nextId + 1 : $nextId;
}
/**
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/Persistence/Legacy/User/Role/Gateway/DoctrineDatabase.php vendor-4.6.7/ibexa/core/src/lib/Persistence/Legacy/User/Role/Gateway/DoctrineDatabase.php
--- vendor-4.6.2/ibexa/core/src/lib/Persistence/Legacy/User/Role/Gateway/DoctrineDatabase.php 2024-07-02 10:19:17.523305353 +0200
+++ vendor-4.6.7/ibexa/core/src/lib/Persistence/Legacy/User/Role/Gateway/DoctrineDatabase.php 2024-07-02 10:23:18.058890202 +0200
@@ -157,7 +157,8 @@
$this->buildRoleDraftQueryConstraint($status, $query)
)
->orderBy('p.id', 'ASC')
- ->addOrderBy('l.identifier', 'ASC');
+ ->addOrderBy('l.identifier', 'ASC')
+ ->addOrderBy('v.value', 'ASC');
return $query->execute()->fetchAllAssociative();
}
@@ -182,7 +183,8 @@
$this->buildRoleDraftQueryConstraint($status, $query)
)
->orderBy('p.id', 'ASC')
- ->addOrderBy('l.identifier', 'ASC');
+ ->addOrderBy('l.identifier', 'ASC')
+ ->addOrderBy('v.value', 'ASC');
return $query->execute()->fetchAllAssociative();
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/Repository/ContentService.php vendor-4.6.7/ibexa/core/src/lib/Repository/ContentService.php
--- vendor-4.6.2/ibexa/core/src/lib/Repository/ContentService.php 2024-07-02 10:19:17.523305353 +0200
+++ vendor-4.6.7/ibexa/core/src/lib/Repository/ContentService.php 2024-07-02 10:23:18.058890202 +0200
@@ -253,7 +253,7 @@
*/
public function loadVersionInfo(ContentInfo $contentInfo, ?int $versionNo = null): APIVersionInfo
{
- return $this->loadVersionInfoById($contentInfo->id, $versionNo);
+ return $this->loadVersionInfoById($contentInfo->getId(), $versionNo);
}
/**
@@ -1517,16 +1517,12 @@
$publishedContent = $this->internalLoadContentById($versionInfo->getContentInfo()->getId());
$publishedVersionInfo = $publishedContent->getVersionInfo();
- if (
- !$publishedVersionInfo->isPublished()
- || ($versionInfo->versionNo >= $publishedVersionInfo->versionNo)
- ) {
+ if (!$publishedVersionInfo->isPublished()) {
return;
}
- $publishedContentFieldsInMainLanguage = $publishedContent->getFieldsByLanguage(
- $publishedContent->getVersionInfo()->getContentInfo()->getMainLanguageCode()
- );
+ $mainLanguageCode = $publishedContent->getVersionInfo()->getContentInfo()->getMainLanguageCode();
+ $publishedContentFieldsInMainLanguage = $publishedContent->getFieldsByLanguage($mainLanguageCode);
$fieldValues = [];
$persistenceFields = [];
@@ -1545,7 +1541,12 @@
$fieldDefinition->fieldTypeIdentifier
);
- $newValue = $publishedContentFieldsInMainLanguage[$field->fieldDefIdentifier]->getValue();
+ $newValue = (
+ $versionInfo->versionNo >= $publishedVersionInfo->versionNo
+ && $versionInfo->initialLanguageCode === $mainLanguageCode
+ )
+ ? $field->getValue()
+ : $publishedContentFieldsInMainLanguage[$field->fieldDefIdentifier]->getValue();
$fieldValues[$fieldDefinition->identifier][$field->languageCode] = $newValue;
$persistenceFields[] = new SPIField(
@@ -1991,15 +1992,6 @@
return $this->internalLoadContentById($content->id);
}
- /**
- * Loads all outgoing relations for the given version.
- *
- * @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException if the user is not allowed to read this version
- *
- * @param \Ibexa\Contracts\Core\Repository\Values\Content\VersionInfo $versionInfo
- *
- * @return \Ibexa\Contracts\Core\Repository\Values\Content\Relation[]
- */
public function loadRelations(APIVersionInfo $versionInfo): iterable
{
if ($versionInfo->isPublished()) {
@@ -2048,6 +2040,78 @@
return $relations;
}
+ public function countRelations(APIVersionInfo $versionInfo): int
+ {
+ $function = $versionInfo->isPublished() ? 'read' : 'versionread';
+
+ if (!$this->permissionResolver->canUser('content', $function, $versionInfo)) {
+ return 0;
+ }
+
+ $contentInfo = $versionInfo->getContentInfo();
+
+ return $this->persistenceHandler->contentHandler()->countRelations(
+ $contentInfo->id,
+ $versionInfo->versionNo
+ );
+ }
+
+ public function loadRelationList(APIVersionInfo $versionInfo, int $offset = 0, int $limit = self::DEFAULT_PAGE_SIZE): RelationList
+ {
+ $function = $versionInfo->isPublished() ? 'read' : 'versionread';
+
+ $list = new RelationList();
+
+ if (!$this->permissionResolver->canUser('content', $function, $versionInfo)) {
+ return $list;
+ }
+
+ $contentInfo = $versionInfo->getContentInfo();
+ $list->totalCount = $this->persistenceHandler->contentHandler()->countRelations(
+ $contentInfo->id,
+ $versionInfo->versionNo
+ );
+
+ if ($list->totalCount === 0) {
+ return $list;
+ }
+
+ $persistenceRelationList = $this->persistenceHandler->contentHandler()->loadRelationList(
+ $contentInfo->id,
+ $limit,
+ $offset,
+ $versionInfo->versionNo,
+ );
+
+ $destinationContentIds = array_column($persistenceRelationList, 'destinationContentId');
+ $destinationContentInfos = $this->persistenceHandler->contentHandler()->loadContentInfoList($destinationContentIds);
+
+ foreach ($persistenceRelationList as $persistenceRelation) {
+ $contentId = $persistenceRelation->destinationContentId;
+ $destinationContentInfo = $this->contentDomainMapper->buildContentInfoDomainObject(
+ $destinationContentInfos[$contentId]
+ );
+
+ if (!$this->permissionResolver->canUser('content', 'read', $destinationContentInfo)) {
+ $list->items[] = new UnauthorizedRelationListItem(
+ 'content',
+ 'read',
+ ['contentId' => $destinationContentInfo->id]
+ );
+
+ continue;
+ }
+ $relation = $this->contentDomainMapper->buildRelationDomainObject(
+ $persistenceRelation,
+ $contentInfo,
+ $destinationContentInfo
+ );
+ $list->items[] = new RelationListItem($relation);
+ }
+
+ return $list;
+ }
+
/**
* {@inheritdoc}
*/
@@ -2057,9 +2121,7 @@
return 0;
}
- return $this->persistenceHandler->contentHandler()->countReverseRelations(
- $contentInfo->id
- );
+ return $this->persistenceHandler->contentHandler()->countReverseRelations($contentInfo->getId());
}
/**
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/Repository/Mapper/ContentDomainMapper.php vendor-4.6.7/ibexa/core/src/lib/Repository/Mapper/ContentDomainMapper.php
--- vendor-4.6.2/ibexa/core/src/lib/Repository/Mapper/ContentDomainMapper.php 2024-07-02 10:19:17.524305355 +0200
+++ vendor-4.6.7/ibexa/core/src/lib/Repository/Mapper/ContentDomainMapper.php 2024-07-02 10:23:18.058890202 +0200
@@ -220,31 +220,35 @@
*
* @param \Ibexa\Contracts\Core\Persistence\Content\Field[] $spiFields
* @param \Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType|\Ibexa\Contracts\Core\Persistence\Content\Type $contentType
- * @param array $prioritizedLanguages A language priority, filters returned fields and is used as prioritized language code on
+ * @param string[] $prioritizedLanguages A language priority, filters returned fields and is used as prioritized language code on
* returned value object. If not given all languages are returned.
* @param string|null $alwaysAvailableLanguage Language code fallback if a given field is not found in $prioritizedLanguages
*
- * @return array
+ * @return array<\Ibexa\Contracts\Core\Repository\Values\Content\Field>
*/
public function buildDomainFields(
array $spiFields,
$contentType,
array $prioritizedLanguages = [],
string $alwaysAvailableLanguage = null
- ) {
- if (!$contentType instanceof SPIContentType && !$contentType instanceof ContentType) {
+ ): array {
+ if ($contentType instanceof SPIContentType) {
+ $contentType = $this->mapPersistenceContentTypeToApi($contentType, $prioritizedLanguages, __METHOD__);
+ }
+
+ if (!$contentType instanceof ContentType) {
throw new InvalidArgumentType('$contentType', 'SPI ContentType | API ContentType');
}
$fieldDefinitionsMap = [];
- foreach ($contentType->fieldDefinitions as $fieldDefinition) {
- $fieldDefinitionsMap[$fieldDefinition->id] = $fieldDefinition;
+ foreach ($contentType->getFieldDefinitions() as $fieldDefinition) {
+ $fieldDefinitionsMap[$fieldDefinition->getId()] = $fieldDefinition;
}
$fieldInFilterLanguagesMap = [];
if (!empty($prioritizedLanguages) && $alwaysAvailableLanguage !== null) {
foreach ($spiFields as $spiField) {
- if (in_array($spiField->languageCode, $prioritizedLanguages)) {
+ if (in_array($spiField->languageCode, $prioritizedLanguages, true)) {
$fieldInFilterLanguagesMap[$spiField->fieldDefinitionId] = true;
}
}
@@ -259,7 +263,7 @@
$fieldDefinition = $fieldDefinitionsMap[$spiField->fieldDefinitionId];
- if (!empty($prioritizedLanguages) && !in_array($spiField->languageCode, $prioritizedLanguages)) {
+ if (!empty($prioritizedLanguages) && !in_array($spiField->languageCode, $prioritizedLanguages, true)) {
// If filtering is enabled we ignore fields in other languages then $prioritizedLanguages, if:
if ($alwaysAvailableLanguage === null) {
// Ignore field if we don't have $alwaysAvailableLanguageCode fallback
@@ -273,13 +277,13 @@
}
}
- $fields[$fieldDefinition->position][] = new Field(
+ $fields[$fieldDefinition->getPosition()][] = new Field(
[
'id' => $spiField->id,
'value' => $this->fieldTypeRegistry->getFieldType($spiField->type)
->fromPersistenceValue($spiField->value),
'languageCode' => $spiField->languageCode,
- 'fieldDefIdentifier' => $fieldDefinition->identifier,
+ 'fieldDefIdentifier' => $fieldDefinition->getIdentifier(),
'fieldTypeIdentifier' => $spiField->type,
]
);
@@ -536,12 +540,13 @@
'alwaysAvailable' => 1,
'remoteId' => null,
'mainLanguageCode' => 'eng-GB',
+ 'isHidden' => false,
]);
$content = new Content([
'versionInfo' => new VersionInfo([
'names' => [
- $contentInfo->mainLanguageCode => $contentInfo->name,
+ $contentInfo->getMainLanguageCode() => $contentInfo->getName(),
],
'contentInfo' => $contentInfo,
'versionNo' => $contentInfo->currentVersionNo,
@@ -571,7 +576,7 @@
'contentInfo' => $contentInfo,
'id' => $spiLocation->id,
'priority' => $spiLocation->priority,
- 'hidden' => $spiLocation->hidden || $contentInfo->isHidden,
+ 'hidden' => $spiLocation->hidden || $contentInfo->isHidden(),
'invisible' => $spiLocation->invisible,
'explicitlyHidden' => $spiLocation->hidden,
'remoteId' => $spiLocation->remoteId,
@@ -893,6 +898,34 @@
{
return $spiLocation->id === $spiLocation->parentId;
}
+
+ /**
+ * @param string[] $prioritizedLanguages
+ */
+ private function mapPersistenceContentTypeToApi(
+ SPIContentType $contentType,
+ array $prioritizedLanguages,
+ string $methodName
+ ): ContentType {
+ trigger_deprecation(
+ 'ibexa/core',
+ '4.6',
+ sprintf(
+ 'Passing %s instead of %s as 2nd argument of %s() method is deprecated and will cause a fatal error in 5.0. ' .
+ 'Build %s using %s::buildContentTypeDomainObject prior passing it to the method',
+ SPIContentType::class,
+ ContentType::class,
+ $methodName,
+ ContentType::class,
+ ContentTypeDomainMapper::class
+ )
+ );
+
+ return $this->contentTypeDomainMapper->buildContentTypeDomainObject(
+ $contentType,
+ $prioritizedLanguages
+ );
+ }
}
class_alias(ContentDomainMapper::class, 'eZ\Publish\Core\Repository\Mapper\ContentDomainMapper');
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/Repository/Mapper/ContentLocationMapper/DecoratedLocationService.php vendor-4.6.7/ibexa/core/src/lib/Repository/Mapper/ContentLocationMapper/DecoratedLocationService.php
--- vendor-4.6.2/ibexa/core/src/lib/Repository/Mapper/ContentLocationMapper/DecoratedLocationService.php 2024-07-02 10:19:17.524305355 +0200
+++ vendor-4.6.7/ibexa/core/src/lib/Repository/Mapper/ContentLocationMapper/DecoratedLocationService.php 2024-07-02 10:23:18.058890202 +0200
@@ -123,8 +123,8 @@
{
foreach ($locationList as $location) {
$this->contentLocationMapper->setMapping(
- $location->id,
- $location->contentId
+ $location->getId(),
+ $location->getContentId()
);
}
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/Repository/SiteAccessAware/ContentService.php vendor-4.6.7/ibexa/core/src/lib/Repository/SiteAccessAware/ContentService.php
--- vendor-4.6.2/ibexa/core/src/lib/Repository/SiteAccessAware/ContentService.php 2024-07-02 10:19:17.524305355 +0200
+++ vendor-4.6.7/ibexa/core/src/lib/Repository/SiteAccessAware/ContentService.php 2024-07-02 10:23:18.058890202 +0200
@@ -196,6 +196,19 @@
return $this->service->loadRelations($versionInfo);
}
+ public function countRelations(VersionInfo $versionInfo): int
+ {
+ return $this->service->countRelations($versionInfo);
+ }
+
+ public function loadRelationList(
+ VersionInfo $versionInfo,
+ int $offset = 0,
+ int $limit = self::DEFAULT_PAGE_SIZE
+ ): RelationList {
+ return $this->service->loadRelationList($versionInfo, $offset, $limit);
+ }
+
/**
* {@inheritdoc}
*/
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/Repository/Strategy/ContentThumbnail/FirstMatchingFieldStrategy.php vendor-4.6.7/ibexa/core/src/lib/Repository/Strategy/ContentThumbnail/FirstMatchingFieldStrategy.php
--- vendor-4.6.2/ibexa/core/src/lib/Repository/Strategy/ContentThumbnail/FirstMatchingFieldStrategy.php 2024-07-02 10:19:17.524305355 +0200
+++ vendor-4.6.7/ibexa/core/src/lib/Repository/Strategy/ContentThumbnail/FirstMatchingFieldStrategy.php 2024-07-02 10:23:18.058890202 +0200
@@ -37,18 +37,18 @@
$fieldDefinitions = $contentType->getFieldDefinitions();
foreach ($fieldDefinitions as $fieldDefinition) {
- $field = $this->getFieldByIdentifier($fieldDefinition->identifier, $fields);
+ $field = $this->getFieldByIdentifier($fieldDefinition->getIdentifier(), $fields);
if ($field === null) {
continue;
}
- $fieldType = $this->fieldTypeService->getFieldType($fieldDefinition->fieldTypeIdentifier);
+ $fieldType = $this->fieldTypeService->getFieldType($fieldDefinition->getFieldTypeIdentifier());
if (
- $fieldDefinition->isThumbnail
- && $this->contentFieldStrategy->hasStrategy($field->fieldTypeIdentifier)
- && !$fieldType->isEmptyValue($field->value)
+ $fieldDefinition->isThumbnail()
+ && $this->contentFieldStrategy->hasStrategy($field->getFieldTypeIdentifier())
+ && !$fieldType->isEmptyValue($field->getValue())
) {
return $this->contentFieldStrategy->getThumbnail($field, $versionInfo);
}
@@ -61,7 +61,7 @@
{
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Field $field */
foreach ($fields as $field) {
- if ($field->fieldDefIdentifier === $identifier) {
+ if ($field->getFieldDefinitionIdentifier() === $identifier) {
return $field;
}
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/Repository/UserService.php vendor-4.6.7/ibexa/core/src/lib/Repository/UserService.php
--- vendor-4.6.2/ibexa/core/src/lib/Repository/UserService.php 2024-07-02 10:19:17.524305355 +0200
+++ vendor-4.6.7/ibexa/core/src/lib/Repository/UserService.php 2024-07-02 10:23:18.059890204 +0200
@@ -479,12 +479,12 @@
$content = $this->repository->getContentService()->internalLoadContentById($userId, $prioritizedLanguages);
// Get spiUser value from Field Value
foreach ($content->getFields() as $field) {
- if (!$field->value instanceof UserValue) {
+ $fieldValue = $field->getValue();
+ if (!$fieldValue instanceof UserValue) {
continue;
}
- /** @var \Ibexa\Core\FieldType\User\Value $value */
- $value = $field->value;
+ $value = $fieldValue;
$spiUser = new SPIUser();
$spiUser->id = $value->contentId;
$spiUser->login = $value->login;
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/Repository/Values/Content/Content.php vendor-4.6.7/ibexa/core/src/lib/Repository/Values/Content/Content.php
--- vendor-4.6.2/ibexa/core/src/lib/Repository/Values/Content/Content.php 2024-07-02 10:19:17.524305355 +0200
+++ vendor-4.6.7/ibexa/core/src/lib/Repository/Values/Content/Content.php 2024-07-02 10:23:18.059890204 +0200
@@ -75,9 +75,11 @@
$this->prioritizedFieldLanguageCode = $data['prioritizedFieldLanguageCode'] ?? null;
foreach ($this->internalFields as $field) {
- $this->fieldDefinitionTranslationMap[$field->fieldDefIdentifier][$field->languageCode] = $field;
+ $languageCode = $field->getLanguageCode();
+ $fieldDefinitionIdentifier = $field->getFieldDefinitionIdentifier();
+ $this->fieldDefinitionTranslationMap[$fieldDefinitionIdentifier][$languageCode] = $field;
// kept for BC due to property-read magic getter
- $this->fields[$field->fieldDefIdentifier][$field->languageCode] = $field->value;
+ $this->fields[$fieldDefinitionIdentifier][$languageCode] = $field->getValue();
}
}
@@ -182,10 +184,10 @@
{
switch ($property) {
case 'id':
- return $this->versionInfo->getContentInfo()->id;
+ return $this->getVersionInfo()->getContentInfo()->getId();
case 'contentInfo':
- return $this->versionInfo->getContentInfo();
+ return $this->getVersionInfo()->getContentInfo();
case 'thumbnail':
return $this->getThumbnail();
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/Repository/Values/Content/Location.php vendor-4.6.7/ibexa/core/src/lib/Repository/Values/Content/Location.php
--- vendor-4.6.2/ibexa/core/src/lib/Repository/Values/Content/Location.php 2024-07-02 10:19:17.524305355 +0200
+++ vendor-4.6.7/ibexa/core/src/lib/Repository/Values/Content/Location.php 2024-07-02 10:23:18.059890204 +0200
@@ -25,9 +25,6 @@
*/
protected $contentInfo;
- /** @var array */
- protected $path;
-
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Location|null */
protected $parentLocation;
@@ -71,18 +68,8 @@
*/
public function __get($property)
{
- switch ($property) {
- case 'contentId':
- return $this->contentInfo->id;
- case 'path':
- if ($this->path !== null) {
- return $this->path;
- }
- if (isset($this->pathString[1]) && $this->pathString[0] === '/') {
- return $this->path = explode('/', trim($this->pathString, '/'));
- }
-
- return $this->path = [];
+ if ($property === 'contentId') {
+ return $this->getContentInfo()->getId();
}
return parent::__get($property);
@@ -97,7 +84,7 @@
*/
public function __isset($property)
{
- if ($property === 'contentId' || $property === 'path') {
+ if ($property === 'contentId') {
return true;
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/Repository/Values/Content/TrashItem.php vendor-4.6.7/ibexa/core/src/lib/Repository/Values/Content/TrashItem.php
--- vendor-4.6.2/ibexa/core/src/lib/Repository/Values/Content/TrashItem.php 2024-07-02 10:19:17.525305358 +0200
+++ vendor-4.6.7/ibexa/core/src/lib/Repository/Values/Content/TrashItem.php 2024-07-02 10:23:18.059890204 +0200
@@ -26,9 +26,6 @@
*/
protected $contentInfo;
- /** @var array */
- protected $path;
-
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Location */
protected $parentLocation;
@@ -83,18 +80,8 @@
*/
public function __get($property)
{
- switch ($property) {
- case 'contentId':
- return $this->contentInfo->id;
- case 'path':
- if ($this->path !== null) {
- return $this->path;
- }
- if (isset($this->pathString[1]) && $this->pathString[0] === '/') {
- return $this->path = explode('/', trim($this->pathString, '/'));
- }
-
- return $this->path = [];
+ if ($property === 'contentId') {
+ return $this->contentInfo->id;
}
return parent::__get($property);
@@ -109,7 +96,7 @@
*/
public function __isset($property)
{
- if ($property === 'contentId' || $property === 'path') {
+ if ($property === 'contentId') {
return true;
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/Repository/Values/ContentType/FieldDefinitionCollection.php vendor-4.6.7/ibexa/core/src/lib/Repository/Values/ContentType/FieldDefinitionCollection.php
--- vendor-4.6.2/ibexa/core/src/lib/Repository/Values/ContentType/FieldDefinitionCollection.php 2024-07-02 10:19:17.525305358 +0200
+++ vendor-4.6.7/ibexa/core/src/lib/Repository/Values/ContentType/FieldDefinitionCollection.php 2024-07-02 10:23:18.059890204 +0200
@@ -34,7 +34,7 @@
foreach ($fieldDefinitions as $fieldDefinition) {
$this->fieldDefinitions[] = $fieldDefinition;
- $this->fieldDefinitionsByIdentifier[$fieldDefinition->identifier] = $fieldDefinition;
+ $this->fieldDefinitionsByIdentifier[$fieldDefinition->getIdentifier()] = $fieldDefinition;
}
}
@@ -162,7 +162,7 @@
private function getIsTypePredicate(string $fieldTypeIdentifier): Closure
{
return static function (FieldDefinition $fieldDefinition) use ($fieldTypeIdentifier) {
- return $fieldDefinition->fieldTypeIdentifier === $fieldTypeIdentifier;
+ return $fieldDefinition->getFieldTypeIdentifier() === $fieldTypeIdentifier;
};
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/Repository/Values/User/User.php vendor-4.6.7/ibexa/core/src/lib/Repository/Values/User/User.php
--- vendor-4.6.2/ibexa/core/src/lib/Repository/Values/User/User.php 2024-07-02 10:19:17.525305358 +0200
+++ vendor-4.6.7/ibexa/core/src/lib/Repository/Values/User/User.php 2024-07-02 10:23:18.059890204 +0200
@@ -130,7 +130,7 @@
return $this->getVersionInfo()->getContentInfo();
case 'id':
- return $this->getVersionInfo()->getContentInfo()->id;
+ return $this->getVersionInfo()->getContentInfo()->getId();
case 'versionInfo':
return $this->getVersionInfo();
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/Resources/settings/policies.yml vendor-4.6.7/ibexa/core/src/lib/Resources/settings/policies.yml
--- vendor-4.6.2/ibexa/core/src/lib/Resources/settings/policies.yml 2024-07-02 10:19:17.525305358 +0200
+++ vendor-4.6.7/ibexa/core/src/lib/Resources/settings/policies.yml 2024-07-02 10:23:18.059890204 +0200
@@ -26,7 +26,7 @@
delete: ~
state:
- assign: { Class: true, Section: true, Owner: true, Group: true, Node: true, Subtree: true, State: true, NewState: true }
+ assign: { Class: true, Section: true, Owner: true, Group: true, State: true, NewState: true }
administrate: ~
role:
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/Resources/settings/search_engines/legacy/criterion_handlers_common.yml vendor-4.6.7/ibexa/core/src/lib/Resources/settings/search_engines/legacy/criterion_handlers_common.yml
--- vendor-4.6.2/ibexa/core/src/lib/Resources/settings/search_engines/legacy/criterion_handlers_common.yml 2024-07-02 10:19:17.525305358 +0200
+++ vendor-4.6.7/ibexa/core/src/lib/Resources/settings/search_engines/legacy/criterion_handlers_common.yml 2024-07-02 10:23:18.059890204 +0200
@@ -144,6 +144,12 @@
- {name: ibexa.search.legacy.gateway.criterion_handler.content}
- {name: ibexa.search.legacy.gateway.criterion_handler.location}
+ Ibexa\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler\IsContainer:
+ parent: Ibexa\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler
+ tags:
+ - {name: ibexa.search.legacy.gateway.criterion_handler.content}
+ - {name: ibexa.search.legacy.gateway.criterion_handler.location}
+
Ibexa\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler\LanguageCode:
class: Ibexa\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler\LanguageCode
parent: Ibexa\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/Resources/settings/settings.yml vendor-4.6.7/ibexa/core/src/lib/Resources/settings/settings.yml
--- vendor-4.6.2/ibexa/core/src/lib/Resources/settings/settings.yml 2024-07-02 10:19:17.525305358 +0200
+++ vendor-4.6.7/ibexa/core/src/lib/Resources/settings/settings.yml 2024-07-02 10:23:18.059890204 +0200
@@ -1,5 +1,5 @@
parameters:
- ibexa.persistence.legacy.dsn: sqlite://:memory:
+ ibexa.persistence.legacy.dsn: 'sqlite://:memory:'
anonymous_user_id: 10
kernel.debug: false
languages: []
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/Resources/settings/storage_engines/cache.yml vendor-4.6.7/ibexa/core/src/lib/Resources/settings/storage_engines/cache.yml
--- vendor-4.6.2/ibexa/core/src/lib/Resources/settings/storage_engines/cache.yml 2024-07-02 10:19:17.525305358 +0200
+++ vendor-4.6.7/ibexa/core/src/lib/Resources/settings/storage_engines/cache.yml 2024-07-02 10:23:18.059890204 +0200
@@ -31,6 +31,8 @@
content_type_group_with_id_suffix: 'ctg-%s-bi'
content_type_group_list: 'ctgl-%s'
content_type_list_by_group: 'ctlbg-%s'
+ content_relation: 'cr-%s'
+ content_relations_list: 'crl-%s'
image_variation: 'ig'
image_variation_name: 'ign-%s'
image_variation_siteaccess: 'igs-%s'
@@ -117,6 +119,8 @@
content_info: 'ci-%s'
content_info_by_remote_id: 'cibri-%s'
content_locations: 'cl-%s'
+ content_relations_count_with_by_version_type_suffix: 'crc-%%s-v-%%s-t-%%s'
+ content_relations_list_with_by_version_type_suffix: 'crl-%%s-l-%%s-o-%%s-v-%%s-t-%%s'
content_reverse_relations_count: 'crrc-%s'
content_version_info: 'cvi-%s'
content_version_list: 'c-%s-vl'
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/Resources/settings/storage_engines/legacy/content_type.yml vendor-4.6.7/ibexa/core/src/lib/Resources/settings/storage_engines/legacy/content_type.yml
--- vendor-4.6.2/ibexa/core/src/lib/Resources/settings/storage_engines/legacy/content_type.yml 2024-07-02 10:19:17.525305358 +0200
+++ vendor-4.6.7/ibexa/core/src/lib/Resources/settings/storage_engines/legacy/content_type.yml 2024-07-02 10:23:18.059890204 +0200
@@ -39,7 +39,6 @@
class: Ibexa\Core\Persistence\Legacy\Content\Type\Update\Handler\DoctrineDatabase
arguments:
- '@ibexa.persistence.legacy.content_type.gateway'
- - '@Ibexa\Core\Persistence\Legacy\Content\Type\ContentUpdater'
ibexa.persistence.legacy.content_type.update_handler:
alias: Ibexa\Core\Persistence\Legacy\Content\Type\Update\Handler\DoctrineDatabase
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/Resources/settings/storage_engines/legacy/content.yml vendor-4.6.7/ibexa/core/src/lib/Resources/settings/storage_engines/legacy/content.yml
--- vendor-4.6.2/ibexa/core/src/lib/Resources/settings/storage_engines/legacy/content.yml 2024-07-02 10:19:17.525305358 +0200
+++ vendor-4.6.7/ibexa/core/src/lib/Resources/settings/storage_engines/legacy/content.yml 2024-07-02 10:23:18.059890204 +0200
@@ -9,6 +9,16 @@
arguments:
- '@Ibexa\Core\Persistence\Legacy\Content\FieldValue\ConverterRegistry'
- '@ibexa.spi.persistence.legacy.language.handler'
+ - '@ibexa.spi.persistence.legacy.content_type.handler'
+ - '@Symfony\Contracts\EventDispatcher\EventDispatcherInterface'
+
+ Ibexa\Core\Persistence\Legacy\Content\Mapper\ResolveVirtualFieldSubscriber:
+ arguments:
+ $converterRegistry: '@Ibexa\Core\Persistence\Legacy\Content\FieldValue\ConverterRegistry'
+ $storageRegistry: '@Ibexa\Core\Persistence\Legacy\Content\StorageRegistry'
+ $contentGateway: '@ibexa.persistence.legacy.content.gateway'
+ tags:
+ - { name: kernel.event_subscriber }
Ibexa\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase.inner:
class: Ibexa\Core\Persistence\Legacy\Content\Gateway\DoctrineDatabase
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/core/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/IsContainer.php vendor-4.6.7/ibexa/core/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/IsContainer.php
--- vendor-4.6.2/ibexa/core/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/IsContainer.php 1970-01-01 01:00:00.000000000 +0100
+++ vendor-4.6.7/ibexa/core/src/lib/Search/Legacy/Content/Common/Gateway/CriterionHandler/IsContainer.php 2024-07-02 10:23:18.059890204 +0200
@@ -0,0 +1,56 @@
+<?php
+
+/**
+ * @copyright Copyright (C) Ibexa AS. All rights reserved.
+ * @license For full copyright and license information view LICENSE file distributed with this source code.
+ */
+declare(strict_types=1);
+
+namespace Ibexa\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler;
+
+use Doctrine\DBAL\ParameterType;
+use Doctrine\DBAL\Query\QueryBuilder;
+use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion;
+use Ibexa\Core\Persistence\Legacy\Content\Type\Gateway as ContentTypeGateway;
+use Ibexa\Core\Search\Legacy\Content\Common\Gateway\CriteriaConverter;
+use Ibexa\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler;
+
+final class IsContainer extends CriterionHandler
+{
+ public function accept(Criterion $criterion): bool
+ {
+ return $criterion instanceof Criterion\IsContainer;
+ }
+
+ /**
+ * @phpstan-param array{languages: string[]} $languageSettings
+ */
+ public function handle(
+ CriteriaConverter $converter,
+ QueryBuilder $queryBuilder,
+ Criterion $criterion,
+ array $languageSettings
+ ) {
+ /** @var array{bool} $criterionValue */
+ $criterionValue = $criterion->value;
+ $isContainer = reset($criterionValue);
+
+ $subSelect = $this->connection->createQueryBuilder();
+ $subSelect
+ ->select(
+ 'id'
+ )->from(
+ ContentTypeGateway::CONTENT_TYPE_TABLE
+ )->where(
+ $queryBuilder->expr()->eq(
+ 'is_container',
+ $queryBuilder->createNamedParameter((int)$isContainer, ParameterType::INTEGER)
+ )
+ );
+
+ return $queryBuilder->expr()->in(
+ 'c.contentclass_id',
+ $subSelect->getSQL()
+ );
+ }
+}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/fieldtype-matrix/src/bundle/Resources/config/services/graphql.yaml vendor-4.6.7/ibexa/fieldtype-matrix/src/bundle/Resources/config/services/graphql.yaml
--- vendor-4.6.2/ibexa/fieldtype-matrix/src/bundle/Resources/config/services/graphql.yaml 2024-07-02 10:19:28.770332677 +0200
+++ vendor-4.6.7/ibexa/fieldtype-matrix/src/bundle/Resources/config/services/graphql.yaml 2024-07-02 10:23:25.264907738 +0200
@@ -25,5 +25,11 @@
- { name: ibexa.graphql.field_type.input.handler, fieldtype: ezmatrix }
Ibexa\FieldTypeMatrix\GraphQL\FieldValueResolver:
+ arguments:
+ $strategies: !tagged_iterator ibexa.graphql.field_type.matrix_resolver.content.strategy
tags:
- - {name: overblog_graphql.resolver, alias: "MatrixFieldValue", method: "resolveMatrixFieldValue"}
+ - { name: overblog_graphql.resolver, alias: "MatrixFieldValue", method: "resolveMatrixFieldValue" }
+
+ Ibexa\FieldTypeMatrix\GraphQL\Strategy\ItemContentResolvingStrategy:
+ tags:
+ - { name: ibexa.graphql.field_type.matrix_resolver.content.strategy, priority: -20 }
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/fieldtype-matrix/src/lib/GraphQL/FieldValueResolver.php vendor-4.6.7/ibexa/fieldtype-matrix/src/lib/GraphQL/FieldValueResolver.php
--- vendor-4.6.2/ibexa/fieldtype-matrix/src/lib/GraphQL/FieldValueResolver.php 2024-07-02 10:19:28.770332677 +0200
+++ vendor-4.6.7/ibexa/fieldtype-matrix/src/lib/GraphQL/FieldValueResolver.php 2024-07-02 10:23:25.265907740 +0200
@@ -8,17 +8,48 @@
namespace Ibexa\FieldTypeMatrix\GraphQL;
+use Ibexa\Core\Base\Exceptions\BadStateException;
use Ibexa\FieldTypeMatrix\FieldType\Value\RowsCollection;
-use Ibexa\GraphQL\Value\Item;
class FieldValueResolver
{
- public function resolveMatrixFieldValue(Item $item, string $fieldDefIdentifier): RowsCollection
+ /** @var iterable<\Ibexa\FieldTypeMatrix\GraphQL\Strategy\ContentResolvingStrategyInterface> */
+ private iterable $strategies;
+
+ /**
+ * @param iterable<\Ibexa\FieldTypeMatrix\GraphQL\Strategy\ContentResolvingStrategyInterface> $strategies
+ */
+ public function __construct(iterable $strategies)
+ {
+ $this->strategies = $strategies;
+ }
+
+ /**
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\InvalidArgumentException
+ * @throws \Ibexa\Contracts\Core\Repository\Exceptions\BadStateException
+ */
+ public function resolveMatrixFieldValue(object $item, string $fieldDefIdentifier): RowsCollection
{
$silentRows = [];
+ $content = null;
+
+ foreach ($this->strategies as $strategy) {
+ if (!$strategy->supports($item)) {
+ continue;
+ }
+
+ $content = $strategy->resolveContent($item);
+ }
+
+ if ($content === null) {
+ throw new BadStateException(
+ '$item',
+ 'GraphQL item cannot be resolved to a content.'
+ );
+ }
/** @var \Ibexa\FieldTypeMatrix\FieldType\Value\RowsCollection $rows $rows */
- $rows = $item->getContent()->getFieldValue($fieldDefIdentifier)->getRows();
+ $rows = $content->getFieldValue($fieldDefIdentifier)->getRows();
foreach ($rows as $row) {
$silentRows[] = new SilentRow($row->getCells());
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/fieldtype-matrix/src/lib/GraphQL/Strategy/ContentResolvingStrategyInterface.php vendor-4.6.7/ibexa/fieldtype-matrix/src/lib/GraphQL/Strategy/ContentResolvingStrategyInterface.php
--- vendor-4.6.2/ibexa/fieldtype-matrix/src/lib/GraphQL/Strategy/ContentResolvingStrategyInterface.php 1970-01-01 01:00:00.000000000 +0100
+++ vendor-4.6.7/ibexa/fieldtype-matrix/src/lib/GraphQL/Strategy/ContentResolvingStrategyInterface.php 2024-07-02 10:23:25.265907740 +0200
@@ -0,0 +1,18 @@
+<?php
+
+/**
+ * @copyright Copyright (C) Ibexa AS. All rights reserved.
+ * @license For full copyright and license information view LICENSE file distributed with this source code.
+ */
+declare(strict_types=1);
+
+namespace Ibexa\FieldTypeMatrix\GraphQL\Strategy;
+
+use Ibexa\Contracts\Core\Repository\Values\Content\Content;
+
+interface ContentResolvingStrategyInterface
+{
+ public function resolveContent(object $item): Content;
+
+ public function supports(object $item): bool;
+}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/fieldtype-matrix/src/lib/GraphQL/Strategy/ItemContentResolvingStrategy.php vendor-4.6.7/ibexa/fieldtype-matrix/src/lib/GraphQL/Strategy/ItemContentResolvingStrategy.php
--- vendor-4.6.2/ibexa/fieldtype-matrix/src/lib/GraphQL/Strategy/ItemContentResolvingStrategy.php 1970-01-01 01:00:00.000000000 +0100
+++ vendor-4.6.7/ibexa/fieldtype-matrix/src/lib/GraphQL/Strategy/ItemContentResolvingStrategy.php 2024-07-02 10:23:25.265907740 +0200
@@ -0,0 +1,26 @@
+<?php
+
+/**
+ * @copyright Copyright (C) Ibexa AS. All rights reserved.
+ * @license For full copyright and license information view LICENSE file distributed with this source code.
+ */
+declare(strict_types=1);
+
+namespace Ibexa\FieldTypeMatrix\GraphQL\Strategy;
+
+use Ibexa\Contracts\Core\Repository\Values\Content\Content;
+use Ibexa\GraphQL\Value\Item;
+
+final class ItemContentResolvingStrategy implements ContentResolvingStrategyInterface
+{
+ public function resolveContent(object $item): Content
+ {
+ /** @var \Ibexa\GraphQL\Value\Item $item */
+ return $item->getContent();
+ }
+
+ public function supports(object $item): bool
+ {
+ return $item instanceof Item;
+ }
+}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/fieldtype-richtext/.gitignore vendor-4.6.7/ibexa/fieldtype-richtext/.gitignore
--- vendor-4.6.2/ibexa/fieldtype-richtext/.gitignore 2024-07-02 10:19:28.300331535 +0200
+++ vendor-4.6.7/ibexa/fieldtype-richtext/.gitignore 2024-07-02 10:23:24.861906756 +0200
@@ -3,3 +3,4 @@
/.php_cs.cache
node_modules/
yarn.lock
+/var
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/fieldtype-richtext/src/bundle/DependencyInjection/IbexaFieldTypeRichTextExtension.php vendor-4.6.7/ibexa/fieldtype-richtext/src/bundle/DependencyInjection/IbexaFieldTypeRichTextExtension.php
--- vendor-4.6.2/ibexa/fieldtype-richtext/src/bundle/DependencyInjection/IbexaFieldTypeRichTextExtension.php 2024-07-02 10:19:28.302331540 +0200
+++ vendor-4.6.7/ibexa/fieldtype-richtext/src/bundle/DependencyInjection/IbexaFieldTypeRichTextExtension.php 2024-07-02 10:23:24.862906759 +0200
@@ -184,7 +184,10 @@
'output_dir' => __DIR__ . '/../Resources/translations/',
'output_format' => 'xliff',
'excluded_dirs' => ['Behat', 'Tests', 'node_modules'],
- 'extractors' => [],
+ 'extractors' => [
+ 'ibexa.translation_extractor.field_type.ezrichtext.custom_tags',
+ 'ibexa.translation_extractor.field_type.ezrichtext.custom_tags.choices',
+ ],
],
],
]);
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/fieldtype-richtext/src/bundle/Resources/config/translation.yaml vendor-4.6.7/ibexa/fieldtype-richtext/src/bundle/Resources/config/translation.yaml
--- vendor-4.6.2/ibexa/fieldtype-richtext/src/bundle/Resources/config/translation.yaml 2024-07-02 10:19:28.302331540 +0200
+++ vendor-4.6.7/ibexa/fieldtype-richtext/src/bundle/Resources/config/translation.yaml 2024-07-02 10:23:24.862906759 +0200
@@ -5,7 +5,26 @@
public: false
Ibexa\FieldTypeRichText\Translation\Extractor\OnlineEditorCustomAttributesExtractor:
+ deprecated: 'Since ibexa/fieldtype-richtext 4.6.7 the "%service_id%" service is deprecated, will be removed in 5.0.0'
arguments:
$siteAccessList: '%ibexa.site_access.list%'
tags:
- { name: jms_translation.extractor, alias: ez_online_editor_attributes }
+
+ Ibexa\FieldTypeRichText\Translation\Extractor\CustomTagExtractor:
+ arguments:
+ $customTags: '%ibexa.field_type.richtext.custom_tags%'
+ $domain: '%ibexa.field_type.richtext.custom_tags.translation_domain%'
+ $allowlist: ['ezyoutube', 'eztwitter', 'ezfacebook']
+ tags:
+ - name: jms_translation.extractor
+ alias: ibexa.translation_extractor.field_type.ezrichtext.custom_tags
+
+ Ibexa\FieldTypeRichText\Translation\Extractor\ChoiceAttributeExtractor:
+ arguments:
+ $customTags: '%ibexa.field_type.richtext.custom_tags%'
+ $domain: '%ibexa.field_type.richtext.custom_tags.translation_domain%'
+ $allowlist: ['ezyoutube', 'eztwitter', 'ezfacebook']
+ tags:
+ - name: jms_translation.extractor
+ alias: ibexa.translation_extractor.field_type.ezrichtext.custom_tags.choices
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/fieldtype-richtext/src/lib/Translation/Extractor/ChoiceAttributeExtractor.php vendor-4.6.7/ibexa/fieldtype-richtext/src/lib/Translation/Extractor/ChoiceAttributeExtractor.php
--- vendor-4.6.2/ibexa/fieldtype-richtext/src/lib/Translation/Extractor/ChoiceAttributeExtractor.php 1970-01-01 01:00:00.000000000 +0100
+++ vendor-4.6.7/ibexa/fieldtype-richtext/src/lib/Translation/Extractor/ChoiceAttributeExtractor.php 2024-07-02 10:23:24.862906759 +0200
@@ -0,0 +1,81 @@
+<?php
+
+/**
+ * @copyright Copyright (C) Ibexa AS. All rights reserved.
+ * @license For full copyright and license information view LICENSE file distributed with this source code.
+ */
+declare(strict_types=1);
+
+namespace Ibexa\FieldTypeRichText\Translation\Extractor;
+
+use JMS\TranslationBundle\Model\MessageCatalogue;
+use JMS\TranslationBundle\Translation\ExtractorInterface;
+
+/**
+ * Generates translation strings for choice custom tag attribute.
+ */
+final class ChoiceAttributeExtractor implements ExtractorInterface
+{
+ private const CHOICE_ATTRIBUTE_TYPE = 'choice';
+ private const CHOICE_LABEL_KEY = 'ezrichtext.custom_tags.%s.attributes.%s.choice.%s.label';
+
+ /** @var array<string, mixed> */
+ private array $customTags;
+
+ private string $domain;
+
+ /** @var string[] */
+ private array $allowlist;
+
+ /**
+ * @param array<string, mixed> $customTags Custom tags definitions
+ * @param string $domain Target translation domain
+ * @param string[] $allowlist Whitelist of custom tags to extract
+ */
+ public function __construct(array $customTags, string $domain, array $allowlist = [])
+ {
+ $this->customTags = $customTags;
+ $this->domain = $domain;
+ $this->allowlist = $allowlist;
+ }
+
+ public function extract(): MessageCatalogue
+ {
+ $catalogue = new MessageCatalogueBuilder($this->domain);
+ foreach ($this->customTags as $tagName => $customTag) {
+ if (!in_array($tagName, $this->allowlist, true)) {
+ continue;
+ }
+
+ $attributes = $customTag['attributes'] ?? [];
+ foreach ($attributes as $attributeName => $attribute) {
+ $type = $attribute['type'] ?? null;
+ if ($type !== self::CHOICE_ATTRIBUTE_TYPE) {
+ continue;
+ }
+
+ foreach ($attribute['choices'] as $choice) {
+ if (empty($choice)) {
+ continue;
+ }
+
+ $this->addChoiceLabelMessage($catalogue, $tagName, $attributeName, $choice);
+ }
+ }
+ }
+
+ return $catalogue->getCatalogue();
+ }
+
+ private function addChoiceLabelMessage(
+ MessageCatalogueBuilder $catalogue,
+ string $tagName,
+ string $attributeName,
+ string $choice
+ ): void {
+ $catalogue->addMessage(
+ sprintf(self::CHOICE_LABEL_KEY, $tagName, $attributeName, $choice),
+ $choice
+ );
+ }
+}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/fieldtype-richtext/src/lib/Translation/Extractor/CustomTagExtractor.php vendor-4.6.7/ibexa/fieldtype-richtext/src/lib/Translation/Extractor/CustomTagExtractor.php
--- vendor-4.6.2/ibexa/fieldtype-richtext/src/lib/Translation/Extractor/CustomTagExtractor.php 1970-01-01 01:00:00.000000000 +0100
+++ vendor-4.6.7/ibexa/fieldtype-richtext/src/lib/Translation/Extractor/CustomTagExtractor.php 2024-07-02 10:23:24.862906759 +0200
@@ -0,0 +1,84 @@
+<?php
+
+/**
+ * @copyright Copyright (C) Ibexa AS. All rights reserved.
+ * @license For full copyright and license information view LICENSE file distributed with this source code.
+ */
+declare(strict_types=1);
+
+namespace Ibexa\FieldTypeRichText\Translation\Extractor;
+
+use JMS\TranslationBundle\Model\MessageCatalogue;
+use JMS\TranslationBundle\Translation\ExtractorInterface;
+
+/**
+ * Generates translation strings for custom tags.
+ */
+final class CustomTagExtractor implements ExtractorInterface
+{
+ private const CUSTOM_TAG_LABEL = 'ezrichtext.custom_tags.%s.label';
+ private const CUSTOM_TAG_DESCRIPTION = 'ezrichtext.custom_tags.%s.description';
+ private const ATTRIBUTE_LABEL = 'ezrichtext.custom_tags.%s.attributes.%s.label';
+
+ /** @var array<string, mixed> */
+ private array $customTags;
+
+ private string $domain;
+
+ /** @var string[] */
+ private array $allowlist;
+
+ /**
+ * @param array<string, mixed> $customTags Custom tags definitions
+ * @param string $domain Target translation domain
+ * @param string[] $allowlist Whitelist of custom tags to extract
+ */
+ public function __construct(array $customTags, string $domain, array $allowlist = [])
+ {
+ $this->customTags = $customTags;
+ $this->domain = $domain;
+ $this->allowlist = $allowlist;
+ }
+
+ public function extract(): MessageCatalogue
+ {
+ $catalogue = new MessageCatalogueBuilder($this->domain);
+ foreach ($this->customTags as $tagName => $config) {
+ if (!in_array($tagName, $this->allowlist, true)) {
+ continue;
+ }
+
+ $this->addCustomTagLabelMessage($catalogue, $tagName);
+ $this->addCustomTagDescriptionMessage($catalogue, $tagName);
+
+ /** @var string[] $attributes */
+ $attributes = array_keys($config['attributes'] ?? []);
+ foreach ($attributes as $attributeName) {
+ $this->addAttributeLabelMessage($catalogue, $tagName, $attributeName);
+ }
+ }
+
+ return $catalogue->getCatalogue();
+ }
+
+ private function addCustomTagLabelMessage(MessageCatalogueBuilder $catalogue, string $tagName): void
+ {
+ $catalogue->addMessage(sprintf(self::CUSTOM_TAG_LABEL, $tagName), $tagName);
+ }
+
+ private function addCustomTagDescriptionMessage(MessageCatalogueBuilder $catalogue, string $tagName): void
+ {
+ $catalogue->addMessage(sprintf(self::CUSTOM_TAG_DESCRIPTION, $tagName), $tagName);
+ }
+
+ private function addAttributeLabelMessage(
+ MessageCatalogueBuilder $catalogue,
+ string $tagName,
+ string $attributeName
+ ): void {
+ $catalogue->addMessage(
+ sprintf(self::ATTRIBUTE_LABEL, $tagName, $attributeName),
+ $attributeName
+ );
+ }
+}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/fieldtype-richtext/src/lib/Translation/Extractor/MessageCatalogueBuilder.php vendor-4.6.7/ibexa/fieldtype-richtext/src/lib/Translation/Extractor/MessageCatalogueBuilder.php
--- vendor-4.6.2/ibexa/fieldtype-richtext/src/lib/Translation/Extractor/MessageCatalogueBuilder.php 1970-01-01 01:00:00.000000000 +0100
+++ vendor-4.6.7/ibexa/fieldtype-richtext/src/lib/Translation/Extractor/MessageCatalogueBuilder.php 2024-07-02 10:23:24.862906759 +0200
@@ -0,0 +1,60 @@
+<?php
+
+/**
+ * @copyright Copyright (C) Ibexa AS. All rights reserved.
+ * @license For full copyright and license information view LICENSE file distributed with this source code.
+ */
+declare(strict_types=1);
+
+namespace Ibexa\FieldTypeRichText\Translation\Extractor;
+
+use JMS\TranslationBundle\Model\Message\XliffMessage;
+use JMS\TranslationBundle\Model\MessageCatalogue;
+
+/**
+ * Utility class for building translation messages catalogue.
+ */
+final class MessageCatalogueBuilder
+{
+ private string $domain;
+
+ private MessageCatalogue $catalogue;
+
+ public function __construct(string $domain)
+ {
+ $this->domain = $domain;
+ $this->catalogue = new MessageCatalogue();
+ }
+
+ public function getDomain(): string
+ {
+ return $this->domain;
+ }
+
+ public function reset(): void
+ {
+ $this->catalogue = new MessageCatalogue();
+ }
+
+ public function getCatalogue(): MessageCatalogue
+ {
+ return $this->catalogue;
+ }
+
+ public function addMessage(string $id, string $desc): void
+ {
+ $this->catalogue->add($this->createMessage($id, $desc));
+ }
+
+ private function createMessage(string $id, string $desc): XliffMessage
+ {
+ $message = new XliffMessage($id, $this->domain);
+ $message->setNew(false);
+ $message->setMeaning($desc);
+ $message->setDesc($desc);
+ $message->setLocaleString($desc);
+ $message->addNote('key: ' . $id);
+
+ return $message;
+ }
+}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/fieldtype-richtext/src/lib/Translation/Extractor/OnlineEditorCustomAttributesExtractor.php vendor-4.6.7/ibexa/fieldtype-richtext/src/lib/Translation/Extractor/OnlineEditorCustomAttributesExtractor.php
--- vendor-4.6.2/ibexa/fieldtype-richtext/src/lib/Translation/Extractor/OnlineEditorCustomAttributesExtractor.php 2024-07-02 10:19:28.302331540 +0200
+++ vendor-4.6.7/ibexa/fieldtype-richtext/src/lib/Translation/Extractor/OnlineEditorCustomAttributesExtractor.php 2024-07-02 10:23:24.862906759 +0200
@@ -15,7 +15,7 @@
use JMS\TranslationBundle\Translation\ExtractorInterface;
/**
- * Generates translation strings for limitation types.
+ * @deprecated 4.6.7 The "OnlineEditorCustomAttributesExtractor" class is deprecated, will be removed in 5.0.
*/
final class OnlineEditorCustomAttributesExtractor implements ExtractorInterface
{
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/graphql/src/lib/Schema/Domain/Content/Mapper/FieldDefinition/ResolverVariables.php vendor-4.6.7/ibexa/graphql/src/lib/Schema/Domain/Content/Mapper/FieldDefinition/ResolverVariables.php
--- vendor-4.6.2/ibexa/graphql/src/lib/Schema/Domain/Content/Mapper/FieldDefinition/ResolverVariables.php 2024-07-02 10:19:28.686332473 +0200
+++ vendor-4.6.7/ibexa/graphql/src/lib/Schema/Domain/Content/Mapper/FieldDefinition/ResolverVariables.php 2024-07-02 10:23:25.194907568 +0200
@@ -38,22 +38,32 @@
public function mapToFieldValueResolver(FieldDefinition $fieldDefinition): string
{
$resolver = $this->innerMapper->mapToFieldValueResolver($fieldDefinition);
-
- return str_replace(
+ $resolver = str_replace(
[
'content',
'location',
'item',
- 'field',
],
[
'value.getContent()',
'value.getLocation()',
'value',
- 'resolver("ItemFieldValue", [value, "' . $fieldDefinition->identifier . '", args])',
],
$resolver
);
+
+ //we make sure no "field" (case insensitive) keyword in the actual field's identifier gets replaced
+ //only syntax like: '@=resolver("MatrixFieldValue", [value, "field_matrix"])' needs to be taken into account
+ //where [value, "field_matrix"] stands for the actual field's identifier
+ if (preg_match('/value, "(.*field.*)"/i', $resolver) !== 1) {
+ $resolver = str_replace(
+ 'field',
+ 'resolver("ItemFieldValue", [value, "' . $fieldDefinition->identifier . '", args])',
+ $resolver
+ );
+ }
+
+ return $resolver;
}
public function mapToFieldValueInputType(ContentType $contentType, FieldDefinition $fieldDefinition): ?string
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/notifications/src/bundle/DependencyInjection/Configuration/Parser/NotificationsConfigParser.php vendor-4.6.7/ibexa/notifications/src/bundle/DependencyInjection/Configuration/Parser/NotificationsConfigParser.php
--- vendor-4.6.2/ibexa/notifications/src/bundle/DependencyInjection/Configuration/Parser/NotificationsConfigParser.php 2024-07-02 10:19:17.596305530 +0200
+++ vendor-4.6.7/ibexa/notifications/src/bundle/DependencyInjection/Configuration/Parser/NotificationsConfigParser.php 2024-07-02 10:23:18.128890372 +0200
@@ -18,8 +18,14 @@
public function addSemanticConfig(NodeBuilder $nodeBuilder): void
{
+ /*
+ * Node name has been changed from "notifications" to "notifier" due to
+ * collision with Admin UI notifications parser.
+ *
+ * TODO: Change the name back to "notifications" in the next major version.
+ */
$nodeBuilder
- ->arrayNode('notifications')
+ ->arrayNode('notifier')
->children()
->arrayNode('subscriptions')
->info('Mandatory system notifications. Users cannot opt-out from below subscriptions.')
@@ -42,11 +48,11 @@
*/
public function mapConfig(array &$scopeSettings, $currentScope, ContextualizerInterface $contextualizer): void
{
- if (empty($scopeSettings['notifications'])) {
+ if (empty($scopeSettings['notifier'])) {
return;
}
- $settings = $scopeSettings['notifications'];
+ $settings = $scopeSettings['notifier'];
foreach (self::MAPPED_SETTINGS as $key) {
if (!isset($settings[$key])) {
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/notifications/src/bundle/Resources/config/prepend.yaml vendor-4.6.7/ibexa/notifications/src/bundle/Resources/config/prepend.yaml
--- vendor-4.6.2/ibexa/notifications/src/bundle/Resources/config/prepend.yaml 2024-07-02 10:19:17.596305530 +0200
+++ vendor-4.6.7/ibexa/notifications/src/bundle/Resources/config/prepend.yaml 2024-07-02 10:23:18.128890372 +0200
@@ -3,5 +3,5 @@
ibexa:
system:
default:
- notifications:
+ notifier:
subscriptions: []
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/rest/phpunit.functional.xml vendor-4.6.7/ibexa/rest/phpunit.functional.xml
--- vendor-4.6.2/ibexa/rest/phpunit.functional.xml 2024-07-02 10:19:17.822306079 +0200
+++ vendor-4.6.7/ibexa/rest/phpunit.functional.xml 2024-07-02 10:23:18.281890745 +0200
@@ -4,6 +4,7 @@
bootstrap="vendor/autoload.php"
beStrictAboutTestsThatDoNotTestAnything="false"
colors="true"
+ failOnWarning="true"
>
<php>
<env name="EZP_TEST_REST_HOST" value="localhost"/>
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/rest/src/bundle/Resources/config/input_parsers.yml vendor-4.6.7/ibexa/rest/src/bundle/Resources/config/input_parsers.yml
--- vendor-4.6.2/ibexa/rest/src/bundle/Resources/config/input_parsers.yml 2024-07-02 10:19:17.822306079 +0200
+++ vendor-4.6.7/ibexa/rest/src/bundle/Resources/config/input_parsers.yml 2024-07-02 10:23:18.281890745 +0200
@@ -441,6 +441,13 @@
tags:
- { name: ibexa.rest.input.parser, mediaType: application/vnd.ibexa.api.internal.criterion.UserMetadata }
+ Ibexa\Rest\Server\Input\Parser\Criterion\IsContainer:
+ parent: Ibexa\Rest\Server\Common\Parser
+ arguments:
+ $parserTools: '@Ibexa\Rest\Input\ParserTools'
+ tags:
+ - { name: ibexa.rest.input.parser, mediaType: application/vnd.ibexa.api.internal.criterion.IsContainer }
+
Ibexa\Rest\Server\Input\Parser\Criterion\IsUserBased:
parent: Ibexa\Rest\Server\Common\Parser
arguments:
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/rest/src/bundle/Resources/config/routing.yml vendor-4.6.7/ibexa/rest/src/bundle/Resources/config/routing.yml
--- vendor-4.6.2/ibexa/rest/src/bundle/Resources/config/routing.yml 2024-07-02 10:19:17.822306079 +0200
+++ vendor-4.6.7/ibexa/rest/src/bundle/Resources/config/routing.yml 2024-07-02 10:23:18.281890745 +0200
@@ -595,7 +595,7 @@
requirements:
contentTypeId: \d+
fieldDefinitionId: \d+
-
+
ibexa.rest.load_content_type_field_definition_by_identifier:
path: /content/types/{contentTypeId}/fieldDefinition/{fieldDefinitionIdentifier}
controller: Ibexa\Rest\Server\Controller\ContentType::loadContentTypeFieldDefinitionByIdentifier
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/rest/src/contracts/Input/Parser.php vendor-4.6.7/ibexa/rest/src/contracts/Input/Parser.php
--- vendor-4.6.2/ibexa/rest/src/contracts/Input/Parser.php 2024-07-02 10:19:17.822306079 +0200
+++ vendor-4.6.7/ibexa/rest/src/contracts/Input/Parser.php 2024-07-02 10:23:18.281890745 +0200
@@ -14,8 +14,7 @@
/**
* Parse input structure.
*
- * @param array $data
- * @param \Ibexa\Contracts\Rest\Input\ParsingDispatcher $parsingDispatcher
+ * @param array<mixed> $data
*
* @return \Ibexa\Contracts\Core\Repository\Values\ValueObject|object
*/
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/rest/src/contracts/Input/ParsingDispatcher.php vendor-4.6.7/ibexa/rest/src/contracts/Input/ParsingDispatcher.php
--- vendor-4.6.2/ibexa/rest/src/contracts/Input/ParsingDispatcher.php 2024-07-02 10:19:17.822306079 +0200
+++ vendor-4.6.7/ibexa/rest/src/contracts/Input/ParsingDispatcher.php 2024-07-02 10:23:18.281890745 +0200
@@ -30,7 +30,7 @@
* )
* </code>
*
- * @var \Ibexa\Contracts\Rest\Input\Parser[]
+ * @var array<string, array<string, \Ibexa\Contracts\Rest\Input\Parser>>
*/
protected array $parsers = [];
@@ -56,7 +56,7 @@
*/
public function addParser(string $mediaType, Parser $parser): void
{
- list($mediaType, $version) = $this->parseMediaTypeVersion($mediaType);
+ [$mediaType, $version] = $this->parseMediaTypeVersion($mediaType);
$this->parsers[$mediaType][$version] = $parser;
}
@@ -116,7 +116,7 @@
*
* @param string $mediaType Ex: text/html; version=1.1
*
- * @return array An array with the media-type string, stripped from the version, and the version (1.0 by default)
+ * @return array{string, string} An array with the media-type string, stripped from the version, and the version (1.0 by default)
*/
protected function parseMediaTypeVersion(string $mediaType): array
{
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/rest/src/lib/Server/Controller/SessionController.php vendor-4.6.7/ibexa/rest/src/lib/Server/Controller/SessionController.php
--- vendor-4.6.2/ibexa/rest/src/lib/Server/Controller/SessionController.php 2024-07-02 10:19:17.822306079 +0200
+++ vendor-4.6.7/ibexa/rest/src/lib/Server/Controller/SessionController.php 2024-07-02 10:23:18.281890745 +0200
@@ -103,6 +103,8 @@
/**
* Refresh given session.
*
+ * @deprecated 4.6.7 The "SessionController::refreshSessionAction()" method is deprecated, will be removed in 5.0. Use SessionController::checkSessionAction() instead.
+ *
* @param string $sessionId
*
* @throws \Ibexa\Contracts\Rest\Exceptions\NotFoundException
@@ -111,6 +113,12 @@
*/
public function refreshSessionAction($sessionId, Request $request)
{
+ trigger_deprecation(
+ 'ibexa/rest',
+ '4.6.7',
+ sprintf('The %s() method is deprecated, will be removed in 5.0.', __METHOD__)
+ );
+
$session = $request->getSession();
if ($session === null || !$session->isStarted() || $session->getId() != $sessionId || !$this->hasStoredCsrfToken()) {
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/rest/src/lib/Server/Input/Parser/Criterion/IsContainer.php vendor-4.6.7/ibexa/rest/src/lib/Server/Input/Parser/Criterion/IsContainer.php
--- vendor-4.6.2/ibexa/rest/src/lib/Server/Input/Parser/Criterion/IsContainer.php 1970-01-01 01:00:00.000000000 +0100
+++ vendor-4.6.7/ibexa/rest/src/lib/Server/Input/Parser/Criterion/IsContainer.php 2024-07-02 10:23:18.281890745 +0200
@@ -0,0 +1,37 @@
+<?php
+
+/**
+ * @copyright Copyright (C) Ibexa AS. All rights reserved.
+ * @license For full copyright and license information view LICENSE file distributed with this source code.
+ */
+declare(strict_types=1);
+
+namespace Ibexa\Rest\Server\Input\Parser\Criterion;
+
+use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\IsContainer as IsContainerCriterion;
+use Ibexa\Contracts\Rest\Exceptions;
+use Ibexa\Contracts\Rest\Input\ParsingDispatcher;
+use Ibexa\Rest\Input\BaseParser;
+use Ibexa\Rest\Input\ParserTools;
+
+final class IsContainer extends BaseParser
+{
+ private ParserTools $parserTools;
+
+ public function __construct(ParserTools $parserTools)
+ {
+ $this->parserTools = $parserTools;
+ }
+
+ /**
+ * @param array<mixed> $data
+ */
+ public function parse(array $data, ParsingDispatcher $parsingDispatcher): IsContainerCriterion
+ {
+ if (!array_key_exists('IsContainerCriterion', $data)) {
+ throw new Exceptions\Parser('Invalid <IsContainer> format');
+ }
+
+ return new IsContainerCriterion($this->parserTools->parseBooleanValue($data['IsContainerCriterion']));
+ }
+}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/search/src/lib/Mapper/SearchHitToContentSuggestionMapper.php vendor-4.6.7/ibexa/search/src/lib/Mapper/SearchHitToContentSuggestionMapper.php
--- vendor-4.6.2/ibexa/search/src/lib/Mapper/SearchHitToContentSuggestionMapper.php 2024-07-02 10:19:17.777305970 +0200
+++ vendor-4.6.7/ibexa/search/src/lib/Mapper/SearchHitToContentSuggestionMapper.php 2024-07-02 10:23:18.240890645 +0200
@@ -17,6 +17,8 @@
final class SearchHitToContentSuggestionMapper implements SearchHitToContentSuggestionMapperInterface
{
+ private const ROOT_LOCATION_ID = 1;
+
private ConfigResolverInterface $configResolver;
private ParentLocationProviderInterface $parentLocationProvider;
@@ -51,6 +53,11 @@
$parentsLocation = array_slice($parentsLocation, (int)$position);
}
+ if (reset($parentsLocation) === self::ROOT_LOCATION_ID) {
+ // Remove "Top Level Nodes" from suggestion path
+ array_shift($parentsLocation);
+ }
+
$parentLocations = $this->parentLocationProvider->provide($parentsLocation);
return new ContentSuggestion(
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/solr/bin/generate-solr-config.sh vendor-4.6.7/ibexa/solr/bin/generate-solr-config.sh
--- vendor-4.6.2/ibexa/solr/bin/generate-solr-config.sh 2024-07-02 10:19:28.549332140 +0200
+++ vendor-4.6.7/ibexa/solr/bin/generate-solr-config.sh 2024-07-02 10:23:25.080907290 +0200
@@ -97,7 +97,7 @@
# If we were not provided an existing install directory we'll temporarily download a version of solr to generate config.
GENERATE_SOLR_TMPDIR=`mktemp -d`
echo "Downloading solr bundle:"
- curl http://archive.apache.org/dist/lucene/solr/${SOLR_VERSION}/solr-${SOLR_VERSION}.tgz > $GENERATE_SOLR_TMPDIR/solr-${SOLR_VERSION}.tgz
+ curl https://archive.apache.org/dist/lucene/solr/${SOLR_VERSION}/solr-${SOLR_VERSION}.tgz > $GENERATE_SOLR_TMPDIR/solr-${SOLR_VERSION}.tgz
echo "Untaring"
cd $GENERATE_SOLR_TMPDIR
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/solr/.github/init_solr.sh vendor-4.6.7/ibexa/solr/.github/init_solr.sh
--- vendor-4.6.2/ibexa/solr/.github/init_solr.sh 2024-07-02 10:19:28.549332140 +0200
+++ vendor-4.6.7/ibexa/solr/.github/init_solr.sh 2024-07-02 10:23:25.080907290 +0200
@@ -46,7 +46,7 @@
case ${SOLR_VERSION} in
# PS!!: Append versions and don't remove old ones (except in major versions), used in integration tests from other packages!
7.7.* | 8.* )
- url="http://archive.apache.org/dist/lucene/solr/${SOLR_VERSION}/solr-${SOLR_VERSION}.tgz"
+ url="https://archive.apache.org/dist/lucene/solr/${SOLR_VERSION}/solr-${SOLR_VERSION}.tgz"
;;
*)
echo "Version '${SOLR_VERSION}' is not supported or not valid"
@@ -296,5 +296,3 @@
solr_cloud_upload_collection_configuration
solr_cloud_create_collections
fi
-
-
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/solr/src/bundle/Resources/config/services.yml vendor-4.6.7/ibexa/solr/src/bundle/Resources/config/services.yml
--- vendor-4.6.2/ibexa/solr/src/bundle/Resources/config/services.yml 2024-07-02 10:19:28.549332140 +0200
+++ vendor-4.6.7/ibexa/solr/src/bundle/Resources/config/services.yml 2024-07-02 10:23:25.080907290 +0200
@@ -1,7 +1,7 @@
parameters:
ibexa.solr.default_connection: ~
- ibexa.solr.http_client.timeout: !php/const \EzSystems\EzPlatformSolrSearchEngineBundle\DependencyInjection\Configuration::SOLR_HTTP_CLIENT_DEFAULT_TIMEOUT
- ibexa.solr.http_client.max_retries: !php/const \EzSystems\EzPlatformSolrSearchEngineBundle\DependencyInjection\Configuration::SOLR_HTTP_CLIENT_DEFAULT_MAX_RETRIES
+ ibexa.solr.http_client.timeout: !php/const \Ibexa\Bundle\Solr\DependencyInjection\Configuration::SOLR_HTTP_CLIENT_DEFAULT_TIMEOUT
+ ibexa.solr.http_client.max_retries: !php/const \Ibexa\Bundle\Solr\DependencyInjection\Configuration::SOLR_HTTP_CLIENT_DEFAULT_MAX_RETRIES
services:
ibexa.solr.http_client.retryable:
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/solr/src/lib/FieldMapper/ContentFieldMapper/BlockDocumentsBaseContentFields.php vendor-4.6.7/ibexa/solr/src/lib/FieldMapper/ContentFieldMapper/BlockDocumentsBaseContentFields.php
--- vendor-4.6.2/ibexa/solr/src/lib/FieldMapper/ContentFieldMapper/BlockDocumentsBaseContentFields.php 2024-07-02 10:19:28.550332142 +0200
+++ vendor-4.6.7/ibexa/solr/src/lib/FieldMapper/ContentFieldMapper/BlockDocumentsBaseContentFields.php 2024-07-02 10:23:25.080907290 +0200
@@ -73,6 +73,7 @@
$ancestorLocationsContentIds[] = $contentInfo->ownerId;
$section = $this->sectionHandler->load($contentInfo->sectionId);
+ $contentType = $this->contentTypeHandler->load($contentInfo->contentTypeId);
return [
new Field(
@@ -173,10 +174,15 @@
),
new Field(
'content_type_group_ids',
- $this->contentTypeHandler->load($contentInfo->contentTypeId)->groupIds,
+ $contentType->groupIds,
new FieldType\MultipleIdentifierField()
),
new Field(
+ 'content_type_is_container',
+ $contentType->isContainer,
+ new FieldType\BooleanField()
+ ),
+ new Field(
'content_object_state_ids',
$this->getObjectStateIds($contentInfo->id),
new FieldType\MultipleIdentifierField()
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/solr/src/lib/FieldMapper/LocationFieldMapper/LocationDocumentBaseFields.php vendor-4.6.7/ibexa/solr/src/lib/FieldMapper/LocationFieldMapper/LocationDocumentBaseFields.php
--- vendor-4.6.2/ibexa/solr/src/lib/FieldMapper/LocationFieldMapper/LocationDocumentBaseFields.php 2024-07-02 10:19:28.550332142 +0200
+++ vendor-4.6.7/ibexa/solr/src/lib/FieldMapper/LocationFieldMapper/LocationDocumentBaseFields.php 2024-07-02 10:23:25.080907290 +0200
@@ -8,6 +8,7 @@
use Ibexa\Contracts\Core\Persistence\Content\Handler as ContentHandler;
use Ibexa\Contracts\Core\Persistence\Content\Location;
+use Ibexa\Contracts\Core\Persistence\Content\Type\Handler as ContentTypeHandler;
use Ibexa\Contracts\Core\Search\Field;
use Ibexa\Contracts\Core\Search\FieldType;
use Ibexa\Contracts\Solr\DocumentMapper;
@@ -23,9 +24,14 @@
*/
protected $contentHandler;
- public function __construct(ContentHandler $contentHandler)
- {
+ protected ContentTypeHandler $contentTypeHandler;
+
+ public function __construct(
+ ContentHandler $contentHandler,
+ ContentTypeHandler $contentTypeHandler
+ ) {
$this->contentHandler = $contentHandler;
+ $this->contentTypeHandler = $contentTypeHandler;
}
public function accept(Location $location)
@@ -36,6 +42,7 @@
public function mapFields(Location $location)
{
$contentInfo = $this->contentHandler->loadContentInfo($location->contentId);
+ $contentType = $this->contentTypeHandler->load($contentInfo->contentTypeId);
return [
new Field(
@@ -109,6 +116,11 @@
($location->id == $contentInfo->mainLocationId),
new FieldType\BooleanField()
),
+ new Field(
+ 'is_container',
+ $contentType->isContainer,
+ new FieldType\BooleanField()
+ ),
];
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/solr/src/lib/Gateway/HttpClient/Stream.php vendor-4.6.7/ibexa/solr/src/lib/Gateway/HttpClient/Stream.php
--- vendor-4.6.2/ibexa/solr/src/lib/Gateway/HttpClient/Stream.php 2024-07-02 10:19:28.550332142 +0200
+++ vendor-4.6.7/ibexa/solr/src/lib/Gateway/HttpClient/Stream.php 2024-07-02 10:23:25.080907290 +0200
@@ -18,7 +18,7 @@
/**
* Simple PHP stream based HTTP client.
*
- * @internal type-hint {@see \EzSystems\EzPlatformSolrSearchEngine\Gateway\HttpClient} instead.
+ * @internal type-hint {@see \Ibexa\Solr\Gateway\HttpClient} instead.
*/
class Stream implements HttpClient, LoggerAwareInterface
{
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/solr/src/lib/Query/Common/CriterionVisitor/BaseIsContainer.php vendor-4.6.7/ibexa/solr/src/lib/Query/Common/CriterionVisitor/BaseIsContainer.php
--- vendor-4.6.2/ibexa/solr/src/lib/Query/Common/CriterionVisitor/BaseIsContainer.php 1970-01-01 01:00:00.000000000 +0100
+++ vendor-4.6.7/ibexa/solr/src/lib/Query/Common/CriterionVisitor/BaseIsContainer.php 2024-07-02 10:23:25.081907292 +0200
@@ -0,0 +1,41 @@
+<?php
+
+/**
+ * @copyright Copyright (C) Ibexa AS. All rights reserved.
+ * @license For full copyright and license information view LICENSE file distributed with this source code.
+ */
+declare(strict_types=1);
+
+namespace Ibexa\Solr\Query\Common\CriterionVisitor;
+
+use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion;
+use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\Operator;
+use Ibexa\Contracts\Solr\Query\CriterionVisitor;
+
+/**
+ * @internal
+ */
+abstract class BaseIsContainer extends CriterionVisitor
+{
+ abstract protected function getTargetField(): string;
+
+ public function canVisit(Criterion $criterion): bool
+ {
+ return $criterion instanceof Criterion\IsContainer && $criterion->operator === Operator::EQ;
+ }
+
+ public function visit(Criterion $criterion, CriterionVisitor $subVisitor = null): string
+ {
+ $value = $criterion->value;
+
+ if (!is_array($value) || !is_bool($value[0])) {
+ throw new \LogicException(sprintf(
+ '%s value should be of type array<bool>, received %s.',
+ Criterion\IsContainer::class,
+ get_debug_type($value),
+ ));
+ }
+
+ return $this->getTargetField() . ':' . $this->toString($value[0]);
+ }
+}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/solr/src/lib/Query/Content/CriterionVisitor/IsContainer.php vendor-4.6.7/ibexa/solr/src/lib/Query/Content/CriterionVisitor/IsContainer.php
--- vendor-4.6.2/ibexa/solr/src/lib/Query/Content/CriterionVisitor/IsContainer.php 1970-01-01 01:00:00.000000000 +0100
+++ vendor-4.6.7/ibexa/solr/src/lib/Query/Content/CriterionVisitor/IsContainer.php 2024-07-02 10:23:25.081907292 +0200
@@ -0,0 +1,22 @@
+<?php
+
+/**
+ * @copyright Copyright (C) Ibexa AS. All rights reserved.
+ * @license For full copyright and license information view LICENSE file distributed with this source code.
+ */
+declare(strict_types=1);
+
+namespace Ibexa\Solr\Query\Content\CriterionVisitor;
+
+use Ibexa\Solr\Query\Common\CriterionVisitor\BaseIsContainer;
+
+/**
+ * @internal
+ */
+final class IsContainer extends BaseIsContainer
+{
+ public function getTargetField(): string
+ {
+ return 'content_type_is_container_b';
+ }
+}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/solr/src/lib/Query/Location/CriterionVisitor/IsContainer.php vendor-4.6.7/ibexa/solr/src/lib/Query/Location/CriterionVisitor/IsContainer.php
--- vendor-4.6.2/ibexa/solr/src/lib/Query/Location/CriterionVisitor/IsContainer.php 1970-01-01 01:00:00.000000000 +0100
+++ vendor-4.6.7/ibexa/solr/src/lib/Query/Location/CriterionVisitor/IsContainer.php 2024-07-02 10:23:25.081907292 +0200
@@ -0,0 +1,22 @@
+<?php
+
+/**
+ * @copyright Copyright (C) Ibexa AS. All rights reserved.
+ * @license For full copyright and license information view LICENSE file distributed with this source code.
+ */
+declare(strict_types=1);
+
+namespace Ibexa\Solr\Query\Location\CriterionVisitor;
+
+use Ibexa\Solr\Query\Common\CriterionVisitor\BaseIsContainer;
+
+/**
+ * @internal
+ */
+final class IsContainer extends BaseIsContainer
+{
+ public function getTargetField(): string
+ {
+ return 'is_container_b';
+ }
+}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/solr/src/lib/Resources/config/container/solr/criterion_visitors.yml vendor-4.6.7/ibexa/solr/src/lib/Resources/config/container/solr/criterion_visitors.yml
--- vendor-4.6.2/ibexa/solr/src/lib/Resources/config/container/solr/criterion_visitors.yml 2024-07-02 10:19:28.550332142 +0200
+++ vendor-4.6.7/ibexa/solr/src/lib/Resources/config/container/solr/criterion_visitors.yml 2024-07-02 10:23:25.081907292 +0200
@@ -241,6 +241,10 @@
- {name: ibexa.search.solr.query.content.criterion.visitor}
- {name: ibexa.search.solr.query.location.criterion.visitor}
+ Ibexa\Solr\Query\Content\CriterionVisitor\IsContainer:
+ tags:
+ - { name: ibexa.search.solr.query.content.criterion.visitor }
+
# Location search
Ibexa\Solr\Query\Location\CriterionVisitor\Ancestor:
tags:
@@ -291,6 +295,10 @@
tags:
- {name: ibexa.search.solr.query.location.criterion.visitor}
+ Ibexa\Solr\Query\Location\CriterionVisitor\IsContainer:
+ tags:
+ - { name: ibexa.search.solr.query.location.criterion.visitor }
+
Ibexa\Solr\Query\Location\CriterionVisitor\Factory\LocationFullTextFactory:
parent: Ibexa\Solr\Query\Common\CriterionVisitor\Factory\FullTextFactoryAbstract
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/solr/src/lib/Resources/config/container/solr/field_mappers.yml vendor-4.6.7/ibexa/solr/src/lib/Resources/config/container/solr/field_mappers.yml
--- vendor-4.6.2/ibexa/solr/src/lib/Resources/config/container/solr/field_mappers.yml 2024-07-02 10:19:28.550332142 +0200
+++ vendor-4.6.7/ibexa/solr/src/lib/Resources/config/container/solr/field_mappers.yml 2024-07-02 10:23:25.081907292 +0200
@@ -58,6 +58,7 @@
Ibexa\Solr\FieldMapper\LocationFieldMapper\LocationDocumentBaseFields:
arguments:
- '@Ibexa\Contracts\Core\Persistence\Content\Handler'
+ - '@Ibexa\Contracts\Core\Persistence\Content\Type\Handler'
tags:
- {name: ibexa.search.solr.field.mapper.location}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/user/src/lib/Strategy/DefaultThumbnailStrategy.php vendor-4.6.7/ibexa/user/src/lib/Strategy/DefaultThumbnailStrategy.php
--- vendor-4.6.2/ibexa/user/src/lib/Strategy/DefaultThumbnailStrategy.php 2024-07-02 10:19:17.668305705 +0200
+++ vendor-4.6.7/ibexa/user/src/lib/Strategy/DefaultThumbnailStrategy.php 2024-07-02 10:23:18.202890552 +0200
@@ -57,8 +57,8 @@
foreach ($this->initialsFieldDefIdentifiers as $identifier) {
/** @var \Ibexa\Contracts\Core\Repository\Values\Content\Field $field */
foreach ($fields as $field) {
- if ($field->fieldDefIdentifier === $identifier) {
- $initials .= substr((string)$field->value, 0, 1);
+ if ($field->getFieldDefinitionIdentifier() === $identifier) {
+ $initials .= substr((string)$field->getValue(), 0, 1);
}
}
}
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/user/src/lib/UserSetting/UserSetting.php vendor-4.6.7/ibexa/user/src/lib/UserSetting/UserSetting.php
--- vendor-4.6.2/ibexa/user/src/lib/UserSetting/UserSetting.php 2024-07-02 10:19:17.668305705 +0200
+++ vendor-4.6.7/ibexa/user/src/lib/UserSetting/UserSetting.php 2024-07-02 10:23:18.202890552 +0200
@@ -11,10 +11,10 @@
use Ibexa\Contracts\Core\Repository\Values\ValueObject;
/**
- * @property string $identifier
- * @property string $name
- * @property string $description
- * @property string $value
+ * @property string $identifier @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see UserSetting::getIdentifier()} instead.
+ * @property string $name @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see UserSetting::getName()} instead.
+ * @property string $description @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see UserSetting::getDescription()} instead.
+ * @property string $value @deprecated 4.6.7 accessing magic getter is deprecated and will be removed in 5.0.0. Use {@see UserSetting::getValue()} instead.
*/
class UserSetting extends ValueObject
{
@@ -29,6 +29,26 @@
/** @var string */
protected $value;
+
+ public function getIdentifier(): string
+ {
+ return $this->identifier;
+ }
+
+ public function getName(): string
+ {
+ return $this->name;
+ }
+
+ public function getDescription(): string
+ {
+ return $this->description;
+ }
+
+ public function getValue(): string
+ {
+ return $this->value;
+ }
}
class_alias(UserSetting::class, 'EzSystems\EzPlatformUser\UserSetting\UserSetting');
diff '--color=auto' -ruNa vendor-4.6.2/ibexa/user/src/lib/UserSetting/ValueDefinitionGroupRegistryEntry.php vendor-4.6.7/ibexa/user/src/lib/UserSetting/ValueDefinitionGroupRegistryEntry.php
--- vendor-4.6.2/ibexa/user/src/lib/UserSetting/ValueDefinitionGroupRegistryEntry.php 2024-07-02 10:19:17.668305705 +0200
+++ vendor-4.6.7/ibexa/user/src/lib/UserSetting/ValueDefinitionGroupRegistryEntry.php 2024-07-02 10:23:18.202890552 +0200
@@ -8,8 +8,10 @@
namespace Ibexa\User\UserSetting;
+use ArrayIterator;
use Ibexa\Contracts\User\UserSetting\ValueDefinitionGroupInterface;
use Ibexa\Contracts\User\UserSetting\ValueDefinitionInterface;
+use Traversable;
/**
* @internal
@@ -41,8 +43,8 @@
return $this->definition;
}
- public function getIterator()
+ public function getIterator(): Traversable
{
- return new \ArrayIterator($this->valueDefinitions);
+ return new ArrayIterator($this->valueDefinitions);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment