Skip to content

Conversation

@harivansh0
Copy link

No description provided.

@harivansh0 harivansh0 marked this pull request as draft April 27, 2025 12:18
@harivansh0 harivansh0 marked this pull request as ready for review May 11, 2025 15:17
@harivansh0 harivansh0 changed the title 6628: Added the hook-list command to show all deployed hooks. #6628: Added the hook-list command to show all deployed hooks. May 11, 2025
@harivansh0 harivansh0 changed the title #6628: Added the hook-list command to show all deployed hooks. #6628: Added a command to remove a deploy hook from the list of deployed hooks in the site State May 11, 2025
});

// Update the deployed hook list.
\Drupal::service('keyvalue')->get('deploy_hook')->set('existing_updates', $update_functions);
Copy link

Choose a reason for hiding this comment

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

We should have this service available as $this->keyValue.

Copy link
Author

@harivansh0 harivansh0 May 12, 2025

Choose a reason for hiding this comment

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

Hi @MurzNN
The DeployHookCommands class does not have a keyValue property. Although the getRegistry() function injects the service, the class extends UpdateRegistry, which defines keyValue as a protected property. Since it's protected and not accessible directly in the subclass, we cannot use it, without modifying the drupal core UpdateRegistry or use refelection.
Or I could using autowire to inject
#[Autowire(service: 'keyvalue')] protected KeyValueFactoryInterface $keyValueFactory,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants