Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Cast contentId and locationId command arguments to integer #2582

Merged
merged 2 commits into from
Dec 17, 2024

Conversation

adriendupuis
Copy link
Contributor

@adriendupuis adriendupuis commented Dec 16, 2024

Question Answer
JIRA Ticket N/A
Versions 4.6, master
Edition All

Fix PHP Fatal error: Uncaught TypeError: Ibexa\Core\Repository\SiteAccessAware\LocationService::loadLocation(): Argument #1 ($locationId) must be of type int, string given, called in /var/www/html/src/Command/BrowseLocationsCommand.php on line 45 and defined in /var/www/html/vendor/ibexa/core/src/lib/Repository/SiteAccessAware/LocationService.php:53

I didn't test the others but casting every 'contentId' or 'locationId' to int is probably a good habit.

Checklist

  • Text renders correctly
  • Text has been checked with vale
  • Description metadata is up to date
  • Redirects cover removed/moved pages
  • Code samples are working
  • PHP code samples have been fixed with PHP CS fixer
  • Added link to this PR in relevant JIRA ticket or code PR

PHP Fatal error:  Uncaught TypeError: Ibexa\Core\Repository\SiteAccessAware\LocationService::loadLocation(): Argument #1 ($locationId) must be of type int, string given, called in /var/www/html/src/Command/BrowseLocationsCommand.php on line 45 and defined in /var/www/html/vendor/ibexa/core/src/lib/Repository/SiteAccessAware/LocationService.php:53
@@ -40,7 +40,7 @@ private function browseLocation(Location $location, OutputInterface $output, int

protected function execute(InputInterface $input, OutputInterface $output): int
{
$locationId = $input->getArgument('locationId');
$locationId = (int) $input->getArgument('locationId');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mnocon Why PHPStan didn't see an issue here?

https://github.com/symfony/symfony/blob/5.4/src/Symfony/Component/Console/Input/InputInterface.php#L83-L90 declares returning mixed but in fact it's probably only int|array.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one would be detected using level 9:
https://phpstan.org/user-guide/rule-levels

Bumping it results in:

  Line   api/public_php_api/src/Command/BrowseLocationsCommand.php                                                                     
 ------ ------------------------------------------------------------------------------------------------------------------------------ 
  :45    Parameter #1 $locationId of method Ibexa\Contracts\Core\Repository\LocationService::loadLocation() expects int, mixed given.  
 ------ ------------------------------------------------------------------------------------------------------------------------------ 

(and another 147 errors)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can think if we want to introduce this (level 10 is the highest right now), in product code we use level 8

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mnocon I don't fix 147 errors here 😛. I would say that we don't need it in CI. I'm curious about those level 9 new errors. But there is already a hundred to check in the actual level 8 phpstan-baseline.neon 😅

Copy link

code_samples/ change report

Before (on target branch)After (in current PR)

code_samples/api/public_php_api/src/Command/AddLocationToContentCommand.php

docs/content_management/content_api/managing_content.md@24:``` php
docs/content_management/content_api/managing_content.md@25:[[= include_file('code_samples/api/public_php_api/src/Command/AddLocationToContentCommand.php', 50, 51) =]]
docs/content_management/content_api/managing_content.md@26:[[= include_file('code_samples/api/public_php_api/src/Command/AddLocationToContentCommand.php', 55, 57) =]]
docs/content_management/content_api/managing_content.md@27:```

001⫶ $locationCreateStruct = $this->locationService->newLocationCreateStruct($parentLocationId);
002⫶
003⫶ $contentInfo = $this->contentService->loadContentInfo($contentId);
004⫶ $newLocation = $this->locationService->createLocation($contentInfo, $locationCreateStruct);

docs/content_management/content_api/managing_content.md@34:``` php
docs/content_management/content_api/managing_content.md@35:[[= include_file('code_samples/api/public_php_api/src/Command/AddLocationToContentCommand.php', 52, 54) =]]
docs/content_management/content_api/managing_content.md@36:```

001⫶ $locationCreateStruct->priority = 500;
002⫶ $locationCreateStruct->hidden = true;


code_samples/api/public_php_api/src/Command/BookmarkCommand.php

docs/content_management/content_management_api/bookmark_api.md@15:``` php
docs/content_management/content_management_api/bookmark_api.md@16:[[= include_file('code_samples/api/public_php_api/src/Command/BookmarkCommand.php', 43, 50) =]]
docs/content_management/content_management_api/bookmark_api.md@17:```

001⫶ $bookmarkList = $this->bookmarkService->loadBookmarks();
002⫶
003⫶ $output->writeln('Total bookmarks: ' . $bookmarkList->totalCount);
004⫶
005⫶ foreach ($bookmarkList->items as $bookmark) {
006⫶ $output->writeln($bookmark->getContentInfo()->name);
007⫶ }

docs/content_management/content_management_api/bookmark_api.md@21:``` php
docs/content_management/content_management_api/bookmark_api.md@22:[[= include_file('code_samples/api/public_php_api/src/Command/BookmarkCommand.php', 37, 40) =]]
docs/content_management/content_management_api/bookmark_api.md@23:```

001⫶ $location = $this->locationService->loadLocation($locationId);
002⫶
003⫶ $this->bookmarkService->createBookmark($location);

docs/content_management/content_management_api/bookmark_api.md@27:``` php
docs/content_management/content_management_api/bookmark_api.md@28:[[= include_file('code_samples/api/public_php_api/src/Command/BookmarkCommand.php', 52, 53) =]]
docs/content_management/content_management_api/bookmark_api.md@29:```

001⫶ $this->bookmarkService->deleteBookmark($location);


code_samples/api/public_php_api/src/Command/BrowseLocationsCommand.php

docs/content_management/content_api/browsing_content.md@184:``` php hl_lines="5 15"
docs/content_management/content_api/browsing_content.md@185:[[= include_file('code_samples/api/public_php_api/src/Command/BrowseLocationsCommand.php', 30, 49) =]]
docs/content_management/content_api/browsing_content.md@186:```

001⫶ private function browseLocation(Location $location, OutputInterface $output, int $depth = 0): void
002⫶ {
003⫶ $output->writeln($location->contentInfo->name);
004⫶
005⫸ $children = $this->locationService->loadLocationChildren($location);
006⫶ foreach ($children->locations as $child) {
007⫶ $this->browseLocation($child, $output, $depth + 1);
008⫶ }
009⫶ }
010⫶
011⫶ protected function execute(InputInterface $input, OutputInterface $output): int
012⫶ {

code_samples/api/public_php_api/src/Command/AddLocationToContentCommand.php

docs/content_management/content_api/managing_content.md@24:``` php
docs/content_management/content_api/managing_content.md@25:[[= include_file('code_samples/api/public_php_api/src/Command/AddLocationToContentCommand.php', 50, 51) =]]
docs/content_management/content_api/managing_content.md@26:[[= include_file('code_samples/api/public_php_api/src/Command/AddLocationToContentCommand.php', 55, 57) =]]
docs/content_management/content_api/managing_content.md@27:```

001⫶ $locationCreateStruct = $this->locationService->newLocationCreateStruct($parentLocationId);
002⫶
003⫶ $contentInfo = $this->contentService->loadContentInfo($contentId);
004⫶ $newLocation = $this->locationService->createLocation($contentInfo, $locationCreateStruct);

docs/content_management/content_api/managing_content.md@34:``` php
docs/content_management/content_api/managing_content.md@35:[[= include_file('code_samples/api/public_php_api/src/Command/AddLocationToContentCommand.php', 52, 54) =]]
docs/content_management/content_api/managing_content.md@36:```

001⫶ $locationCreateStruct->priority = 500;
002⫶ $locationCreateStruct->hidden = true;


code_samples/api/public_php_api/src/Command/BookmarkCommand.php

docs/content_management/content_management_api/bookmark_api.md@15:``` php
docs/content_management/content_management_api/bookmark_api.md@16:[[= include_file('code_samples/api/public_php_api/src/Command/BookmarkCommand.php', 43, 50) =]]
docs/content_management/content_management_api/bookmark_api.md@17:```

001⫶ $bookmarkList = $this->bookmarkService->loadBookmarks();
002⫶
003⫶ $output->writeln('Total bookmarks: ' . $bookmarkList->totalCount);
004⫶
005⫶ foreach ($bookmarkList->items as $bookmark) {
006⫶ $output->writeln($bookmark->getContentInfo()->name);
007⫶ }

docs/content_management/content_management_api/bookmark_api.md@21:``` php
docs/content_management/content_management_api/bookmark_api.md@22:[[= include_file('code_samples/api/public_php_api/src/Command/BookmarkCommand.php', 37, 40) =]]
docs/content_management/content_management_api/bookmark_api.md@23:```

001⫶ $location = $this->locationService->loadLocation($locationId);
002⫶
003⫶ $this->bookmarkService->createBookmark($location);

docs/content_management/content_management_api/bookmark_api.md@27:``` php
docs/content_management/content_management_api/bookmark_api.md@28:[[= include_file('code_samples/api/public_php_api/src/Command/BookmarkCommand.php', 52, 53) =]]
docs/content_management/content_management_api/bookmark_api.md@29:```

001⫶ $this->bookmarkService->deleteBookmark($location);


code_samples/api/public_php_api/src/Command/BrowseLocationsCommand.php

docs/content_management/content_api/browsing_content.md@184:``` php hl_lines="5 15"
docs/content_management/content_api/browsing_content.md@185:[[= include_file('code_samples/api/public_php_api/src/Command/BrowseLocationsCommand.php', 30, 49) =]]
docs/content_management/content_api/browsing_content.md@186:```

001⫶ private function browseLocation(Location $location, OutputInterface $output, int $depth = 0): void
002⫶ {
003⫶ $output->writeln($location->contentInfo->name);
004⫶
005⫸ $children = $this->locationService->loadLocationChildren($location);
006⫶ foreach ($children->locations as $child) {
007⫶ $this->browseLocation($child, $output, $depth + 1);
008⫶ }
009⫶ }
010⫶
011⫶ protected function execute(InputInterface $input, OutputInterface $output): int
012⫶ {
013⫶        $locationId = $input->getArgument('locationId');
013⫶        $locationId = (int) $input->getArgument('locationId');
014⫶
015⫸ $location = $this->locationService->loadLocation($locationId);
016⫶ $this->browseLocation($location, $output);
017⫶
018⫶ return self::SUCCESS;
019⫶ }


code_samples/api/public_php_api/src/Command/CreateContentCommand.php

docs/api/php_api/php_api.md@128:``` php
docs/api/php_api/php_api.md@129:[[= include_file('code_samples/api/public_php_api/src/Command/CreateContentCommand.php', 50, 52) =]]
docs/api/php_api/php_api.md@130:```

001⫶ $user = $this->userService->loadUserByLogin('admin');
002⫶ $this->permissionResolver->setCurrentUserReference($user);

docs/content_management/content_api/creating_content.md@23:``` php hl_lines="2-3 5"
docs/content_management/content_api/creating_content.md@24:[[= include_file('code_samples/api/public_php_api/src/Command/CreateContentCommand.php', 57, 66) =]]
docs/content_management/content_api/creating_content.md@25:```

001⫶ $contentType = $this->contentTypeService->loadContentTypeByIdentifier($contentTypeIdentifier);
002⫸ $contentCreateStruct = $this->contentService->newContentCreateStruct($contentType, 'eng-GB');
003⫸ $contentCreateStruct->setField('name', $name);
004⫶
005⫸ $locationCreateStruct = $this->locationService->newLocationCreateStruct($parentLocationId);
006⫶
007⫶ $draft = $this->contentService->createContent($contentCreateStruct, [$locationCreateStruct]);
008⫶
009⫶ $output->writeln('Created a draft of ' . $contentType->getName() . ' with name ' . $draft->getName());

docs/content_management/content_api/creating_content.md@68:``` php
docs/content_management/content_api/creating_content.md@69:[[= include_file('code_samples/api/public_php_api/src/Command/CreateContentCommand.php', 68, 69) =]]
docs/content_management/content_api/creating_content.md@70:```

001⫶ $content = $this->contentService->publishVersion($draft->versionInfo);


code_samples/api/public_php_api/src/Command/DeleteContentCommand.php

docs/content_management/content_api/managing_content.md@68:``` php
docs/content_management/content_api/managing_content.md@69:[[= include_file('code_samples/api/public_php_api/src/Command/DeleteContentCommand.php', 44, 45) =]]
docs/content_management/content_api/managing_content.md@70:```

001⫶ $this->locationService->deleteLocation($location);


code_samples/api/public_php_api/src/Command/FindComplexCommand.php

docs/search/search_api.md@242:``` php
docs/search/search_api.md@243:[[= include_file('code_samples/api/public_php_api/src/Command/FindComplexCommand.php', 43, 49) =]][[= include_file('code_samples/api/public_php_api/src/Command/FindComplexCommand.php', 53, 54) =]]
docs/search/search_api.md@244:[[= include_file('code_samples/api/public_php_api/src/Command/FindComplexCommand.php', 60, 65) =]]
docs/search/search_api.md@245:```

001⫶ $query = new LocationQuery();
002⫶
003⫶ $query->query = new Criterion\LogicalAnd([
004⫶ new Criterion\Subtree($this->locationService->loadLocation($locationId)->pathString),
005⫶ new Criterion\ContentTypeIdentifier($contentTypeIdentifier),
006⫶ ]);
007⫶
008⫶ $result = $this->searchService->findContentInfo($query);
009⫶ $output->writeln('Found ' . $result->totalCount . ' items');
010⫶ foreach ($result->searchHits as $searchHit) {
011⫶ $output->writeln($searchHit->valueObject->name);
012⫶ }

docs/search/search_api.md@257:``` php
docs/search/search_api.md@258:[[= include_file('code_samples/api/public_php_api/src/Command/FindComplexCommand.php', 45, 46) =]][[= include_file('code_samples/api/public_php_api/src/Command/FindComplexCommand.php', 48, 53) =]]
docs/search/search_api.md@259:```

001⫶ new Criterion\ContentTypeIdentifier($contentTypeIdentifier),
002⫶ new Criterion\FullText($text),
003⫶ new Criterion\LogicalNot(
004⫶ new Criterion\SectionIdentifier('Media')
005⫶ ),

docs/search/search_api.md@290:``` php
docs/search/search_api.md@291:[[= include_file('code_samples/api/public_php_api/src/Command/FindComplexCommand.php', 55, 59) =]]
docs/search/search_api.md@292:```

001⫶ $query->sortClauses = [
002⫶ new SortClause\DatePublished(LocationQuery::SORT_ASC),
003⫶ new SortClause\ContentName(LocationQuery::SORT_DESC),
004⫶ ];


code_samples/api/public_php_api/src/Command/FindInTrashCommand.php

docs/search/search_api.md@309:``` php
docs/search/search_api.md@310:[[= include_file('code_samples/api/public_php_api/src/Command/FindInTrashCommand.php', 34, 41) =]]
docs/search/search_api.md@311:```

001⫶ $query = new Query();
002⫶
003⫶ $query->filter = new Query\Criterion\ContentTypeId($contentTypeId);
004⫶ $results = $this->trashService->findTrashItems($query);
005⫶ foreach ($results->items as $trashedLocation) {
006⫶ $output->writeln($trashedLocation->getContentInfo()->name);
007⫶ }


code_samples/api/public_php_api/src/Command/HideLocationCommand.php

docs/content_management/content_api/managing_content.md@51:``` php
docs/content_management/content_api/managing_content.md@52:[[= include_file('code_samples/api/public_php_api/src/Command/HideLocationCommand.php', 46, 47) =]][[= include_file('code_samples/api/public_php_api/src/Command/HideLocationCommand.php', 49, 50) =]]
docs/content_management/content_api/managing_content.md@53:```

001⫶ $this->locationService->hideLocation($location);
002⫶ $this->locationService->unhideLocation($location);


code_samples/api/public_php_api/src/Command/MoveContentCommand.php

docs/content_management/content_api/managing_content.md@83:``` php
docs/content_management/content_api/managing_content.md@84:[[= include_file('code_samples/api/public_php_api/src/Command/MoveContentCommand.php', 46, 49) =]]
docs/content_management/content_api/managing_content.md@85:```

001⫶ $sourceLocation = $this->locationService->loadLocation($locationId);
002⫶ $targetLocation = $this->locationService->loadLocation($targetLocationId);
003⫶ $this->locationService->moveSubtree($sourceLocation, $targetLocation);


code_samples/api/public_php_api/src/Command/ObjectStateCommand.php

docs/content_management/content_management_api/object_state_api.md@20:``` php
docs/content_management/content_management_api/object_state_api.md@21:[[= include_file('code_samples/api/public_php_api/src/Command/ObjectStateCommand.php', 48, 53) =]]
docs/content_management/content_management_api/object_state_api.md@22:```

001⫶ $objectStateGroup = $this->objectStateService->loadObjectStateGroupByIdentifier('ez_lock');
002⫶ $objectState = $this->objectStateService->loadObjectStateByIdentifier($objectStateGroup, 'locked');
003⫶
004⫶ $output->writeln($objectStateGroup->getName());
005⫶ $output->writeln($objectState->getName());

docs/content_management/content_management_api/object_state_api.md@28:``` php
docs/content_management/content_management_api/object_state_api.md@29:[[= include_file('code_samples/api/public_php_api/src/Command/ObjectStateCommand.php', 57, 61) =]]
docs/content_management/content_management_api/object_state_api.md@30:```

001⫶ $objectStateGroupStruct = $this->objectStateService->newObjectStateGroupCreateStruct($objectStateGroupIdentifier);
002⫶ $objectStateGroupStruct->defaultLanguageCode = 'eng-GB';
003⫶ $objectStateGroupStruct->names = ['eng-GB' => $objectStateGroupIdentifier];
004⫶ $newObjectStateGroup = $this->objectStateService->createObjectStateGroup($objectStateGroupStruct);

docs/content_management/content_management_api/object_state_api.md@36:``` php
docs/content_management/content_management_api/object_state_api.md@37:[[= include_file('code_samples/api/public_php_api/src/Command/ObjectStateCommand.php', 63, 67) =]]
docs/content_management/content_management_api/object_state_api.md@38:```

001⫶ $stateStruct = $this->objectStateService->newObjectStateCreateStruct($objectStateIdentifier);
002⫶ $stateStruct->defaultLanguageCode = 'eng-GB';
003⫶ $stateStruct->names = ['eng-GB' => $objectStateIdentifier];
004⫶ $this->objectStateService->createObjectState($newObjectStateGroup, $stateStruct);

docs/content_management/content_management_api/object_state_api.md@45:``` php
docs/content_management/content_management_api/object_state_api.md@46:[[= include_file('code_samples/api/public_php_api/src/Command/ObjectStateCommand.php', 77, 82) =]]
docs/content_management/content_management_api/object_state_api.md@47:```

001⫶ $contentInfo = $this->contentService->loadContentInfo($contentId);
002⫶ $objectStateGroup = $this->objectStateService->loadObjectStateGroupByIdentifier($objectStateGroupIdentifier);
003⫶ $objectState = $this->objectStateService->loadObjectStateByIdentifier($objectStateGroup, $objectStateToAssign);
004⫶
005⫶ $this->objectStateService->setContentState($contentInfo, $objectStateGroup, $objectState);


code_samples/api/public_php_api/src/Command/SectionCommand.php

docs/content_management/content_management_api/section_api.md@19:``` php
docs/content_management/content_management_api/section_api.md@20:[[= include_file('code_samples/api/public_php_api/src/Command/SectionCommand.php', 58, 62) =]]
docs/content_management/content_management_api/section_api.md@21:```

001⫶ $sectionCreateStruct = $this->sectionService->newSectionCreateStruct();
002⫶ $sectionCreateStruct->name = $sectionName;
003⫶ $sectionCreateStruct->identifier = $sectionIdentifier;
004⫶ $this->sectionService->createSection($sectionCreateStruct);

docs/content_management/content_management_api/section_api.md@27:``` php
docs/content_management/content_management_api/section_api.md@28:[[= include_file('code_samples/api/public_php_api/src/Command/SectionCommand.php', 76, 81) =]]
docs/content_management/content_management_api/section_api.md@29:```

001⫶ $output->writeln((
002⫶ $this->sectionService->isSectionUsed($section)
003⫶ ? 'This section is in use.'
004⫶ : 'This section is not in use.'
005⫶ ));

docs/content_management/content_management_api/section_api.md@36:``` php
docs/content_management/content_management_api/section_api.md@37:[[= include_file('code_samples/api/public_php_api/src/Command/SectionCommand.php', 69, 75) =]][[= include_file('code_samples/api/public_php_api/src/Command/SectionCommand.php', 82, 86) =]]
docs/content_management/content_management_api/section_api.md@38:```

001⫶ $query = new LocationQuery();
002⫶ $query->filter = new Criterion\SectionId([
003⫶ $section->id,
004⫶ ]);
005⫶
006⫶ $result = $this->searchService->findContentInfo($query);
007⫶
008⫶ foreach ($result->searchHits as $searchResult) {
009⫶ $output->writeln('* ' . $searchResult->valueObject->name);
010⫶ }

docs/content_management/content_management_api/section_api.md@45:``` php
docs/content_management/content_management_api/section_api.md@46:[[= include_file('code_samples/api/public_php_api/src/Command/SectionCommand.php', 64, 67) =]]
docs/content_management/content_management_api/section_api.md@47:```

001⫶ $section = $this->sectionService->loadSectionByIdentifier($sectionIdentifier);
002⫶ $contentInfo = $this->contentService->loadContentInfo($contentId);
003⫶ $this->sectionService->assignSection($contentInfo, $section);


code_samples/api/public_php_api/src/Command/SetMainLocationCommand.php

docs/content_management/content_api/managing_content.md@43:``` php
docs/content_management/content_api/managing_content.md@44:[[= include_file('code_samples/api/public_php_api/src/Command/SetMainLocationCommand.php', 48, 52) =]]
docs/content_management/content_api/managing_content.md@45:```

001⫶ $contentUpdateStruct = $this->contentService->newContentMetadataUpdateStruct();
002⫶ $contentUpdateStruct->mainLocationId = $locationId;
003⫶
004⫶ $this->contentService->updateContentMetadata($contentInfo, $contentUpdateStruct);


code_samples/api/public_php_api/src/Command/TranslateContentCommand.php

docs/content_management/content_api/creating_content.md@88:``` php
docs/content_management/content_api/creating_content.md@89:[[= include_file('code_samples/api/public_php_api/src/Command/TranslateContentCommand.php', 52, 57) =]]
docs/content_management/content_api/creating_content.md@90:[[= include_file('code_samples/api/public_php_api/src/Command/TranslateContentCommand.php', 62, 64) =]]
docs/content_management/content_api/creating_content.md@91:```

001⫶ $contentDraft = $this->contentService->createContentDraft($contentInfo);
002⫶
003⫶ $contentUpdateStruct = $this->contentService->newContentUpdateStruct();
004⫶ $contentUpdateStruct->initialLanguageCode = $language;
005⫶ $contentUpdateStruct->setField('name', $newName);
006⫶
007⫶ $contentDraft = $this->contentService->updateContent($contentDraft->versionInfo, $contentUpdateStruct);
008⫶ $this->contentService->publishVersion($contentDraft->versionInfo);

docs/content_management/content_api/creating_content.md@96:``` php
docs/content_management/content_api/creating_content.md@97:[[= include_file('code_samples/api/public_php_api/src/Command/TranslateContentCommand.php', 59, 60) =]]
docs/content_management/content_api/creating_content.md@98:```

001⫶ $contentUpdateStruct->setField('name', $nameInSecondaryLanguage, $secondaryLanguage);


code_samples/api/public_php_api/src/Command/TrashContentCommand.php

docs/content_management/content_api/managing_content.md@75:``` php
docs/content_management/content_api/managing_content.md@76:[[= include_file('code_samples/api/public_php_api/src/Command/TrashContentCommand.php', 54, 55) =]]
docs/content_management/content_api/managing_content.md@77:```

001⫶ $this->trashService->trash($location);

docs/content_management/content_api/managing_content.md@110:``` php
docs/content_management/content_api/managing_content.md@111:[[= include_file('code_samples/api/public_php_api/src/Command/TrashContentCommand.php', 64, 65) =]]
docs/content_management/content_api/managing_content.md@112:```

001⫶ $this->trashService->recover($trashItem, $newParent);


code_samples/api/public_php_api/src/Command/UpdateContentCommand.php

docs/content_management/content_api/creating_content.md@78:``` php
docs/content_management/content_api/creating_content.md@79:[[= include_file('code_samples/api/public_php_api/src/Command/UpdateContentCommand.php', 47, 55) =]]
docs/content_management/content_api/creating_content.md@80:```

001⫶ $contentDraft = $this->contentService->createContentDraft($contentInfo);
002⫶
003⫶ $contentUpdateStruct = $this->contentService->newContentUpdateStruct();
004⫶ $contentUpdateStruct->initialLanguageCode = 'eng-GB';
005⫶ $contentUpdateStruct->setField('name', $newName);
006⫶
007⫶ $contentDraft = $this->contentService->updateContent($contentDraft->versionInfo, $contentUpdateStruct);
008⫶ $this->contentService->publishVersion($contentDraft->versionInfo);


code_samples/api/public_php_api/src/Command/ViewContentCommand.php

docs/content_management/content_api/browsing_content.md@152:```php hl_lines="13-14 16-22"
docs/content_management/content_api/browsing_content.md@153:[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentCommand.php', 4, 7) =]] // ...
docs/content_management/content_api/browsing_content.md@154:[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentCommand.php', 37, 55) =]]
docs/content_management/content_api/browsing_content.md@155:}
docs/content_management/content_api/browsing_content.md@156:```

001⫶use Ibexa\Contracts\Core\Repository\ContentService;
002⫶use Ibexa\Contracts\Core\Repository\ContentTypeService;
003⫶use Ibexa\Contracts\Core\Repository\FieldTypeService;
004⫶ // ...
005⫶ protected function execute(InputInterface $input, OutputInterface $output): int
006⫶ {
014⫶
015⫸ $location = $this->locationService->loadLocation($locationId);
016⫶ $this->browseLocation($location, $output);
017⫶
018⫶ return self::SUCCESS;
019⫶ }


code_samples/api/public_php_api/src/Command/CreateContentCommand.php

docs/api/php_api/php_api.md@128:``` php
docs/api/php_api/php_api.md@129:[[= include_file('code_samples/api/public_php_api/src/Command/CreateContentCommand.php', 50, 52) =]]
docs/api/php_api/php_api.md@130:```

001⫶ $user = $this->userService->loadUserByLogin('admin');
002⫶ $this->permissionResolver->setCurrentUserReference($user);

docs/content_management/content_api/creating_content.md@23:``` php hl_lines="2-3 5"
docs/content_management/content_api/creating_content.md@24:[[= include_file('code_samples/api/public_php_api/src/Command/CreateContentCommand.php', 57, 66) =]]
docs/content_management/content_api/creating_content.md@25:```

001⫶ $contentType = $this->contentTypeService->loadContentTypeByIdentifier($contentTypeIdentifier);
002⫸ $contentCreateStruct = $this->contentService->newContentCreateStruct($contentType, 'eng-GB');
003⫸ $contentCreateStruct->setField('name', $name);
004⫶
005⫸ $locationCreateStruct = $this->locationService->newLocationCreateStruct($parentLocationId);
006⫶
007⫶ $draft = $this->contentService->createContent($contentCreateStruct, [$locationCreateStruct]);
008⫶
009⫶ $output->writeln('Created a draft of ' . $contentType->getName() . ' with name ' . $draft->getName());

docs/content_management/content_api/creating_content.md@68:``` php
docs/content_management/content_api/creating_content.md@69:[[= include_file('code_samples/api/public_php_api/src/Command/CreateContentCommand.php', 68, 69) =]]
docs/content_management/content_api/creating_content.md@70:```

001⫶ $content = $this->contentService->publishVersion($draft->versionInfo);


code_samples/api/public_php_api/src/Command/DeleteContentCommand.php

docs/content_management/content_api/managing_content.md@68:``` php
docs/content_management/content_api/managing_content.md@69:[[= include_file('code_samples/api/public_php_api/src/Command/DeleteContentCommand.php', 44, 45) =]]
docs/content_management/content_api/managing_content.md@70:```

001⫶ $this->locationService->deleteLocation($location);


code_samples/api/public_php_api/src/Command/FindComplexCommand.php

docs/search/search_api.md@242:``` php
docs/search/search_api.md@243:[[= include_file('code_samples/api/public_php_api/src/Command/FindComplexCommand.php', 43, 49) =]][[= include_file('code_samples/api/public_php_api/src/Command/FindComplexCommand.php', 53, 54) =]]
docs/search/search_api.md@244:[[= include_file('code_samples/api/public_php_api/src/Command/FindComplexCommand.php', 60, 65) =]]
docs/search/search_api.md@245:```

001⫶ $query = new LocationQuery();
002⫶
003⫶ $query->query = new Criterion\LogicalAnd([
004⫶ new Criterion\Subtree($this->locationService->loadLocation($locationId)->pathString),
005⫶ new Criterion\ContentTypeIdentifier($contentTypeIdentifier),
006⫶ ]);
007⫶
008⫶ $result = $this->searchService->findContentInfo($query);
009⫶ $output->writeln('Found ' . $result->totalCount . ' items');
010⫶ foreach ($result->searchHits as $searchHit) {
011⫶ $output->writeln($searchHit->valueObject->name);
012⫶ }

docs/search/search_api.md@257:``` php
docs/search/search_api.md@258:[[= include_file('code_samples/api/public_php_api/src/Command/FindComplexCommand.php', 45, 46) =]][[= include_file('code_samples/api/public_php_api/src/Command/FindComplexCommand.php', 48, 53) =]]
docs/search/search_api.md@259:```

001⫶ new Criterion\ContentTypeIdentifier($contentTypeIdentifier),
002⫶ new Criterion\FullText($text),
003⫶ new Criterion\LogicalNot(
004⫶ new Criterion\SectionIdentifier('Media')
005⫶ ),

docs/search/search_api.md@290:``` php
docs/search/search_api.md@291:[[= include_file('code_samples/api/public_php_api/src/Command/FindComplexCommand.php', 55, 59) =]]
docs/search/search_api.md@292:```

001⫶ $query->sortClauses = [
002⫶ new SortClause\DatePublished(LocationQuery::SORT_ASC),
003⫶ new SortClause\ContentName(LocationQuery::SORT_DESC),
004⫶ ];


code_samples/api/public_php_api/src/Command/FindInTrashCommand.php

docs/search/search_api.md@309:``` php
docs/search/search_api.md@310:[[= include_file('code_samples/api/public_php_api/src/Command/FindInTrashCommand.php', 34, 41) =]]
docs/search/search_api.md@311:```

001⫶ $query = new Query();
002⫶
003⫶ $query->filter = new Query\Criterion\ContentTypeId($contentTypeId);
004⫶ $results = $this->trashService->findTrashItems($query);
005⫶ foreach ($results->items as $trashedLocation) {
006⫶ $output->writeln($trashedLocation->getContentInfo()->name);
007⫶ }


code_samples/api/public_php_api/src/Command/HideLocationCommand.php

docs/content_management/content_api/managing_content.md@51:``` php
docs/content_management/content_api/managing_content.md@52:[[= include_file('code_samples/api/public_php_api/src/Command/HideLocationCommand.php', 46, 47) =]][[= include_file('code_samples/api/public_php_api/src/Command/HideLocationCommand.php', 49, 50) =]]
docs/content_management/content_api/managing_content.md@53:```

001⫶ $this->locationService->hideLocation($location);
002⫶ $this->locationService->unhideLocation($location);


code_samples/api/public_php_api/src/Command/MoveContentCommand.php

docs/content_management/content_api/managing_content.md@83:``` php
docs/content_management/content_api/managing_content.md@84:[[= include_file('code_samples/api/public_php_api/src/Command/MoveContentCommand.php', 46, 49) =]]
docs/content_management/content_api/managing_content.md@85:```

001⫶ $sourceLocation = $this->locationService->loadLocation($locationId);
002⫶ $targetLocation = $this->locationService->loadLocation($targetLocationId);
003⫶ $this->locationService->moveSubtree($sourceLocation, $targetLocation);


code_samples/api/public_php_api/src/Command/ObjectStateCommand.php

docs/content_management/content_management_api/object_state_api.md@20:``` php
docs/content_management/content_management_api/object_state_api.md@21:[[= include_file('code_samples/api/public_php_api/src/Command/ObjectStateCommand.php', 48, 53) =]]
docs/content_management/content_management_api/object_state_api.md@22:```

001⫶ $objectStateGroup = $this->objectStateService->loadObjectStateGroupByIdentifier('ez_lock');
002⫶ $objectState = $this->objectStateService->loadObjectStateByIdentifier($objectStateGroup, 'locked');
003⫶
004⫶ $output->writeln($objectStateGroup->getName());
005⫶ $output->writeln($objectState->getName());

docs/content_management/content_management_api/object_state_api.md@28:``` php
docs/content_management/content_management_api/object_state_api.md@29:[[= include_file('code_samples/api/public_php_api/src/Command/ObjectStateCommand.php', 57, 61) =]]
docs/content_management/content_management_api/object_state_api.md@30:```

001⫶ $objectStateGroupStruct = $this->objectStateService->newObjectStateGroupCreateStruct($objectStateGroupIdentifier);
002⫶ $objectStateGroupStruct->defaultLanguageCode = 'eng-GB';
003⫶ $objectStateGroupStruct->names = ['eng-GB' => $objectStateGroupIdentifier];
004⫶ $newObjectStateGroup = $this->objectStateService->createObjectStateGroup($objectStateGroupStruct);

docs/content_management/content_management_api/object_state_api.md@36:``` php
docs/content_management/content_management_api/object_state_api.md@37:[[= include_file('code_samples/api/public_php_api/src/Command/ObjectStateCommand.php', 63, 67) =]]
docs/content_management/content_management_api/object_state_api.md@38:```

001⫶ $stateStruct = $this->objectStateService->newObjectStateCreateStruct($objectStateIdentifier);
002⫶ $stateStruct->defaultLanguageCode = 'eng-GB';
003⫶ $stateStruct->names = ['eng-GB' => $objectStateIdentifier];
004⫶ $this->objectStateService->createObjectState($newObjectStateGroup, $stateStruct);

docs/content_management/content_management_api/object_state_api.md@45:``` php
docs/content_management/content_management_api/object_state_api.md@46:[[= include_file('code_samples/api/public_php_api/src/Command/ObjectStateCommand.php', 77, 82) =]]
docs/content_management/content_management_api/object_state_api.md@47:```

001⫶ $contentInfo = $this->contentService->loadContentInfo($contentId);
002⫶ $objectStateGroup = $this->objectStateService->loadObjectStateGroupByIdentifier($objectStateGroupIdentifier);
003⫶ $objectState = $this->objectStateService->loadObjectStateByIdentifier($objectStateGroup, $objectStateToAssign);
004⫶
005⫶ $this->objectStateService->setContentState($contentInfo, $objectStateGroup, $objectState);


code_samples/api/public_php_api/src/Command/SectionCommand.php

docs/content_management/content_management_api/section_api.md@19:``` php
docs/content_management/content_management_api/section_api.md@20:[[= include_file('code_samples/api/public_php_api/src/Command/SectionCommand.php', 58, 62) =]]
docs/content_management/content_management_api/section_api.md@21:```

001⫶ $sectionCreateStruct = $this->sectionService->newSectionCreateStruct();
002⫶ $sectionCreateStruct->name = $sectionName;
003⫶ $sectionCreateStruct->identifier = $sectionIdentifier;
004⫶ $this->sectionService->createSection($sectionCreateStruct);

docs/content_management/content_management_api/section_api.md@27:``` php
docs/content_management/content_management_api/section_api.md@28:[[= include_file('code_samples/api/public_php_api/src/Command/SectionCommand.php', 76, 81) =]]
docs/content_management/content_management_api/section_api.md@29:```

001⫶ $output->writeln((
002⫶ $this->sectionService->isSectionUsed($section)
003⫶ ? 'This section is in use.'
004⫶ : 'This section is not in use.'
005⫶ ));

docs/content_management/content_management_api/section_api.md@36:``` php
docs/content_management/content_management_api/section_api.md@37:[[= include_file('code_samples/api/public_php_api/src/Command/SectionCommand.php', 69, 75) =]][[= include_file('code_samples/api/public_php_api/src/Command/SectionCommand.php', 82, 86) =]]
docs/content_management/content_management_api/section_api.md@38:```

001⫶ $query = new LocationQuery();
002⫶ $query->filter = new Criterion\SectionId([
003⫶ $section->id,
004⫶ ]);
005⫶
006⫶ $result = $this->searchService->findContentInfo($query);
007⫶
008⫶ foreach ($result->searchHits as $searchResult) {
009⫶ $output->writeln('* ' . $searchResult->valueObject->name);
010⫶ }

docs/content_management/content_management_api/section_api.md@45:``` php
docs/content_management/content_management_api/section_api.md@46:[[= include_file('code_samples/api/public_php_api/src/Command/SectionCommand.php', 64, 67) =]]
docs/content_management/content_management_api/section_api.md@47:```

001⫶ $section = $this->sectionService->loadSectionByIdentifier($sectionIdentifier);
002⫶ $contentInfo = $this->contentService->loadContentInfo($contentId);
003⫶ $this->sectionService->assignSection($contentInfo, $section);


code_samples/api/public_php_api/src/Command/SetMainLocationCommand.php

docs/content_management/content_api/managing_content.md@43:``` php
docs/content_management/content_api/managing_content.md@44:[[= include_file('code_samples/api/public_php_api/src/Command/SetMainLocationCommand.php', 48, 52) =]]
docs/content_management/content_api/managing_content.md@45:```

001⫶ $contentUpdateStruct = $this->contentService->newContentMetadataUpdateStruct();
002⫶ $contentUpdateStruct->mainLocationId = $locationId;
003⫶
004⫶ $this->contentService->updateContentMetadata($contentInfo, $contentUpdateStruct);


code_samples/api/public_php_api/src/Command/TranslateContentCommand.php

docs/content_management/content_api/creating_content.md@88:``` php
docs/content_management/content_api/creating_content.md@89:[[= include_file('code_samples/api/public_php_api/src/Command/TranslateContentCommand.php', 52, 57) =]]
docs/content_management/content_api/creating_content.md@90:[[= include_file('code_samples/api/public_php_api/src/Command/TranslateContentCommand.php', 62, 64) =]]
docs/content_management/content_api/creating_content.md@91:```

001⫶ $contentDraft = $this->contentService->createContentDraft($contentInfo);
002⫶
003⫶ $contentUpdateStruct = $this->contentService->newContentUpdateStruct();
004⫶ $contentUpdateStruct->initialLanguageCode = $language;
005⫶ $contentUpdateStruct->setField('name', $newName);
006⫶
007⫶ $contentDraft = $this->contentService->updateContent($contentDraft->versionInfo, $contentUpdateStruct);
008⫶ $this->contentService->publishVersion($contentDraft->versionInfo);

docs/content_management/content_api/creating_content.md@96:``` php
docs/content_management/content_api/creating_content.md@97:[[= include_file('code_samples/api/public_php_api/src/Command/TranslateContentCommand.php', 59, 60) =]]
docs/content_management/content_api/creating_content.md@98:```

001⫶ $contentUpdateStruct->setField('name', $nameInSecondaryLanguage, $secondaryLanguage);


code_samples/api/public_php_api/src/Command/TrashContentCommand.php

docs/content_management/content_api/managing_content.md@75:``` php
docs/content_management/content_api/managing_content.md@76:[[= include_file('code_samples/api/public_php_api/src/Command/TrashContentCommand.php', 54, 55) =]]
docs/content_management/content_api/managing_content.md@77:```

001⫶ $this->trashService->trash($location);

docs/content_management/content_api/managing_content.md@110:``` php
docs/content_management/content_api/managing_content.md@111:[[= include_file('code_samples/api/public_php_api/src/Command/TrashContentCommand.php', 64, 65) =]]
docs/content_management/content_api/managing_content.md@112:```

001⫶ $this->trashService->recover($trashItem, $newParent);


code_samples/api/public_php_api/src/Command/UpdateContentCommand.php

docs/content_management/content_api/creating_content.md@78:``` php
docs/content_management/content_api/creating_content.md@79:[[= include_file('code_samples/api/public_php_api/src/Command/UpdateContentCommand.php', 47, 55) =]]
docs/content_management/content_api/creating_content.md@80:```

001⫶ $contentDraft = $this->contentService->createContentDraft($contentInfo);
002⫶
003⫶ $contentUpdateStruct = $this->contentService->newContentUpdateStruct();
004⫶ $contentUpdateStruct->initialLanguageCode = 'eng-GB';
005⫶ $contentUpdateStruct->setField('name', $newName);
006⫶
007⫶ $contentDraft = $this->contentService->updateContent($contentDraft->versionInfo, $contentUpdateStruct);
008⫶ $this->contentService->publishVersion($contentDraft->versionInfo);


code_samples/api/public_php_api/src/Command/ViewContentCommand.php

docs/content_management/content_api/browsing_content.md@152:```php hl_lines="13-14 16-22"
docs/content_management/content_api/browsing_content.md@153:[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentCommand.php', 4, 7) =]] // ...
docs/content_management/content_api/browsing_content.md@154:[[= include_file('code_samples/api/public_php_api/src/Command/ViewContentCommand.php', 37, 55) =]]
docs/content_management/content_api/browsing_content.md@155:}
docs/content_management/content_api/browsing_content.md@156:```

001⫶use Ibexa\Contracts\Core\Repository\ContentService;
002⫶use Ibexa\Contracts\Core\Repository\ContentTypeService;
003⫶use Ibexa\Contracts\Core\Repository\FieldTypeService;
004⫶ // ...
005⫶ protected function execute(InputInterface $input, OutputInterface $output): int
006⫶ {
007⫶        $contentId = $input->getArgument('contentId');
007⫶        $contentId = (int) $input->getArgument('contentId');
008⫶
009⫶ $content = $this->contentService->loadContent($contentId);
010⫶ $contentType = $this->contentTypeService->loadContentType($content->contentInfo->contentTypeId);
011⫶
012⫶ foreach ($contentType->fieldDefinitions as $fieldDefinition) {
013⫸ $output->writeln('Field: ' . $fieldDefinition->identifier);
014⫸ $fieldType = $this->fieldTypeService->getFieldType($fieldDefinition->fieldTypeIdentifier);
015⫶ $field = $content->getFieldValue($fieldDefinition->identifier);
016⫸ $valueHash = $fieldType->toHash($field);
017⫸ $output->writeln('Value:');
018⫸ $output->writeln($valueHash);
019⫸ }
020⫸
021⫸ return self::SUCCESS;
022⫸ }
023⫶
024⫶}


code_samples/api/public_php_api/src/Command/WorkflowCommand.php

docs/content_management/workflow/workflow_api.md@27:``` php
docs/content_management/workflow/workflow_api.md@28:[[= include_file('code_samples/api/public_php_api/src/Command/WorkflowCommand.php', 53, 57) =]]
docs/content_management/workflow/workflow_api.md@29:```

001⫶ $workflowMetadata = $this->workflowService->loadWorkflowMetadataForContent($content, $workflowName);
002⫶
003⫶ foreach ($workflowMetadata->markings as $marking) {
004⫶ $output->writeln($content->getName() . ' is in stage ' . $marking->name . ' in workflow ' . $workflowMetadata->workflow->getName());

docs/content_management/workflow/workflow_api.md@38:``` php
docs/content_management/workflow/workflow_api.md@39:[[= include_file('code_samples/api/public_php_api/src/Command/WorkflowCommand.php', 47, 48) =]]
docs/content_management/workflow/workflow_api.md@40:```

001⫶ $supportedWorkflows = $this->workflowRegistry->getSupportedWorkflows($content);

docs/content_management/workflow/workflow_api.md@46:``` php
docs/content_management/workflow/workflow_api.md@47:[[= include_file('code_samples/api/public_php_api/src/Command/WorkflowCommand.php', 52, 53) =]]
docs/content_management/workflow/workflow_api.md@48:```

001⫶ $this->workflowService->start($content, $workflowName);

docs/content_management/workflow/workflow_api.md@53:``` php
docs/content_management/workflow/workflow_api.md@54:[[= include_file('code_samples/api/public_php_api/src/Command/WorkflowCommand.php', 59, 62) =]] }
docs/content_management/workflow/workflow_api.md@55:```

001⫶ if ($this->workflowService->can($workflowMetadata, $transitionName)) {
002⫶ $workflow = $this->workflowRegistry->getWorkflow($workflowName);
003⫶ $workflow->apply($workflowMetadata->content, $transitionName, ['message' => 'done', 'reviewerId' => 14]);
004⫶ }

008⫶
009⫶ $content = $this->contentService->loadContent($contentId);
010⫶ $contentType = $this->contentTypeService->loadContentType($content->contentInfo->contentTypeId);
011⫶
012⫶ foreach ($contentType->fieldDefinitions as $fieldDefinition) {
013⫸ $output->writeln('Field: ' . $fieldDefinition->identifier);
014⫸ $fieldType = $this->fieldTypeService->getFieldType($fieldDefinition->fieldTypeIdentifier);
015⫶ $field = $content->getFieldValue($fieldDefinition->identifier);
016⫸ $valueHash = $fieldType->toHash($field);
017⫸ $output->writeln('Value:');
018⫸ $output->writeln($valueHash);
019⫸ }
020⫸
021⫸ return self::SUCCESS;
022⫸ }
023⫶
024⫶}


code_samples/api/public_php_api/src/Command/WorkflowCommand.php

docs/content_management/workflow/workflow_api.md@27:``` php
docs/content_management/workflow/workflow_api.md@28:[[= include_file('code_samples/api/public_php_api/src/Command/WorkflowCommand.php', 53, 57) =]]
docs/content_management/workflow/workflow_api.md@29:```

001⫶ $workflowMetadata = $this->workflowService->loadWorkflowMetadataForContent($content, $workflowName);
002⫶
003⫶ foreach ($workflowMetadata->markings as $marking) {
004⫶ $output->writeln($content->getName() . ' is in stage ' . $marking->name . ' in workflow ' . $workflowMetadata->workflow->getName());

docs/content_management/workflow/workflow_api.md@38:``` php
docs/content_management/workflow/workflow_api.md@39:[[= include_file('code_samples/api/public_php_api/src/Command/WorkflowCommand.php', 47, 48) =]]
docs/content_management/workflow/workflow_api.md@40:```

001⫶ $supportedWorkflows = $this->workflowRegistry->getSupportedWorkflows($content);

docs/content_management/workflow/workflow_api.md@46:``` php
docs/content_management/workflow/workflow_api.md@47:[[= include_file('code_samples/api/public_php_api/src/Command/WorkflowCommand.php', 52, 53) =]]
docs/content_management/workflow/workflow_api.md@48:```

001⫶ $this->workflowService->start($content, $workflowName);

docs/content_management/workflow/workflow_api.md@53:``` php
docs/content_management/workflow/workflow_api.md@54:[[= include_file('code_samples/api/public_php_api/src/Command/WorkflowCommand.php', 59, 62) =]] }
docs/content_management/workflow/workflow_api.md@55:```

001⫶ if ($this->workflowService->can($workflowMetadata, $transitionName)) {
002⫶ $workflow = $this->workflowRegistry->getWorkflow($workflowName);
003⫶ $workflow->apply($workflowMetadata->content, $transitionName, ['message' => 'done', 'reviewerId' => 14]);
004⫶ }

Download colorized diff

@adriendupuis adriendupuis marked this pull request as ready for review December 17, 2024 09:41
@adriendupuis adriendupuis changed the title BrowseLocationsCommand.php: Cast locationId argument to integer Cast contentId and locationId command arguments to integer Dec 17, 2024
@adriendupuis adriendupuis merged commit 8a760dd into master Dec 17, 2024
6 checks passed
@adriendupuis adriendupuis deleted the fix-php-type branch December 17, 2024 09:58
adriendupuis added a commit that referenced this pull request Dec 17, 2024
* BrowseLocationsCommand.php: Cast locationId arg to int

PHP Fatal error:  Uncaught TypeError: Ibexa\Core\Repository\SiteAccessAware\LocationService::loadLocation(): Argument #1 ($locationId) must be of type int, string given, called in /var/www/html/src/Command/BrowseLocationsCommand.php on line 45 and defined in /var/www/html/vendor/ibexa/core/src/lib/Repository/SiteAccessAware/LocationService.php:53

* code_samples/: cast location and content ID arguments to int

(cherry picked from commit 8a760dd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants