Upgrade Your Drupal Skills

We trained 1,000+ Drupal Developers over the last decade.

See Advanced Courses NAH, I know Enough
Jul 22 2020
Jul 22

This post will save you some headaches when upgrading Drupal core from 8.7 to 8.9 addressing some common challenges.

 

Drupal 9.0.0 has been released simultaneously with Drupal 8.9.0. Drupal 8.9 is a long-term support version that will be supported until November 2021. Versions of Drupal 8 prior to 8.8.x are end-of-life and do not receive security coverage. Upgrading an existing site that’s not yet running on the latest core 8.8 or 8.9 can be challenging due to some new changes in Drupal core.

 

 

If your site version is below 8.7 make sure you upgrade to 8.7 first because the process would be a lot smoother if you are on Drupal 8.7

 

Upgrading from Drupal 8.7 or 8.8 to 8.9

"drupal-scaffold": {

"locations": {

"web-root": "web/"

}

}

7. Run composer require drupal/core-recommended:^8.8 drupal/core:^8.8 drupal/core-composer-scaffold:^8.8 --update-with-dependencies

"drupal/core:^8.8" is added because the composer may not be able to resolve the dependency tree. The drupal/core-recommended is the new recommended project template for Drupal 8 projects. Once the above command is successful, you can run composer remove drupal/core to remove the package.

8. drush updatedb -y

9. drush cex -y

 

Update settings.php

Check settings.php files for the $config_directories variable and replace it with $settings['config_sync_directory'] = '../config/sites/default';

if you see an error like the one below after running composer command:

Installation failed, reverting ./composer.json to its original content. [RuntimeException] Could not delete /.../web/sites/default/default.services.yml:

You can resolve this with: chmod +w web/sites/default and run the composer command again.

 

Strange errors

If everything goes well and you see the site breaking on some pages like /admin/modules or any other page with this error in the log

Drupal\Core\Extension\Exception\UnknownExtensionException: The module does not exist or is not installed. in Drupal\Core\Extension\ExtensionList->getExtensionInfo() (line 346 of /app/web/core/lib/Drupal/Core/Extension/ExtensionList.php).

You can resolve that by running drush ev "\Drupal::configFactory()->getEditable('core.extension')->set('profile', 'standard')->save();" locally. This command enables the standard profile.

 

Note that you will need to run the same command on production before you can import configurations.

 

Do you have other tips or have questions, don’t hesitate to contact Fred.

 

Fred AgbemenyaWritten by Fred Agbemenya
Developer at Ramsalt Lab

 

 

Nov 22 2019
Nov 22

This article was originally posted on Thunder.org and is reposted here with the permission from Community Manager Julia Pradel. 

Not everyone has the necessary resources to engage their own design team. Our Certified Thunder Integrator (CTI) Ramsalt has recognized this need and developed a generic theme that will be available to other Thunder users as an open-source product.

The idea for the theme emerged a few years ago: “We wanted to develop a generic design which newspapers could easily customize to their individual needs” explains Ramsalt’s CEO Yngve Bergheim. “We had a starter kit in mind which could either be used as is, or easily tweaked by a designer.”

The first task was to gather all of the requirements for a design. We arranged focus groups with digital editors from several newspapers to understand their needs. “We also drew upon our own pool of experience,” says tech lead Stephan Zeidler. Ramsalt has made numerous magazines and newspapers since 2011. The analytic process ended up in a 51 pages design requirement specification and corresponding wireframes.

[embedded content]Example of Longform/featured articles


Art director Evgeny Pugachev led the design process while Stephan Zeidler was tech lead. The CTI Ramsalt Lab has offices in several countries among them Sweden, Norway, the Netherlands and Russia, and the Thunder development is directed from the German office in Berlin. According to Stephan, the greatest challenge with the theme’s development was ensuring that everything would be reusable - and at the same also be customizable. Stephan, therefore, relied on a component-based approach: “It is certainly significantly more complicated and takes longer at the beginning of the project but the risk of regressions is much reduced”.

Simple to adjust

The component-based approach also enables Stephan to capture updates from the numerous Drupal modules. “Since we use our own HTML templates rather than the standard Drupal templates, adjustments are much simpler than they would otherwise be.” Another advantage in his view is the lean markup which makes the site significantly quicker and also delivers plus points in terms of SEO aspects. The theme has also been put to the test and further optimized in order to achieve the best possible results in Google’s Pagespeed. It was a project by itself and led to the publication of a series of articles on Planet Drupal, under the heading The ultimate guide for faster Drupal.

The theme was conceptualized over a period of six months with two designers, challenged with the help of several customers and continuously developed along the way - and it is still a work in progress. The three-person development team working with Stephan, also wants to examine whether Drupal’s Color Module can be integrated and how the design could also be used as a demo theme by other CTIs.

 

Get the new design now!


For company chief, Yngve Bergheim, there is no question about whether the Ramsalt design will be made available to Thunder users: “Anyone that wants to try out the new design can drop us an email on [email protected]. - We want to use the theme as a showcase for publishers evaluating Thunder. Publishers already have the best technology in place in the Thunder distro, the best and biggest community. What is lacking now is a good looking design on the bodywork that fits the top-notch “Porsche” engineering we have in Thunder”, says Bergheim.

Open-source

The design is aimed to be released as an open-source module on drupal.org as soon as the integration with Thunder works seamlessly. There is still some work left: “The design currently makes many assumptions, like how the menu and various article variants look, that there is a search bar or that authors are shown with their names, pictures and even job titles” explains Stephan. The fields for these points did not exist in a standard Thunder. “And that is also a good thing, Thunder should remain as generic as possible” stresses Stephan. This does, however, pose him and his team the question of how the theme can, together with its Thunder installation, show its full effectiveness out of the box. Which is our goal, to have the theme in the Thunder distro eventually.

Jun 28 2019
Jun 28

Next step in our journey after Part 1 Caching and Part 2: Aggregation of our ultimate guide to Drupal performance is all about Drupal theming and this will be our part 3

The next part will be some general tips and tricks about CSS/JS and then we will release a full blown article containing all parts. so lets cut the intro and get right into it.

 

Faster Drupal - Part 3: Drupal Theming

  • Automate optimizing of CSS, JS & Images. The thing is, it really depends on the node packages that you use on your theme level and how you can take advantage of it, for instance, there are many (I MEAN MANY WITH ALL CAPS) packages that can help you achieve that using a build system such as gulp, grunt or the new favorite webpack.

  • Avoid using unnecessary bootstrap packages as much as possible. Usually, Starterkit themes load bootstrap packages one by one, why not remove the ones you don’t need? WHY? JUST TELL ME WHY?

  • Is your theme using fontAwesome or any other kind of font out of box? But you are using SVG icons from your design file! Well… why not just remove the built-in icon font from your theme then?

  • Fonts are nice, And it seems our designers usually like to use 12 billions of them in a single page, but you should never listen to your designer (Or should you?) Always remember to load fewer fonts and fewer font weights as much as possible.

  • While we are on the fonts topic:
    Control font performance with font-display - Resource

  • Are you the type that invents the wheel each time yourself? Then don’t use a base theme that comes with a lot of good stuff! we usually don't use half of those goodies. Create a new base theme off of Drupal core's "stable" theme and go with the bare minimum. Or use a proper Starterkit, strip off the unnecessary parts, get your own Starterkit and get rid of all the Drupal themes excessive wrappers and classes.
    On this note, it’s a good practice to get your DOM size less than 1500 nodes (recommended from Google Page Speed)
    For Drupal 7 also maybe just consider Fences module if nothing else works for you

  • Reduce the scope and complexity of style calculations

  • Prioritizing Your Resources with link rel='preload' and yes you can use <link> for scripts as well - Resource

  • When we were kids (Back in Windows XP era) you’d read everywhere that do not use inline styles for your HTML files, but now you should use inline-styling to avoid render blocking CSS files. All the CSS Styles loaded from external files is considered render blocking. Why You asked?
    In order for the browser to display your web page and use the styles you specified in the external CSS files, it has to load them first. This means that your web page won't be displayed until these files are loaded. In order to speed up the loading of your website, you can inline the parts from the external CSS files which are needed to render the above the fold content. After loading the page you can instruct the browser to load the rest of the CSS files via JS - There are many tools that you can use to achieve this but this one explains good enough and works: https://www.sitelocity.com/critical-path-css-generator
    Also, check penthouse as well, Can be set up easily as a task runner task!
    https://www.npmjs.com/package/penthouse - includes CSS for critical path above the fold in the HTML head.
    By the way, there’s a Drupal module for that (but we didn’t test it,  do so at your own risk)
    Our very own Sven played around with both penthouse and critical and let me just quote him in our slack chat here:
     

    critical is a wrapper for penthouse with the main advantage that it delivers critical css for several breakpoints in one file. 
    Note: To generate critical css, `link_css` module must be enabled, and you can not be using deter css loading in AdvAgg, otherwise you get an empty file. (Needs testing)


    Critical_css module on Drupal
  • Now that you have the critical CSS, the proper tool to load the rest of your CSS: https://github.com/filamentgroup/loadCSS

  • Remove unused CSS, there are tools inside the IDEs that can help you with that, you should search this part yourself since it depends on your weapon of choice for coding, also there are node packages that you can set up but I’d still go with the IDE approach and do it manually, just to be safe.

  • Use video tag instead of gif images (Yup, it loads faster)

  • Avoid using document.write, specifically for scripts injection - Resource

  • Images must not be delivered larger than they are actually displayed to avoid loading unnecessary data. Resizing images on the browser side to reduce their rendering size is not recommended.

 

Written by Sohail LajevardiSohail Lajevardi 
Developer at Ramsalt Lab 

 

May 20 2019
May 20

We are on our journey to master the Drupal performance, after having our previous Part 1: Caching published a couple of weeks ago, we've been lucky enough to get into Issue 386 of TheWeeklyDrop newsletter, Planet Drupal, and got much love and good feedback on Twitter.

If you haven't already read the first part of the series, the ultimate guide for faster Drupal: Part 1 Caching, please feel free to read that article too.


Note: You don't necessarily have to do all of these, some items listed here are replaceable with each other as well, so proceed with caution!

Faster Drupal - Part 2: Aggregation and CDN

  • The one and the only holy grail: Advanced CSS/JS Aggregation
    On every Drupal optimization post you’d read you have to setup and configure AdvAgg module, but you gotta do what you gotta do!
    AdvAgg features and core benefits are listed on the module page completely, so go ahead and read them all, configure it the way that works best for you and move on
    Advanced CSS/JS Aggregation Drupal module

    Note: If you have Mod Pagespeed you might not need AdvAgg module, make sure that you don't overlap your own work

    But that’s not all, if you are on Drupal 7, you should consider checking Speedy module as well, in some areas, this might work a bit better so make sure to check it out as well
    Speedy module

  • For good JavaScript minification in Drupal, you can use modules such as minify but we’d like to recommend minifyJS instead, they listed the differences and benefits on their module page so check it out
    Drupal MinifyJS module

  • CDNize the whole project, as much as you can! You may use CDN module too

  • Move JavaScript to the footer if necessary, some JS files need to be rendered in the head based on the use case and what does the JS do! Also in Drupal 8, it’s quite easy to append your necessary library (Read it JS files) in the footer in twig template files

  • Consider if you can make your own scripts defer/async (a new challenge when it comes to Drupal js aggregation)

Okay, this round was much easier thanks to AdvAgg module for taking care of half of the things we need to do for us! Note that on the frontend side you can Uglify, Minify and make sure everything that you code, will become compressed, whether it’s CSS, JS or even images or SVG files! Now let's get to it, Image optimization. 

Image optimization

  • Drupal 8: Use the Responsive Image module wherever possible and create the appropriate styles. It uses the <picture> tag which is what we really want

  • One might say we have one too many image optimization modules in Drupal, which is a good thing! For that we tested some, experienced with some of them and here’s what we suggest: Use blazy and lazyload_images (Drupal 8 that uses IntersectionObserver instead of scrolling events), Also consider: lazyloader and image_lazy_loader when using the picture module for responsive images in Drupal 7. There is also a lazy loading option that works well

  • Image optimization: for main images/icons used in the design (Yes you can optimize SVG files as well), also the best tool for that is not in Drupal, try ImageOptim desktop app, Also there’s an API-based service available with a Drupal 7 module, take a look here, might worth setting/selling this up to clients

    Also in the same context, we can use ReSmush.it which is free (But should donate some beer to them)
    Drupal 7 Module, Drupal 8 Module

  • Image formats like JPEG 2000, JPEG XR, and WebP often provide better compression than PNG or JPEG, which means faster downloads and less data consumption. There's a really good module that help you serve WebP, it's called, you guessed it; WebP.

  • Serve WebP images with your web server with the MOD PageSpeed by Google for Apache and Nginx.
    Or conditionally serving WebP images with Nginx.
     

Bonus tip: Even favicons should be optimized. Sometimes people ignore the weight of a favicon file. You shouldn’t! 

 

For the next week, we will be covering subjects regarding Drupal database/web server tweaks & improvements, stay tuned.

 

Written by Sohail LajevardiSohail Lajevardi
Developer at Ramsalt Lab

 

How we built Expo.se - Magazine nominated for three publishing awards

Sep 19 2018
Sep 19
Aug 27 2018
Aug 27

Expo just got nominated for two prestigious publishing awards in Sweden, best magazine and best magazine website. The winners will be announced 7th of November 2018 in Stocholm where Ramsalt Lab will be present. We are very excited for this news and have decided to share with you the secrets behind building Expo.se on Drupal. So stay tuned for more the following days. 

Short about the Expo 

Expo is a Swedish anti-racist magazine started in 1995 by Stieg Larsson, also known as the author of the Millennium novel series, where the inspiration comes from Expo. Expo magazine is issued by the non-profit Expo Foundation. The magazine contains investigative journalism focused on nationalist, racist, anti-democratic, anti-semitic, and far-right movements and organisations. Expo became widely known in Sweden after 1996 following a string of threats and attacks directed against companies printing and selling the magazine, and organisations supporting it. The magazine is headquartered in Stockholm. More about Expo on Wikipedia

Have a look at the website on Expo.se

Webcast: How to get your Drupal site GDPR ready

Jun 01 2018
Jun 01
Jun 01 2018
Jun 01

Is your website ready for GDPR? Changes to the legislation mean that you must now request consent to handle personal data. Sven Berg Ryen from Ramsalt Lab will provide an overview of useful GDPR modules in Drupal, including demonstration of the EU Cookie Compliance module that he has been maintainer for the last four years.

Do you need help to make your website GDPR complient? Contact us and Sven Berg Ryen and our GDPR team will get in touch.  

Watch the saved webcast: 


[embedded content]

Link to slideshow.

The presentation will be streamed and published at drupalnorge.no/gdpr

Current modules that Sven will review:
EU Cookie Compliance https://www.drupal.org/project/eu_cookie_compliance (Sven is maintanier)
GDPR https://www.drupal.org/project/gdpr
GDPR Consent https://www.drupal.org/project/gdpr_consent
GDPR Simplenews https://www.drupal.org/sandbox/andreasspeck/2973749
GDPR Export https://www.drupal.org/project/gdpr_export
F1 GDPR https://www.drupal.org/sandbox/caesius/2973123
Commerce GDPR https://www.drupal.org/project/commerce_gdpr
GDPR Form Compliance https://www.drupal.org/project/gdpr_form_compliance
Backup and Migrate Sanitizer https://www.drupal.org/sandbox/lyalyuk/2940049
Scrambler https://www.drupal.org/project/scrambler
IP Anonymize https://www.drupal.org/project/ip_anon
Mask User Data https://www.drupal.org/project/mask_user_data
Cryptolog https://www.drupal.org/project/cryptolog

Drupal Talk Berlin: Get GDPR ready

May 20 2018
May 20
May 20 2018
May 20

As part of an internal workshop week, Ramsalt Lab is hosting a Drupal talk, with focus on GDPR.

Start:  2018-05-30 19:00 - 21:00 Europe/Berlin

Agenda

  • @svenbergryen talks about the EU Cookie Compliance and related GDPR modules?
  • How was the introduction of the GDPR handled?
  • Which challenged did you encountered?
  • Which uncertainties do you have when using Drupal or specific modules?
  • Beers and Cheers

As we're a international team, the event will be held in English.

Signup

Building the ultimate frontpage solution with Thunder and Drupal

Mar 09 2018
Mar 09

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web