Default templates taking precedence over custom theme's

Silverstripe Version:
4.7.3

Question:

I’ve upgraded a site from SS3 to 4, and one major problem is that it’s choosing the default templates in many cases instead of the custom theme’s ones. For example it chooses:

vendor/silverstripe/framework/templates/SilverStripe/Forms/FormField.ss

instead of:

themes/xyz/Forms/FormField.ss

In my config.yml, I have:

SilverStripe\View\SSViewer:
  themes:
    - 'xyz'
    - '$default'

How can I make it choose the xyz theme’s templates whenever they’re available instead of the default ones?

You need to place your theme files in the correct folder.

e.g. themes/xyz/SilverStripe/Forms/FormField.ss

Bingo, that’s solved my problem and fixed a lot of issues. Thanks.