Install a fresh version.
Then go to com_content, categories, trash and delete the category.
A warning, something like "Delete not possible. You must have at least one category"
The category is deleted.
The view artices now throws the error:
Argument 1 passed to Joomla\Utilities\ArrayHelper::getColumn() must be of the type array, boolean given, called in administrator\components\com_content\Model\ArticlesModel.php on line 516
All versions and probably all extensions which use categories
Status | New | ⇒ | Discussion |
As you can create a category on the fly within the article edit form there shouldnt be a reason that you cannot delete all empty categories
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-04-02 15:31:12 |
Closed_By | ⇒ | chmst |
@brianteeman you are right.
@mbabker After a new installation this error has diappeared. Sorry for wrong alert.
There's still a bug to be addressed and something should be open (either this with the title corrected or a new item) to address it. This line does not check for a boolean false return, meaning there is no error handling and that should be fixed to prevent the fatal error you posted in your original post.
Status | Closed | ⇒ | New |
Closed_Date | 2019-04-02 15:31:12 | ⇒ | |
Closed_By | chmst | ⇒ |
unable to replicate with
both
..index.php?option=com_content
and
...index.php?option=com_categories&extension=com_content
gives expected result
No Matching Results
what i'm missing ?
The title is not relevant at this point. As I noted in #24452 (comment) the bug is the lack of error checking when calling $this->getItems()
, if for some reason that returns a boolean false that scenario is not accounted for which results in the "Argument 1 passed to Joomla\Utilities\ArrayHelper::getColumn() must be of the type array, boolean given, called in administrator\components\com_content\Model\ArticlesModel.php on line 516" fatal error from the original issue post. You're not going to replicate this issue without breaking something else.
As I said, the error has diappeard after a new installation. Probably it was a database update between the last pulls which caused the error.
did you mean after
something like
if (!$items)
{
return false;
}
?
Right.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-04-02 17:51:28 |
Closed_By | ⇒ | franz-wohlkoenig |
Closed_By | franz-wohlkoenig | ⇒ | joomla-cms-bot |
Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/24452
Title |
|
Nothing says that there must be at least one category.
Actually, that specific error at that specific line means that nobody is doing error checking in the
getTransitions
method, a common missing thing in Joomla's code. ThegetItems
doc block clearly indicates a boolean false is returned on failure.