Problem/Motivation

Follow up of https://www.drupal.org/node/2850804

Proposed resolution

  1. Use dependency injection.
  2. Move form from quora.module to block plugin.
  3. Implement missing configuration functions.

Remaining tasks

  1. Add category in block plugin annotation.
  2. Use dependency injection to implement Drupal\Core\Routing\CurrentRouteMatch for getting current node context.
  3. Move form code from quora.module to blockForm() function.
  4. Implement missing defaultConfiguration(), getConfiguration() and setConfiguration() function for properly saving block form configuration value.
  5. Remove _quora_content() and move code to build().
  6. Use Quora Services.
  7. Use $form_state->getValues() to avoid multiple calls to $form_state->getValue().

Comments

navneet0693 created an issue. See original summary.

navneet0693’s picture

Status: Active » Needs review
StatusFileSize
new7.3 KB

Please review.

gg24’s picture

Status: Needs review » Reviewed & tested by the community

This patch works as expected. There were few indentation fixes. So i will do it while commiting.

Thanks!

  • gg24 committed f6a279b on 8.x-2.x authored by navneet0693
    Issue #2851463 by navneet0693, gg24: Clean up and improve src\Plugin\...
gg24’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the patch @navneet0693!!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.