Skip to content

Save product using repository in adminhtml controller #18950

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

Conversation

JeroenVanLeusden
Copy link
Member

Description (*)

Save product in Magento\Catalog\Controller\Adminhtml\Product\Save using Repository. Will be much easier to customize the flow if a plugin can be created on the Repository::save() method.

Fixed Issues (if relevant)

  1. None I could find.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@JeroenVanLeusden JeroenVanLeusden added Release Line: 2.3 partners-contribution Pull Request is created by Magento Partner Partner: Reach Digital Pull Request is created by partner Reach Digital Partner: H&O labels Oct 30, 2018
@magento-engcom-team
Copy link
Contributor

Hi @JeroenVanLeusden. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me $VERSION instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@orlangur orlangur self-assigned this Oct 30, 2018
Copy link
Contributor

@orlangur orlangur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if it will pass the builds but let's try. A bit surprised $saveOptions is not used anymore.

@magento-engcom-team magento-engcom-team added this to the Release: 2.3.1 milestone Oct 30, 2018
@magento-engcom-team
Copy link
Contributor

Hi @orlangur, thank you for the review.
ENGCOM-3337 has been created to process this Pull Request

Copy link
Contributor

@orlangur orlangur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JeroenVanLeusden please check tests failing on Travis CI.

@okorshenko okorshenko removed this from the Release: 2.3.1 milestone Jan 28, 2019
@sivaschenko sivaschenko self-assigned this Feb 12, 2019
@sivaschenko
Copy link
Member

@orlangur @JacobBrownAustin I don't think Travis fails are related to the PR

@sivaschenko
Copy link
Member

@magento-engcom-team give me test instance

@magento-engcom-team
Copy link
Contributor

Hi @sivaschenko. Thank you for your request. I'm working on Magento instance for you

@magento-engcom-team
Copy link
Contributor

Hi @sivaschenko, here is your new Magento instance.
Admin access: https://pr-18950.instances.magento-community.engineering/admin
Login: admin Password: 123123q

@p-bystritsky
Copy link
Contributor

@JeroenVanLeusden this improvement is incorrect, as ProductRepository currently is trying to load product by sku before saving it.

$existingProduct = $this->get($product->getSku());

So creating new product with existing sku will just override existing one instead of creating new with the modified sku.
You can try to fix this bug or wait until magento-engcom/import-export-improvements#119 would be merged, as this PR may resolve this problem.

@JeroenVanLeusden
Copy link
Member Author

@p-bystritsky I can wait till that PR is merged. Does that mean I have to wait till the fixed is merged into main line and re-submit the PR?

@p-bystritsky
Copy link
Contributor

@JeroenVanLeusden, no, just wait.

@m2-assistant
Copy link

m2-assistant bot commented Apr 15, 2019

Hi @JeroenVanLeusden, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

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

Successfully merging this pull request may close these issues.

7 participants