How to correct the Themler crash after updating to Joomla 3.9

If you updated to the latest version and the following error appears when you try to launch Themler please follow the instruction below:

Fatal error: require_once(): Failed opening required '[...]/administrator/includes/toolbar.php' (include_path='.:/usr/lib/php7.2') in [...]/templates/[theme_name]/app/index.php on line 25

  1. Open theme folder on the server: www/Joomla_directory/templates;
  2. open /app folder;
  3. open index.php for editing in any html or text editor;
  4. find the line
    require_once JPATH_BASE . DS . 'includes' . DS . 'toolbar.php';
    and replace it with the following line:
    $prefix = version_compare(JVERSION, '3.9', '>=') ? 'sub' : '';
    require_once JPATH_BASE . DS . 'includes' . DS . $prefix . 'toolbar.php';
  5. open /app/start folder;
  6. open data.php file for editing and follow step 4;
  7. open manifest.php file for editing and follow step 4;
  8. start Themler.

Loading