Q:

Related Products, Up-Sells, and Cross-Sells modal panel error

After moving to Magento ver. 2.2.2 from Magento var. 2.1.9 the Related Products, Up-Sells, and Cross-Sells modal panel from catalog product edit doesn't show anymore.
I can see these error in the console
Uncaught TypeError: Cannot read property 'apply' of undefined
at registry.js:59
at Registry._resolveRequest (registry.js:418)
at Registry._addRequest (registry.js:385)
at Registry.get (registry.js:229)
at async (registry.js:58)
at UiClass.applyAction (button.js:78)
at Array.forEach (<anonymous>)
at UiClass.action (button.js:56)
at HTMLButtonElement.<anonymous> (knockout.js:3863)
at HTMLButtonElement.dispatch (jquery.js:5226)

After many debugging hours I found the KO component applied to product_form.product_form.related.related.modal is Magento_Ui/js/form/form instead of Magento_Ui/js/modal/modal-component
Can anyone help or point me in the right direction to fix it?

A:

I don't have enough info to determine the fix, but it sounds like a file you have overwritten needs updating with something from the core.
I would start by removing all customisations you've done to related/upsell/crosssells and see if that resolves the issue, if it does then start removing those files one-by-one. If removing a file fixes it then you know the issue is related to that file. You can then run a diff with your version and the updated core version to hopefully see what you need to include.
It may help to go through the release notes for each release and check what changes have been made to related/upsell/crosssells, for example in 2.2.2 these changes were made:

A price change to a custom option affects only that option. Previously, changing the price of a custom option also affected the price of related products. GitHub-4588, GitHub-5798, GitHub-6041, GitHub-6097

And

Magento now successfully loads re-ordered related products when Edge-Mode is activated.

If removing all your changes fails then I wish you extra good luck.
Hope this helps.

