Error 1064 - Question | JoomShaper
Black Friday sale is live with flat 50% OFF. Sale ends soon! Grab your deal now!

Error 1064

AM

ASG - Anerkannte Schulgesellschaft mbH

SP Page Builder 5 months ago

Hello,

after updating SP Page Builder 4 to the latest version 5.6.1, the following SGL error occurs in the frontend.

1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '8) ORDER BY lft ASC' at line 3

Please solve the problem quickly.

Best regards

0
3 Answers
Ziaul Kabir
Ziaul Kabir
Accepted Answer
Support Agent 5 months ago #196151

Hello,

Thanks for raeching out to us.

Please, check now, Your issues is resolved.

Thanks

0
AM
ASG - Anerkannte Schulgesellschaft mbH
Accepted Answer
5 months ago #196154

Ok, thank you. And what was the error? Just in case it happens again.

0
Ziaul Kabir
Ziaul Kabir
Accepted Answer
Support Agent 5 months ago #196161

There was query related issues when comes empty or null value in here

JROOT/components/com_sppagebuilder/helpers/articles.php:407

Fixed Code:

public static function getCategories($parent_id = [1], $include_subcategories = true, $child = false, $cats = array()) {

    $app = Factory::getApplication();
    $db = Factory::getDbo();
    $query = $db->getQuery(true);

    $query
        ->select('*')
        ->from($db->quoteName('#__categories'))
        ->where($db->quoteName('extension') . ' = ' . $db->quote('com_content'))
        ->where($db->quoteName('published') . ' = ' . $db->quote(1))
        ->where($db->quoteName('access') . " IN (" . implode(',', Factory::getUser()->getAuthorisedViewLevels()) . ")")
        ->where($db->quoteName('language') . " IN (" . $db->Quote(Factory::getLanguage()->getTag()) . ", " . $db->Quote('*') . ")");

    // Sanitize and check parent IDs
    $filteredIds = array_filter(array_map('intval', $parent_id));

    if (!empty($filteredIds)) {
        $query->where($db->quoteName('parent_id') . " IN (" . implode(',', $filteredIds) . ")");
    }

    $query->order($db->quoteName('lft') . ' ASC');

    $db->setQuery($query);
    $rows = $db->loadObjectList();

    foreach ($rows as $row) {
        if ($include_subcategories) {
            $cats[] = $row->id;
            if (self::hasChildren($row->id)) {
                $cats = self::getCategories([$row->id], $include_subcategories, true, $cats);
            }
        }
    }

    return $cats;
}
0