This module allows the site builder to choose a menu with some options, and output a block that contains the menu with applicable branchee markup.

A default version of the Branchee library is provided in the module, but can be overridden with a new version by overriding the library in your theme.
A built in style for the menu can be chosen in the block settings, or a custom class can be provided if you want to customize the styling as per the styling recommendations in the Branchee library.

Project Page: https://www.drupal.org/sandbox/aeotrin/2753955
Git Clone: git clone --branch 8.x-1.x https://git.drupal.org/sandbox/aeotrin/2753955.git branchee_block

Comments

aeotrin created an issue. See original summary.

aeotrin’s picture

Issue summary: View changes
PA robot’s picture

Issue summary: View changes
Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpsgitdrupalorgsandboxaeotrin2753955git

Fixed the git clone URL in the issue summary for non-maintainer users.

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

aeotrin’s picture

I have checked the pareview.sh review and noticed the errors were coming from the included library.
As for the warnings, anyone have a suggestion on how I can improve the t() call, or the /Drupal call (as that is how it is used elsewhere in core)

aeotrin’s picture

Status: Needs work » Needs review
b.ravanbakhsh’s picture

Manual Review:

  • *Blocker: According to description in info file, I navigate to /admin/structure/block and choosed *Branchee Menu Block* and press `Place Block` but, it does not work even after clear cache.
  • You need to escape * asterisk in your README.md Markdown file. e.g.: **Place Block** should correct by \*\*Place Block\*\*. For more information take a look at
    https://confluence.atlassian.com/bitbucketserver/markdown-syntax-guide-7...
  • in branchee_block.info.yml please put your module under `User interface` not Custom.
    package: User interface
  • Consider using OOP like using
    \Drupal::entityManager()->getStorage($entity_type) instead of `entity_load_multiple` In branchee_block/src/Plugin/Block/BrancheeMenuBlock.php
  • In branchee_block/src/Plugin/Block/BrancheeMenuBlock.php line 38,39,40 Consider using [] instead of array()
b.ravanbakhsh’s picture

  • Consider creating a composer.json file.
    {
      "name": "drupal/test",
      "type": "drupal-module",
      "description": "My Awesome Module",
      "keywords": ["Drupal"],
      "license": "GPL-2.0+",
      "homepage": "https://www.drupal.org/project/test",
      "minimum-stability": "dev",
      "support": {
        "issues": "http://drupal.org/project/issues/test",
        "source": "http://cgit.drupalcode.org/test"
      },
      "require": { }
    }
  • There are some warning in coding standard, Please go through the below pareview.sh URL
    http://pareview.sh/pareview/httpsgitdrupalorgsandboxaeotrin2753955git
aeotrin’s picture

Thanks for the comments b.ravanbakhsh. I'll take a look at it. The asterisks in the README are for bolding, not to display as asterisks. Thanks for mentioning it though.

aeotrin’s picture

So I looked at the warnings, and they are saying to use dependency injection for the \Drupal calls and the t(), (which i am doing $this->t() as it states I should). The other errors are coming from the library that is being included as a base copy of it (can be overridden as per readme) .

Any recommendations on what more I can do?

b.ravanbakhsh’s picture

For `t()` ignore those warnings.
For dependency injection warning you can fix it by injecting `menu.link_tree` in your create() and __construct() function then you have $this->container->get('menu.link_tree').

  /**
   * The menu link tree service.
   *
   * @var \Drupal\Core\Menu\MenuLinkTreeInterface
   */
  protected $menuLinkTree;

  public function __construct(array $configuration, $plugin_id, $plugin_definition, ConfigFactoryInterface $link_tree) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    $this->menuLinkTree = $menu_link_tree;
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
    return new static(
      $configuration,
      $plugin_id,
      $plugin_definition,
      $container->get(''menu.link_tree''),
    );
  }

use Drupal\Core\Menu\MenuLinkTreeInterface;
For more code styling tips:
in branchee_block/src/Plugin/Block/BrancheeMenuBlock.php
line 69
Consider `return $form;` is in the condition and you need to return array in anycase.
and PHPdoc on top of file should be just before class definition not at first line of file.

PS. if you'd like have a review on my project:
https://www.drupal.org/node/2758935

aeotrin’s picture

Thanks for the help.

icurk’s picture

Status: Needs review » Needs work

Review your module with https://pareview.sh/. You will see that you have a lot of coding standards errors, you should use dependency injection in classes etc. I didn't attach because review from pareview.sh because it is really long.

aeotrin’s picture

Status: Needs work » Needs review

Thanks @icurk, for some reason those errors were not showing up on my report, I was only getting the Drupal dependency injection as discussed above. I have made the fixes to those, removed the js library that was being included and rather have instructions for a bower install (or libraries override to get the library)

andor.koza’s picture

Status: Needs review » Reviewed & tested by the community

Automated Review

https://pareview.sh/node/767 Found some warnings and an error, but those aren't big problems.

Note that perfect adherence to Drupal Coding Standard is NOT a reason to block an application, except for total disregard of them. However, modules should follow them as closely as possible.

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Yes: Does not cause module duplication and/or fragmentation.
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements.
3rd party assets/code
Yes: Follows the guidelines for 3rd party assets/code.
README.txt/README.md
Yes: Follows the guidelines for in-project documentation and/or the README Template.
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
Yes: Meets the security requirements.
Coding style & Drupal API usage
  1. You should fix those dependency injection warnings, because you already use dependency injection in BrancheeMenuBlock.php. So it should not be a problem.

Otherwise everything works fine

The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.

If added, please don't remove the security tag, we keep that for statistics and to show examples of security problems.

This review uses the Project Application Review Template.

apaderno’s picture

Assigned: Unassigned » apaderno
Status: Reviewed & tested by the community » Fixed

Thank you for your contribution!

I updated your account so you can opt into security advisory coverage now.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!

Thank you, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks go the dedicated reviewer(s) as well.

apaderno’s picture

Status: Fixed » Closed (fixed)

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