Tuesday, January 26, 2021

Drupal 8, 9, Debugging Twig templates, The website encountered an unexpected error

Drupal 8 and drupal 9 is not something we used to, like drupal 7, its is entirely disffrent code base and templating engine. for this new dcenario we need to be able to keep our dubugging skills upto date as the new drupal 8 and 9 thorwing errors on us and if we are able to fix it, chances are, we are going to install fresh copy of drupal each time, thiis is what I have heard from some developers and alos eaperinced in early version of drupal 8.

The website encountered an unexpected error. Please try again later.

This is somthing you will see if each time if having any error in yu code.

1) Goto sites/ and copy example.settings.local.php

Paste in > sites/default and rename it to settings.local.php

2) goto the settings.local.php file and uncomment the following line if commented.

$config['system.logging']['error_level'] = 'verbose';

3) goto edit settings.php in same sites/default directory and uncommnet the following line:

 if (file_exists($app_root . '/' . $site_path . '/settings.local.php')) {

   include $app_root . '/' . $site_path . '/settings.local.php';

 }


Additionally add following line in settings.local.php

error_reporting(E_ALL); ini_set('display_errors', TRUE); ini_set('display_startup_errors', TRUE);


Above solution will produce all errors on your screen that help you to fix the error.




Monday, January 11, 2021

Drupal 9 is released

On June 30 2020, Drupal 9 is now relased with a stable version. All the reouces from drupal 8 like themes and modules can be use for drupal 9, it share same admin look & feel almost everything look wise.

download drupal 9