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

generate entity:bundle-class command generates duplicate hook implementations #5016

Closed
mikran opened this issue Jan 14, 2022 · 1 comment
Closed

Comments

@mikran
Copy link
Contributor

mikran commented Jan 14, 2022

Describe the bug

generate entity:bundle-class command attempts to create hook_entity_bundle_info_alter() without checking if one exists already

To Reproduce

Run generate entity:bundle-class twice for two different entities and check the .module file for generated hook implementations.

Expected behavior

Maybe append new lines to existing hook implementation?

Actual behavior

Duplicate hook implementation that leads to php fatal error

Workaround

Manually merge the two generated hook implementations.

System Configuration

Q A
Drush version? 11.x
Drupal version? 9.x
PHP version 7.x
OS? Linux

Additional information

@weitzman
Copy link
Member

We dont try to append inside of existing functions so unfortunately this is the best we can do. See #4903 (comment)

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

No branches or pull requests

2 participants