magento / magento/community-features

StoreResolver does not read store param from url

Open
#77 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Priority: P2
Dominant language
No language data
Stars
46
Forks
14
PR merge metrics
No merged PRs in 30d

Description

The `\Magento\Store\Model\StoreResolver` determins the active store from either the defined cookie or the passed request parameter but does not take the store code from the url into account (/rest/my_store_code/V1/...).

### Preconditions

1. Tested with Magento 2.2.5 - other versions might also be affected

### Steps to reproduce
1. Pass the store code in the url to Magento
2. Call `\Magento\Store\Model\StoreResolver::getCurrentStoreId()`

### Expected result

1. The method call returns the default store code as the resolver did not find the cookie in question or the url parameter.

### Actual result

1. The method call should return the id of the store defined in the url.

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start with Magento\Store\Model\StoreResolver::getCurrentStoreId() and trace how it selects the active store from the cookie and request parameter. Reproduce the /rest/my_store_code/V1/... case on Magento 2.2.5, then verify that the store ID for the URL’s store code is returned when the cookie and URL parameter are absent.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.