Project link: https://www.drupal.org/sandbox/vladdancer/2796815
Git: git clone --branch 8.x-1.x https://git.drupal.org/sandbox/vlad.dancer/2796815.git global_gateway

ABOUT
The purpose of this module is to filter language links by selected or auto-detected user country.
This is helpful when you have many languages on the site and want to show only languages for current country.
Think like this: "EN" language is official in many countries, so you don't want to see "FR" language and others
when you're from USA or Australia.

This module adds a block with select box filled by countries, and language links.

Thanks!

Comments

vlad.dancer created an issue. See original summary.

PA robot’s picture

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.

vasi’s picture

Status: Needs review » Needs work

Your git command is incomplete. It should have the project name as a last argument—otherwise the code will be cloned into a directory named '2796815'.

Automated Review

Several issues were found by pareview: http://pareview.sh/pareview/httpsgitdrupalorgsandboxvladdancer2796815git . Most important is that the 'version' key should not be present in the .info.yml file, Drupal.org will add it automatically.

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Yes: Does not cause module duplication and/or fragmentation. The only similar module I can find is IP Language Negotiation, and it only supports one language per country.
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: Mostly follows the guidelines for in-project documentation and/or the README Template.

The README.md could be cleaned up in a few places:

  • USAGES should be USAGE.
  • A few articles are missing, eg: It should always be "the current country", or "a couple of languages".
  • The AUTHOR section references a CHANGELOG.txt, which does not seem to exist.
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. Use /** comments for member variables.
  2. In global_gateway_install, you should prefer file_scan_directory to scandir. Since you already have a filename in mind, you might also want to check file_exists($path) instead of scanning the whole directory.
    • It's a little odd to have random non-Drupal-config YAML files in config/ as you do, but not unheard of.
  3. I am able to save a language with an empty list of countries, which makes it unselectable by the user. I can also save an empty country row ("- Select Country -"). Consider adding a validation function.
  4. You have a lot of helper functions in your .module file, which will be loaded for every single page on the site. Consider turning them into one or more classes, which can be auto-loaded only when needed.
  5. Consider using PrivateTempStore instead of $_SESSION
  6. Try not to pass the container around just to build a form. Instead, you can use FormBuilderInterface::buildForm('\Drupal\my_module\MyForm').

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.

See also the automated report above.

This review uses the Project Application Review Template.

vlad.dancer’s picture

Thanks, @vasi!

I've followed some of your recommendations.

README.txt/README.md

Done

Coding style & Drupal API usage

1. Done.
2. Done + some comments below.

It's a little odd to have random non-Drupal-config YAML files in config/ as you do, but not unheard of.

We use third-party settings feature to store a country mappings, so when we want to export this settings into config and autoimport on module install we will get the whole language config, this is not what we want, we want only country mapping.

instead of scanning the whole directory.

I disagree with you, because we need in future more mapping files.

3. Can't reproduce, see http://take.ms/1XMzs
4. Partially moved to the separate class, functions that are ajax callbacks or submits for the admin form stayed in the module file.
5. Done.
6. Done.

vlad.dancer’s picture

Issue summary: View changes

Changed git commit command text.

vlad.dancer’s picture

Status: Needs work » Needs review
valentine94’s picture

Looks good to me!

PA robot’s picture

Status: Needs review » Closed (duplicate)
Multiple Applications
It appears that there have been multiple project applications opened under your username:

Project 1: https://www.drupal.org/node/2835768

Project 2: https://www.drupal.org/node/2800187

As successful completion of the project application process results in the applicant being granted the 'Create Full Projects' permission, there is no need to take multiple applications through the process. Once the first application has been successfully approved, then the applicant can promote other projects without review. Because of this, posting multiple applications is not necessary, and results in additional workload for reviewers ... which in turn results in longer wait times for everyone in the queue. With this in mind, your secondary applications have been marked as 'closed(duplicate)', with only one application left open (chosen at random).

If you prefer that we proceed through this review process with a different application than the one which was left open, then feel free to close the 'open' application as a duplicate, and re-open one of the project applications which had been closed.

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

avpaderno’s picture