joomla/joomla-cms — pull request #3870 by laoneo (2014-07-10 10:44:13+00:00)
Title: Check for unpublished/archived categories when flag is set

A check for bad categories should only be done when the publishing flag is set, otherwise it is not possible to gen an unpublished or archived category with the following code:

$categories = JCategories::getInstance('Foo', array(
'access' => false,
'published' => false
));
$category = $categories->get((int) $catid);