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

Warning in PHP 8.1 when passing the bundle and no exclude options #5219

Merged
merged 2 commits into from Sep 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Drupal/Commands/core/DeployHookCommands.php
Expand Up @@ -174,7 +174,7 @@ public static function updateDoOneDeployHook(string $function, DrushBatchContext
// Module names can include '_deploy', so deploy functions like
// module_deploy_deploy_name() are ambiguous. Check every occurrence.
$components = explode('_', $function);
foreach (array_keys($components, 'deploy', TRUE) as $position) {
foreach (array_keys($components, 'deploy', true) as $position) {
$module = implode('_', array_slice($components, 0, $position));
$name = implode('_', array_slice($components, $position + 1));
$filename = $module . '.deploy';
Expand Down
2 changes: 1 addition & 1 deletion src/Drupal/Commands/core/EntityCommands.php
Expand Up @@ -172,7 +172,7 @@ protected function getQuery(string $entity_type, ?string $ids, array $options):
$idKey = $this->entityTypeManager->getDefinition($entity_type)->getKey('id');
$query = $query->condition($idKey, $ids, 'IN');
} elseif ($options['bundle'] || $options['exclude']) {
if ($exclude = StringUtils::csvToArray($options['exclude'])) {
if ($exclude = StringUtils::csvToArray((string) $options['exclude'])) {
$idKey = $this->entityTypeManager->getDefinition($entity_type)->getKey('id');
$query = $query->condition($idKey, $exclude, 'NOT IN');
}
Expand Down