Commit b55a5bc9 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Fix warning when trying to render an empty feed



Change-Id: Iab7aac11915b19d0c3e306949513dfc90e6a82c6
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent 0043cc83
...@@ -68,8 +68,10 @@ class PluginBlocktypeExternalfeed extends SystemBlocktype { ...@@ -68,8 +68,10 @@ class PluginBlocktypeExternalfeed extends SystemBlocktype {
$data->image = unserialize($data->image); $data->image = unserialize($data->image);
// only keep the number of entries the user asked for // only keep the number of entries the user asked for
$chunks = array_chunk($data->content, isset($configdata['count']) ? $configdata['count'] : 10); if (count($data->content)) {
$data->content = $chunks[0]; $chunks = array_chunk($data->content, isset($configdata['count']) ? $configdata['count'] : 10);
$data->content = $chunks[0];
}
// Attempt to fix relative URLs in the feeds // Attempt to fix relative URLs in the feeds
if (!empty($data->image['link'])) { if (!empty($data->image['link'])) {
......
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