fix false check in comic post
This commit is contained in:
parent
cd64f57885
commit
e90cd16563
|
@ -168,27 +168,29 @@ class ComicPressComicPost {
|
||||||
|
|
||||||
$normalized_children = $this->normalize_ordering($skip_checks);
|
$normalized_children = $this->normalize_ordering($skip_checks);
|
||||||
|
|
||||||
$remove_from_list = array();
|
|
||||||
foreach ($normalized_children as $id => $info) {
|
|
||||||
if (isset($info['children'])) {
|
|
||||||
$remove_from_list = array_merge($remove_from_list, array_values($info['children']));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$attachments_with_children = array();
|
$attachments_with_children = array();
|
||||||
foreach ($normalized_children as $id => $info) {
|
if (is_array($normalized_children)) {
|
||||||
if (!in_array($id, $remove_from_list)) {
|
$remove_from_list = array();
|
||||||
if ($info['enabled']) {
|
foreach ($normalized_children as $id => $info) {
|
||||||
$attachment = array('default' => $id);
|
if (isset($info['children'])) {
|
||||||
if (is_string($default_type)) { $attachment[$default_type] = $id; }
|
$remove_from_list = array_merge($remove_from_list, array_values($info['children']));
|
||||||
if (isset($info['children'])) {
|
}
|
||||||
$attachment = array_merge($attachment, $info['children']);
|
}
|
||||||
$remove_from_list = array_merge($remove_from_list, array_values($info['children']));
|
|
||||||
|
foreach ($normalized_children as $id => $info) {
|
||||||
|
if (!in_array($id, $remove_from_list)) {
|
||||||
|
if ($info['enabled']) {
|
||||||
|
$attachment = array('default' => $id);
|
||||||
|
if (is_string($default_type)) { $attachment[$default_type] = $id; }
|
||||||
|
if (isset($info['children'])) {
|
||||||
|
$attachment = array_merge($attachment, $info['children']);
|
||||||
|
$remove_from_list = array_merge($remove_from_list, array_values($info['children']));
|
||||||
|
}
|
||||||
|
$attachments_with_children[] = $attachment;
|
||||||
}
|
}
|
||||||
$attachments_with_children[] = $attachment;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $attachments_with_children;
|
return $attachments_with_children;
|
||||||
}
|
}
|
||||||
|
|
|
@ -210,7 +210,7 @@ class ComicPressComicPostTest extends PHPUnit_Framework_TestCase {
|
||||||
array('comic' => 'test-1', 'rss' => 'test-3', 'default' => 'test-1'),
|
array('comic' => 'test-1', 'rss' => 'test-3', 'default' => 'test-1'),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
array(false, array())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue