Openlayers6 renders geofields as Openlayers map using last openlayers library. It also provide a store locator feature.

Project link

https://www.drupal.org/project/openlayers6

Comments

Oulalahakabu created an issue. See original summary.

shashank5563’s picture

Thank you for applying! Reviewers will review the project files, describing what needs to be changed.

Please read Review process for security advisory coverage: What to expect for more details and Security advisory coverage application checklist to understand what reviewers look for. Tips for ensuring a smooth review gives some hints for a smoother review.

To reviewers: Please read How to review security advisory coverage applications, What to cover in an application review, and Drupal.org security advisory coverage application workflow.

While this application is open, only the user who opened the application can make commits to the project used for the application.

Reviewers only describe what needs to be changed; they don't provide patches to fix what reported in a review.

shashank5563’s picture

Issue summary: View changes
avpaderno’s picture

Issue summary: View changes
vinaymahale’s picture

Status: Needs review » Needs work

Please fix below PHPCS issues.

FILE: /openlayers6/config/schema/openlayer6.schema.yml
---------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------
 75 | ERROR | [x] Expected 1 newline at end of file; 2 found
---------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------


FILE: /openlayers6/DOCUMENTATION.md
--------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------
 155 | WARNING | Line exceeds 80 characters; contains 142 characters
--------------------------------------------------------------------------


FILE: /openlayers6/src/Plugin/Block/OpenlayersBlock.php
----------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 11 WARNINGS AFFECTING 13 LINES
----------------------------------------------------------------------------------------------------
  74 | WARNING | [ ] #description values usually have to run through t() for translation
  81 | WARNING | [ ] #description values usually have to run through t() for translation
  87 | WARNING | [ ] #description values usually have to run through t() for translation
  94 | WARNING | [ ] #description values usually have to run through t() for translation
 101 | WARNING | [ ] #description values usually have to run through t() for translation
 108 | WARNING | [ ] #description values usually have to run through t() for translation
 151 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
 153 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
 275 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
 300 | WARNING | [ ] File::load calls should be avoided in classes, use dependency injection
     |         |     instead
 302 | WARNING | [ ] \Drupal calls should be avoided in classes, use dependency injection instead
 373 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
 412 | ERROR   | [x] Use null coalesce operator instead of ternary operator.
----------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------


FILE: /openlayers6/src/Plugin/Field/FieldFormatter/OpenlayerFormatter.php
----------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------------------------------------------------------------
  41 | WARNING | Unused variable $settings.
 159 | WARNING | Unused variable $delta.
----------------------------------------------------------------------------------------------------


FILE: /openlayers6/tests/src/Functional/Openlayers6TestTrait.php
----------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------
 97 | WARNING | Unused variable $geoService.
----------------------------------------------------------------------------------------------------


FILE: /openlayers6/openlayers6.routing.yml
---------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------
 7 | ERROR | [x] Expected 1 newline at end of file; 2 found
---------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------
oulalahakabu’s picture

oulalahakabu’s picture

Status: Needs work » Needs review
DSushmita’s picture

Status: Needs review » Needs work

Found these warnings reported by PHPCS. Its better to make use of dependency injection instead of using \Drupal calls
Please fix below:

/openlayers6/src/Plugin/Block/OpenlayersBlock.php
-------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
-------------------------------------------------------------------------------------------------
 328 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
 353 | WARNING | File::load calls should be avoided in classes, use dependency injection instead
 355 | WARNING | \Drupal calls should be avoided in classes, use dependency injection instead
------------------------------------------------------------------------------------------------- 
oulalahakabu’s picture

Drupal call were made to avoid mandatory dependency, but i did it keeping it optional.

I also used storage for files instead of File::load

oulalahakabu’s picture

Status: Needs work » Needs review
kevin.brocatus’s picture

It looks like the administer openlayers6 configuration doesn't get used anywhere. Either remove it, or use it accordingly.

The constructor of the OpenlayersBlock has a wrong doc message.

Constructs a Drupalist object. should be changed to Constructs a OpenlayersBlock object.

The constructor of the OpenlayerController has a wrong doc message.

The controller constructor. should be changed to Constructs a OpenlayerController object.

The build function of the OpenlayerController does not have the parameters or the return type defined in the doc message.

  /**
   * Builds the response.
   */
  public function build(Node $node, $display = 'teaser') {

should be changed to something like

  /**
   * Builds the response.
   *
   * @param \Drupal\node\NodeInterface $node
   *   The node.
   * @param string
   *   (Optional) The display mode. Default is set to 'teaser'.
   *
   * @return \Symfony\Component\HttpFoundation\JsonResponse
   *   The json response.
   */
  public function build(Node $node, $display = 'teaser') {
avpaderno’s picture

Status: Needs review » Needs work
avpaderno’s picture

Priority: Normal » Minor

I am changing priority as per Issue priorities.

oulalahakabu’s picture

Status: Needs work » Needs review
avpaderno’s picture

Assigned: Unassigned » avpaderno
Priority: Minor » Normal
Status: Needs review » Reviewed & tested by the community

src/Controller/OpenlayerController.php

  /**
   * The entity type manager.
   *
   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
   */
  protected $entityTypeManager;

  /**
   * The renderer service.
   *
   * @var \Drupal\Core\Render\Renderer
   */
  protected $renderer;

  /**
   * Current user.
   *
   * @var \Drupal\Core\Session\AccountProxyInterface
   */
  protected $currentUser;

The first and the third property are already defined from the parent class. There is no need to define them.

avpaderno’s picture

Thank you for your contribution! I am going to update your account.

These are some recommended readings to help with excellent maintainership:

You can find more contributors chatting on the Slack #contribute channel. 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.

I thank all the reviewers.

avpaderno’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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