Problem/Motivation
Follow up of https://www.drupal.org/node/2850804
Proposed resolution
- Use dependency injection.
- Move form from quora.module to block plugin.
- Implement missing configuration functions.
Remaining tasks
- Add category in block plugin annotation.
- Use dependency injection to implement Drupal\Core\Routing\CurrentRouteMatch for getting current node context.
- Move form code from quora.module to blockForm() function.
- Implement missing defaultConfiguration(), getConfiguration() and setConfiguration() function for properly saving block form configuration value.
- Remove _quora_content() and move code to build().
- Use Quora Services.
- Use $form_state->getValues() to avoid multiple calls to $form_state->getValue().
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | clean_up_and_improve_block_plugin-2851463-2.patch | 7.3 KB | navneet0693 |
Comments
Comment #2
navneet0693 commentedPlease review.
Comment #3
gg24 commentedThis patch works as expected. There were few indentation fixes. So i will do it while commiting.
Thanks!
Comment #5
gg24 commentedThanks for the patch @navneet0693!!