Provider Map takes a spreadsheet of organizations and turns it into a searchable, clickable map of the areas they serve. Those areas can be counties, parishes, boroughs, tribal nations, health districts, or anything else you can supply as GeoJSON. It is aimed at public agencies and non-profits that need to publish a "find a provider near you" directory.

The geometry is stored in Drupal and projected to SVG in the browser, so there is no mapping library, no tile server, no API key, and no third-party request after the page loads. Each region is a real <path> element with role="button", tabindex and an aria-label. The full directory is also rendered server side, so the page is usable before any JavaScript runs.

How it differs from similar projects

  • Leaflet and Geofield Map plot points on a basemap and can do distance search. Provider Map has no basemap, no geocoding and no distance search. It answers the question "who serves this area" rather than "who is closest to this point", and draws a choropleth of service areas.
  • Views with an exposed filter gives you a filterable list and no map. Provider Map ties the directory and the map together so that each one filters the other.

Notes for the reviewer

  • No third-party libraries are bundled, and there are no contributed dependencies. It uses core's File, Filter, Options and User modules only.
  • GitLab CI is enabled and passing: composer, composer-lint, cspell, eslint, phpcs, phpstan, stylelint and PHPUnit. Pipelines
  • There are 52 PHPUnit tests across unit, kernel and functional, covering the CSV importer, the GeoJSON importer, the payload builder, entity lifecycle and the configuration upgrade path.
  • Output is escaped throughout. The front-end JavaScript builds DOM nodes with textContent rather than innerHTML, since provider records are editorial content.
  • Route access is permission based, with separate permissions for administering maps, viewing published maps, editing providers, and importing or exporting CSV.
  • The example submodule ships entirely invented data: fictional organizations, 555-01xx telephone numbers and example.org addresses.

This is my first project as a maintainer on drupal.org, so I would welcome direct feedback on anything that falls short.

Project link

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

Comments

aftrix created an issue. See original summary.

vishal.kadam’s picture

Issue summary: View changes
avpaderno’s picture

Thank you for applying!

Before giving links helpful to understand how the review process works, what to expect from a review, and what to do to avoid a review takes more time than needed, I would like to thank all the reviewers for the work they do.
These applications are volunters-driven, which also means it is not possible to predict when an application will be marked fixed and the applicant will get the permission to opt projects into security advisory policy. While we aim to make an application as quick as possible, it is also important for us that more people review the project used for an application. In this way, we make sure applications do not miss some important points that should be instead reported.
Applications are not meant to be complete debugging sessions that eliminate every existing bug, though. I apologize if sometimes applications seem to go into too-detailed reviews.

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.

The important notes are the following.

  • If you have not done it yet, you should enable GitLab CI for the project and fix the PHP_CodeSniffer errors/warnings it reports.
  • For the time this application is open, only your commits are allowed.
  • The purpose of this application is giving you a new drupal.org role that allows you to opt projects into security advisory coverage, either projects you already created, or projects you will create. The project status will not be changed by this application; once this application is closed, you will be able to change the project status from Not covered to Opt into security advisory coverage. This is possible only 14 days after the project is created.

    Keep in mind that once the project is opted into security advisory coverage, only Security Team members may change coverage.
  • Only the person who created the application will get the permission to opt projects into security advisory coverage. No other person will get the same permission from the same application; that applies also to co-maintainers/maintainers of the project used for the application.
  • We only accept an application per user. If you change your mind about the project to use for this application, or it is necessary to use a different project for the application, please update the issue summary with the link to the correct project and the issue title with the project name and the branch to review.

To the reviewers

Please read How to review security advisory coverage applications, Application workflow, What to cover in an application review, and Tools to use for reviews.

The important notes are the following.

  • It is preferable to wait for a project moderator before posting the first comment on newly created applications. Project moderators will do some preliminary checks that are necessary before any change on the project files is suggested.
  • Reviewers should show the output of a CLI tool only once per application.
  • It may be best to have the applicant fix things before further review.

For new reviewers, I would also suggest to first read In which way the issue queue for coverage applications is different from other project queues.

vishal.kadam’s picture

Status: Needs review » Needs work

1. FILE: README.md

The README file is missing the required section - Configuration.

2. FILE: provider_map.module

For a new module that aims to be compatible with Drupal 10 and Drupal 11, I would rather implement hooks as class methods as described in Support for object oriented hook implementations using autowired services.

3. FILE: src/Controller/ProviderMapController.php

Since that class does not use methods from the parent class, or it uses a single method from the parent class, it does not need to use ControllerBase as parent class.

Controllers do not need to have a parent class; as long as they implement \Drupal\Core\DependencyInjection\ContainerInjectionInterface, they are fine.

4. FILE: src/Entity/ProviderMap.php, src/Entity/ProviderMapCategory.php, src/Entity/ProviderMapProvider.php, src/Entity/ProviderMapRegion.php, src/Plugin/Block/ProviderMapBlock.php

Projects that are compatible with Drupal 10 or higher versions should use attributes instead of annotations.

5. FILE: src/Routing/ProviderMapRoutes.php

  /**
   * The entity type manager.
   */
  protected EntityTypeManagerInterface $entityTypeManager;

  /**
   * Constructs a ProviderMapRoutes.
   *
   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
   *   The entity type manager.
   */
  public function __construct(EntityTypeManagerInterface $entity_type_manager) {
    $this->entityTypeManager = $entity_type_manager;
  }

FILE: src/Service/MapDataBuilder.php

  /**
   * The entity type manager.
   */
  protected EntityTypeManagerInterface $entityTypeManager;

  /**
   * The geometry helper.
   */
  protected GeometryHelper $geometry;

  /**
   * The cache backend.
   */
  protected CacheBackendInterface $cache;

  /**
   * Constructs a MapDataBuilder.
   *
   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
   *   The entity type manager.
   * @param \Drupal\provider_map\Service\GeometryHelper $geometry
   *   The geometry helper.
   * @param \Drupal\Core\Cache\CacheBackendInterface $cache
   *   The cache backend to store assembled payloads in.
   */
  public function __construct(EntityTypeManagerInterface $entity_type_manager, GeometryHelper $geometry, CacheBackendInterface $cache) {
    $this->entityTypeManager = $entity_type_manager;
    $this->geometry = $geometry;
    $this->cache = $cache;
  }

FILE: src/Service/MapRenderer.php

  /**
   * The map data builder.
   */
  protected MapDataBuilder $dataBuilder;

  /**
   * The renderer.
   */
  protected RendererInterface $renderer;

  /**
   * Constructs a MapRenderer.
   *
   * @param \Drupal\provider_map\Service\MapDataBuilder $data_builder
   *   The map data builder.
   * @param \Drupal\Core\Render\RendererInterface $renderer
   *   The renderer.
   * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation
   *   The string translation service.
   */
  public function __construct(MapDataBuilder $data_builder, RendererInterface $renderer, TranslationInterface $string_translation) {
    $this->dataBuilder = $data_builder;
    $this->renderer = $renderer;
    $this->stringTranslation = $string_translation;
  }

FILE: src/Service/ProviderImporter.php

  /**
   * The entity type manager.
   */
  protected EntityTypeManagerInterface $entityTypeManager;

  /**
   * The CSV reader.
   */
  protected CsvReader $reader;

  /**
   * Constructs a ProviderImporter.
   *
   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
   *   The entity type manager.
   * @param \Drupal\provider_map\Service\CsvReader $reader
   *   The CSV reader.
   * @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation
   *   The string translation service.
   */
  public function __construct(EntityTypeManagerInterface $entity_type_manager, CsvReader $reader, TranslationInterface $string_translation) {
    $this->entityTypeManager = $entity_type_manager;
    $this->reader = $reader;
    $this->stringTranslation = $string_translation;
  }

Modules which are compatible with Drupal 10 and higher versions are expected to use constructor property promotion.

aftrix’s picture

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

Thanks for the review. Points 1, 3, 4 and 5 are done in c9a603c.

1. README now has a Configuration section.

3. ProviderMapController was using nothing at all from ControllerBase and CsvExportController was only using entityTypeManager(), so both now implement ContainerInjectionInterface and inject what they need. I also took ProviderDuplicateController off ControllerBase and gave it MessengerTrait and StringTranslationTrait, since t() and messenger() were the only reasons it was extending anything.

4. The four entities and the block plugin now use attributes. That had a nice side effect: the "@EntityType annotation is deprecated" notices that were appearing in the test run are gone.

5. Constructor property promotion is in for ProviderMapRoutes, MapDataBuilder, MapRenderer and ProviderImporter. In MapRenderer and ProviderImporter the stringTranslation assignment stayed in the constructor body, since that property comes from StringTranslationTrait and promoting it would redeclare the trait's property. Happy to change that if you would rather see it done another way.

The pipeline is green after the changes: https://git.drupalcode.org/project/provider_map/-/pipelines/929468

On point 2, I have a question rather than a change. The #[Hook] attribute and object oriented hook implementations landed in Drupal 11.1, but this branch declares ^10.3 || ^11, so converting provider_map.module would mean dropping Drupal 10 support. The module only implements two hooks, help and theme. Would you prefer that I narrow the requirement to ^11.1 and convert them, or keep the .module file while Drupal 10 is still supported? I am happy either way, I just did not want to quietly drop a supported core version.

avpaderno’s picture

Status: Needs review » Needs work
aftrix’s picture

Status: Needs work » Needs review

Thank you, that was the piece I was missing. I had not seen the backwards compatible pattern, so I assumed converting meant dropping Drupal 10.

Point 2 is done in 0743d65:

src/Hook/ProviderMapHooks.php now holds hook_help() and hook_theme() as methods with the #[Hook] attribute, the class is registered as an autowired service, and provider_map.module keeps thin wrappers marked #[LegacyHook] that delegate to it. Drupal 11.1 and later call the class directly and skip the wrappers, and 10.3 calls the wrappers, so the logic only exists in one place. core_version_requirement stays ^10.3 || ^11.

I checked both hooks still fire after the change: the provider_map theme hook is registered, and hook_help returns its text through the module handler.

The pipeline is green: https://git.drupalcode.org/project/provider_map/-/pipelines/929711

That covers all five points from #4. Happy to keep going if anything else turns up.