magento / magento/inventory

Refactor InventoryDistanceBasedSourceSelection plugin to handle exceptions instead of silent fail

Open
#2,930 0 comments 0 reactions 1 assignee View on GitHub

@TadeuRodrigues is already working on this.

Since Apr 12, 2020.

Progress: PR created
Dominant language
PHP
Stars
357
Forks
262
PR merge metrics
No merged PRs in 30d

Description

\Magento\InventoryDistanceBasedSourceSelection\Plugin\FillSourceLatitudeAndLongitude

 public function beforeSave(
        SourceRepositoryInterface $subject,
        SourceInterface $source
    )array {
        if (!$source->getLatitude() && !$source->getLongitude()) {
            try {
                $latLng = $this->getLatLngFromSource->execute($source);
                $source->setLatitude($latLng->getLat());
                $source->setLongitude($latLng->getLng());
            } catch (\Exception $e) {
                unset($e); // Silently fail geo coding
            }
        }

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.