Commit 84b1d6b7 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Make sure recentposts query has a limit for existing blocktypes


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent 334dbbbe
......@@ -46,8 +46,8 @@ class PluginBlocktypeRecentposts extends PluginBlocktype {
$configdata = $instance->get('configdata');
$result = '';
isset($configdata['count']) ? $configdata['count'] : 10;
$limit = isset($configdata['count']) ? (int) $configdata['count'] : 10;
if (!empty($configdata['artefactids'])) {
$artefactids = implode(', ', array_map('db_quote', $configdata['artefactids']));
if (!$mostrecent = get_records_sql_array(
......@@ -59,7 +59,7 @@ class PluginBlocktypeRecentposts extends PluginBlocktype {
AND a.parent IN ( ' . $artefactids . ' )
AND a.owner = (SELECT "owner" from {view} WHERE id = ?)
ORDER BY a.ctime DESC
LIMIT ' . $configdata['count'], array($instance->get('view')))) {
LIMIT ' . $limit, array($instance->get('view')))) {
$mostrecent = array();
}
// format the dates
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment