Create a Category (for example in articles)
Create a sub category of the former one
Unpublish the parent category.
This will also unpublish the child.
Now try to publish the child category
You will, rightfully get an error:
Error
Failed publishing 1 category as at least one of its parents is unpublished or one of its children is checked out.
But, we also a get 2 Notices in the php logs
[02-Nov-2016 16:24:32 UTC] PHP Notice: Array to string conversion in ROOT/libraries/joomla/table/nested.php on line 985
[02-Nov-2016 16:24:32 UTC] PHP Notice: Undefined variable: ntext in ROOT/libraries/legacy/controller/admin.php on line 237
I guess it would be good to get rid of these Notices.
Labels |
Added:
?
|
@mbabker
I resolve the first Notice by adding [0] as $pks comes from an array,
i.e.
if (!empty($rows))
{
$e = new UnexpectedValueException(
sprintf('%s::publish(%s, %d, %d) ancestors have lower state.', get_class($this), $pks[0], $state, $userId)
);
$this->setError($e);
return false;
}
But I remarked that we have quite a few instances of $pks alone in ROOT/libraries/joomla/table/nested.php
Shall I make a PR for All of them?
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-11-03 16:16:35 |
Closed_By | ⇒ | infograf768 |
Closed as there is a PR
I can get rid of the second notice.
Looking now at the first one.