Skip to main content
Gary Pratten
Drupal Dev. SEO Obsessed. Always Online.
  • Home
  • About me
  • Blog Posts
  • Contact me

Breadcrumb

  1. Home
  2. How to upgrade Drupal 9 themes for Drupal 10 compatibility

How to upgrade Drupal 9 themes for Drupal 10 compatibility

Profile picture for user gazza
gazza
May 13, 2025
  • facebook-f
  • twitter
  • envelope
  • print

How to upgrade the most common problems found in Drupal 9 themes for Drupal 10 compatibility

.theme file in theme root:

Find Replace with
$node_content = render($node_content); $node_content = \Drupal::service('renderer')->render($node_content);
$node_comments = render($node_comments); $node_comments = \Drupal::service('renderer')->render($node_comments);

Amend deprecated functions in .theme file:

Find Replace with
file_create_url \Drupal::service('file_url_generator')->generateAbsoluteString
file_url_transform_relative \Drupal::service('file_url_generator')->transformRelative
file_url_transform_relative(file_create_url \Drupal::service('file_url_generator')->generateString
Drupal\Core\Url::fromUri(file_create_url \Drupal::service('file_url_generator')->generate
drupal_get_path \Drupal::service('extension.path.resolver')->getPath

In page.html.twig

Find Replace with
mt-no-opacity _
fade _

In .libraries.yml file

Find Replace with
core/jquery.once core/once

In any html.twig Template files

Find Replace with
{% spaceless %} {% apply spaceless %}
{% endspaceless %} {% endapply %}
1
min read
A- A+
  • facebook-f
  • twitter
  • envelope
  • print

What I Do

I now work closely with tradespeople all over the UK, helping them grow their businesses by developing and managing their online assets. This includes SEO, website development, and online marketing.

My background in the construction industry — combined with my marketing experience — gives me a unique edge in helping tradespeople.

What I Can Offer

Your target audience is out there knocking on your door — you just need to open it. Every day people are on the internet looking for your product or service. I help you invite them in with a professional online presence.

I offer my experience to help tradespeople avoid common pitfalls and maintain a strong, trustworthy company image online.

Who Am I?

I'm a Dad, Ex-Electrician, Musician, Online Marketer & Web Developer. I help tradespeople grow their businesses. I’m also 1/5th of the #RocknRoll group @rebornfiftynine.

I’ve worked in the electrical industry for the last 28 years, mostly in contracting, wholesaling, and manufacturing.

Website by Gary Pratten - Built using the Drupal CMS

Clear keys input element