The best investment you can make, is an investment in yourself... The more you learn, the more you'll earn. - Warren Buffett 

Featured

How to Fix Duplicate Database Queries for #__template_styles in Helix Ultimate?

Helix Ultimate is generating many duplicate database queries to the #__template_styles table.

SELECT * FROM `#__template_styles` WHERE `client_id` = 0 AND `id` = '9'
The query is executed from plugins/system/helixultimate/src/Platform/Helper.php:54

Everyone can test a temporary fix by modifying the following file:

/plugins/system/helixultimate/src/Platform/Helper.php

The updated function is:

 public static function getTemplateStyle($id = 0)
    {
    static $cache = [];
    if (isset($cache[$id])) {
    return $cache[$id];
    }
    $db = Factory::getDbo();
    $query = $db->getQuery(true);
    $query->select(array('*'));
    $query->from($db->quoteName('#__template_styles'));
    $query->where($db->quoteName('client_id') . ' = 0');
    $query->where($db->quoteName('id') . ' = ' . $db->quote($id));
    $db->setQuery($query);
    $cache[$id] = $db->loadObject();
    return $cache[$id];
   }

 

We use some essential cookies to make this website work. We also use cookies set by other sites to help us deliver content from their services.