We have a vendor that is asking us to assist them in updating a core module independently of core. Is there such a thing? For example, could you update Views without updating core? My understanding is that's not doable.
For example, could you update Views without updating core?
First of all, you should check if you could get away with implementing those changes via a hook, event subscriber, or altering/overriding a service.
If not, download Lastest_Drupal_8.zip and unzip only /core/modules/views folder onto your projects /core/modules/views folder.
If you like, you could create a patch for that particular core module using
git diff between latest and current version.
Although, I wouldn't recommend to do this to begin with, this is bad practice!, but if there is a really, really, and I mean, really good reason sure.
- You'll have to test the core module to make sure all is good.
- You won't be able to use
composer updateunless you find a way to make it run the patch.
While you could copy a core module from a newer Drupal version, that is probably going to create issues, as the module code could be changed because of changes in Drupal core code.
For example, a new class could replace an old one. Using the newer version of the module would cause its code to try to instantiate a class that doesn't exist in the old Drupal core code, or use a service it didn't exist before.
As @4k4 said, if you need the changes that have been implemented in a patch included in an issue, you could apply that patch to the Drupal code you have, possibly on a development server.
Doing so, you could be altering more than one module, which means (technically) that more than one module is updated, not just one. This is inevitable, as in many cases, the changes are not limited to a single module/file.