Skip to content

Commit

Permalink
Merge pull request #381 from semseysandor/convert-entities
Browse files Browse the repository at this point in the history
upgrade/24.09.1, convert-entity: adds entity-types-php@2 mixin even the extension doesn't define new entities
  • Loading branch information
totten authored Jan 18, 2025
2 parents 351e988 + fc87235 commit 95b9357
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
11 changes: 9 additions & 2 deletions src/CRM/CivixBundle/Command/ConvertEntityCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
Civix::boot(['output' => $output]);
$this->assertCurrentFormat();

\Civix::io()->note("Finding entities");
\Civix::io()->note('Finding legacy xml entities');

$isCore = $input->getOption('core-style');

Expand All @@ -46,7 +46,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$xmlFiles = $input->getArgument('xmlFiles');
}

static::convertEntities($xmlFiles, $isCore);
if (!empty($xmlFiles)) {
static::convertEntities($xmlFiles, $isCore);
} else {
\Civix::io()->note('No legacy xml entities found');
}

return 0;
}
Expand All @@ -57,6 +61,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
* @throws \Exception
*/
public static function convertEntities(array $xmlFiles, bool $isCore): void {
if (empty($xmlFiles)) {
return;
}
$xmlFiles = preg_grep('/files.xml$/', $xmlFiles, PREG_GREP_INVERT);
$xmlFiles = preg_grep('/Schema.xml$/', $xmlFiles, PREG_GREP_INVERT);

Expand Down
5 changes: 3 additions & 2 deletions upgrades/24.09.1.up.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
}

Civix::boot(['output' => Civix::output()]);
\CRM\CivixBundle\Command\ConvertEntityCommand::convertEntities($xmlSchemaFiles, FALSE);

if (!empty($xmlSchemaFiles)) {
\CRM\CivixBundle\Command\ConvertEntityCommand::convertEntities($xmlSchemaFiles, FALSE);
}
};

0 comments on commit 95b9357

Please sign in to comment.