-
Notifications
You must be signed in to change notification settings - Fork 340
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
First-time Magento 2 setups fail if they include a category creation #121
Comments
Hi @TiEul, Where did you create the category (InstallSchema or InstallData script) ? BR, |
Hello @TiEul . I am unfortunately unable to reproduce your issue. What I do : I create a raw Magento 2.1 instance with a composer-create-project. if (version_compare($context->getVersion(), '2.0.0', '<')) { $category = $this->categoryFactory->create(); $category->loadByAttribute('name', 'Homepage Highlighted Products'); if ($category == false || $category->getId() == false) { $category = $this->categoryFactory->create(); $category->setIsActive(true); $category->setName('Homepage Highlighted Products'); $category->setIncludeInMenu(false); $this->categoryRepository->save($category); } } I run the bin/magento setup:install on the command line. No problem occurs. Install finishes properly and I can see my category is created. Elasticsearch is running locally of course, before running the setup. But after the install procedure, no index is created. Indexers are indicated as "invalid" in the back-office as expected after a fresh install. Are you sure you are using the last version of 2.2.x branch ? For me, this bug has been fixed since the merge of #110 into master and 2.2.x. Regards, A |
Now I'll need more informations about the error message you observe, and also the setup process which is running in your environment. Regards, |
Hey Romain, thanks for your help, I just updated our composer.json so that we are now grabbing v2.2.5 instead of 2.2.1, I will let you know if that solves the problem. Thanks again |
During a first-time setup of Magento, for example when deploying a pre-existing codebase to a new environment, the ElasticSuite module will cause an exception to be thrown if any of the custom setups include a category creation. This cannot be solved by setting the indexers to "scheduled" since the indexer namespace for the the magento binary only becomes available after the first setup has finished, meaning the setup will end up in a deadlock.
The text was updated successfully, but these errors were encountered: