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

Unable to assign a customer to another website #1818

Closed
jonathanribas opened this issue Sep 7, 2023 · 5 comments · Fixed by #1820 or #1823
Closed

Unable to assign a customer to another website #1818

jonathanribas opened this issue Sep 7, 2023 · 5 comments · Fixed by #1820 or #1823
Assignees
Milestone

Comments

@jonathanribas
Copy link

jonathanribas commented Sep 7, 2023

Preconditions

  1. Magento CE 2.4.6-p2
  2. mc-magento2 103.4.56
  3. You should have more than 1 website

Steps to reproduce

On a multiple websites installation

1. Navigate to backoffice
2. Edit a customer
3. Associate customer to another website

Actual and Expected result

Expected result:

You should be able to change customer website with a success message.

Actual result:

When you change a customer website, you have the following error:

The website with id 2 that was requested wasn't found. Verify the website and try again.

@gonzaloebiz
Copy link
Collaborator

Hi @jonathanribas

as you can see, i have an user from the main website and edit it

image

image

change the website to site1 and save it

image

the customer was saved ok, and now the wesite is site1

image

Do you already look at the system and exception log?

Best

@jonathanribas
Copy link
Author

Hi @gonzaloebiz, yes we have the following error:
{"@timestamp":"2023-09-07T16:34:57.744077+00:00","log.level":"CRITICAL","message":"Exception message: The website with id 10 that was requested wasn't found. Verify the website and try again.\nTrace: <pre>#1 Magento\\Store\\Model\\StoreManager->getWebsite() called at [vendor/magento/module-newsletter/Model/ResourceModel/Subscriber.php:124]\n#2 Magento\\Newsletter\\Model\\ResourceModel\\Subscriber->loadBySubscriberEmail() called at [vendor/magento/module-newsletter/Model/Subscriber.php:392]\n#3 Magento\\Newsletter\\Model\\Subscriber->loadBySubscriberEmail() called at [vendor/magento/framework/Interception/Interceptor.php:58]\n#4 Magento\\Newsletter\\Model\\Subscriber\\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]\n#5 Magento\\Newsletter\\Model\\Subscriber\\Interceptor->Magento\\Framework\\Interception\\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]\n#6 Magento\\Newsletter\\Model\\Subscriber\\Interceptor->___callPlugins() called at [generated/code/Magento/Newsletter/Model/Subscriber/Interceptor.php:23]\n#7 Magento\\Newsletter\\Model\\Subscriber\\Interceptor->loadBySubscriberEmail() called at [vendor/mailchimp/mc-magento2/Observer/Adminhtml/Customer/SaveAfter.php:101]\n#8 Ebizmarts\\MailChimp\\Observer\\Adminhtml\\Customer\\SaveAfter->execute() called at [vendor/magento/framework/Event/Invoker/InvokerDefault.php:88]\n#9 Magento\\Framework\\Event\\Invoker\\InvokerDefault->_callObserverMethod() called at [vendor/magento/framework/Event/Invoker/InvokerDefault.php:74]\n#10 Magento\\Framework\\Event\\Invoker\\InvokerDefault->dispatch() called at [vendor/magento/framework/Event/Manager.php:65]\n#11 Magento\\Framework\\Event\\Manager->dispatch() called at [generated/code/Magento/Framework/Event/Manager/Proxy.php:95]\n#12 Magento\\Framework\\Event\\Manager\\Proxy->dispatch() called at [vendor/magento/module-customer/Controller/Adminhtml/Index/Save.php:392]\n#13 Magento\\Customer\\Controller\\Adminhtml\\Index\\Save->execute() called at [vendor/magento/framework/Interception/Interceptor.php:58]\n#14 Magento\\Customer\\Controller\\Adminhtml\\Index\\Save\\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]\n#15 Magento\\Customer\\Controller\\Adminhtml\\Index\\Save\\Interceptor->Magento\\Framework\\Interception\\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]\n#16 Magento\\Customer\\Controller\\Adminhtml\\Index\\Save\\Interceptor->___callPlugins() called at [generated/code/Magento/Customer/Controller/Adminhtml/Index/Save/Interceptor.php:23]\n#17 Magento\\Customer\\Controller\\Adminhtml\\Index\\Save\\Interceptor->execute() called at [vendor/magento/framework/App/Action/Action.php:111]\n#18 Magento\\Framework\\App\\Action\\Action->dispatch() called at [vendor/magento/module-backend/App/AbstractAction.php:151]\n#19 Magento\\Backend\\App\\AbstractAction->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58]\n#20 Magento\\Customer\\Controller\\Adminhtml\\Index\\Save\\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]\n#21 Magento\\Customer\\Controller\\Adminhtml\\Index\\Save\\Interceptor->Magento\\Framework\\Interception\\{closure}() called at [vendor/magento/module-backend/App/Action/Plugin/Authentication.php:145]\n#22 Magento\\Backend\\App\\Action\\Plugin\\Authentication->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135]\n#23 Magento\\Customer\\Controller\\Adminhtml\\Index\\Save\\Interceptor->Magento\\Framework\\Interception\\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]\n#24 Magento\\Customer\\Controller\\Adminhtml\\Index\\Save\\Interceptor->___callPlugins() called at [generated/code/Magento/Customer/Controller/Adminhtml/Index/Save/Interceptor.php:32]\n#25 Magento\\Customer\\Controller\\Adminhtml\\Index\\Save\\Interceptor->dispatch() called at [vendor/magento/framework/App/FrontController.php:245]\n#26 Magento\\Framework\\App\\FrontController->getActionResponse() called at [vendor/magento/framework/App/FrontController.php:212]\n#27 Magento\\Framework\\App\\FrontController->processRequest() called at [vendor/magento/framework/App/FrontController.php:146]\n#28 Magento\\Framework\\App\\FrontController->dispatch() called at [vendor/magento/framework/Interception/Interceptor.php:58]\n#29 Magento\\Framework\\App\\FrontController\\Interceptor->___callParent() called at [vendor/magento/framework/Interception/Interceptor.php:138]\n#30 Magento\\Framework\\App\\FrontController\\Interceptor->Magento\\Framework\\Interception\\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]\n#31 Magento\\Framework\\App\\FrontController\\Interceptor->___callPlugins() called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:23]\n#32 Magento\\Framework\\App\\FrontController\\Interceptor->dispatch() called at [vendor/magento/framework/App/Http.php:116]\n#33 Magento\\Framework\\App\\Http->launch() called at [vendor/magento/framework/App/Bootstrap.php:264]\n#34 Magento\\Framework\\App\\Bootstrap->run() called at [pub/index.php:30]\n</pre>

@gonzaloebiz
Copy link
Collaborator

Can you please send us a ticket at [email protected] mentioning the issue?
We need some other info to try to replicate the issue

Best

@jonathanribas
Copy link
Author

Done

@ThomasHWeb
Copy link

Hi @jonathanribas

as you can see, i have an user from the main website and edit it

image

image

change the website to site1 and save it

image

the customer was saved ok, and now the wesite is site1

image

Do you already look at the system and exception log?

Best

I think you didn't find any error from your side because your website IDs are equal to your store IDs. However, it's not the use case for everyone, the website ID and the store ID may be different.

Then, you must replace store ID by website ID as second parameter for loadBySubscriberEmail and loadByCustomer methods.

gonzaloebiz added a commit that referenced this issue Sep 8, 2023
@gonzaloebiz gonzaloebiz self-assigned this Sep 11, 2023
@gonzaloebiz gonzaloebiz added this to the 10x.x.57 milestone Sep 11, 2023
@gonzaloebiz gonzaloebiz linked a pull request Sep 11, 2023 that will close this issue
gonzaloebiz added a commit that referenced this issue Sep 11, 2023
gonzaloebiz added a commit that referenced this issue Sep 12, 2023
@gonzaloebiz gonzaloebiz linked a pull request Sep 12, 2023 that will close this issue
gonzaloebiz added a commit that referenced this issue Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants