fix dblayer error

This commit is contained in:
Jean-Christian Denis 2022-12-17 11:39:44 +01:00
parent 8a3745b116
commit b1f8cda044
Signed by: JcDenis
GPG key ID: 1B5B8C5B90B6C951

View file

@ -94,14 +94,20 @@ class pubSaba
$params['limit'] = [(($_page_number - 1) * $params['limit']), $params['limit']];
# get posts
$posts = dcCore::app()->blog->getPosts($params);
if ($posts->isEmpty()) { // hack: don't breack context
$params = ['limit' => $params['limit']];
$posts = dcCore::app()->blog->getPosts($params);
}
dcCore::app()->ctx->post_params = $params;
dcCore::app()->ctx->posts = dcCore::app()->blog->getPosts($params);
dcCore::app()->ctx->posts = $posts;
unset($params);
}
dcCore::app()->ctx->saba_options = $options;
}
public static function getPostsParams($params)
public static function getPostsParams(&$params)
{
if (!isset($params['sql'])) {
$params['sql'] = '';