I have a 3rd party extension installed and I needed to overwrite on block because I could not use events or plugins on it.
The block is added in the layout file like this:
<block class="Vendor\Module\Block" name="some-name" template="path/to/template.phtml" />
Notice that there is no module name specified for the template.
I've overwritten it with this in my
<preference for="Vendor\Module\Block" type="MyVendor\MyModule\Block" />
now when loading a certain page I get the error
path/to/template.phtml does not exist.
I know I can solve this by redeclaring the block in my own layout file and making the template
Vendor_Module::path/to/module.phtml and it will work but this is not upgrade proof.
If I upgrade the extension and the template to that specific block changes I will have problems.
My question: Is there an upgrade proof way to overwrite blocks and still keep the templates from the original module?