Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in getWebsiteOrStoreId() method, in helper Data.php #79

Open
SamueleMartini opened this issue Oct 14, 2020 · 0 comments
Open

Error in getWebsiteOrStoreId() method, in helper Data.php #79

SamueleMartini opened this issue Oct 14, 2020 · 0 comments

Comments

@SamueleMartini
Copy link

The method getWebsiteOrStoreId() checks from the request whether the context is a store or a website, takes its ID and then returns it.
However, the value returned by this method is always passed to the "setStore" method (ex. in method getFirstProduct(), row 204 in Data.php) even when the returned ID is a website Id and not a store view ID!
If I have a website with an ID that does not correspond to that of a store, the "store -> configuration" section returns an exception "store was not found"
In the other cases the section loads without errors, but it has loaded an incorrect store anyway, because it has loaded the store with the same ID as the website and not the website.

You can reproduce the error by creating two store views, associating them with the main website and then deleting the first store view created. In this way the website will have ID 1, but there will be no store with ID 1.
Then go to module configurations and change scope to "website" to see the exception.

immagine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant