diff --git a/classes/ComicPressComicPost.inc b/classes/ComicPressComicPost.inc index bf14574..5ebd1d6 100644 --- a/classes/ComicPressComicPost.inc +++ b/classes/ComicPressComicPost.inc @@ -167,10 +167,11 @@ class ComicPressComicPost { $attachments_with_children = array(); foreach ($this->normalize_ordering($skip_checks) as $id => $info) { if ($info['enabled']) { - $attachments_with_children[$id] = array(); + $attachment = array('id' => $id); if (isset($info['children'])) { - $attachments_with_children[$id] = $info['children']; + $attachment['children'] = $info['children']; } + $attachments_with_children[] = $attachment; } } return $attachments_with_children; diff --git a/test/ComicPressComicPostTest.php b/test/ComicPressComicPostTest.php index d455aec..2ec73ad 100644 --- a/test/ComicPressComicPostTest.php +++ b/test/ComicPressComicPostTest.php @@ -195,8 +195,8 @@ class ComicPressComicPostTest extends PHPUnit_Framework_TestCase { 'test-4' => array('enabled' => false), ), array( - 'test-1' => array(), - 'test-2' => array() + array('id' => 'test-1'), + array('id' => 'test-2') ) ), array( @@ -205,7 +205,7 @@ class ComicPressComicPostTest extends PHPUnit_Framework_TestCase { 'test-2' => array('enabled' => false, 'children' => array('rss' => 'test-4')), ), array( - 'test-1' => array('rss' => 'test-3'), + array('id' => 'test-1', 'children' => array('rss' => 'test-3')), ) ),