?
avatar infograf768
infograf768
3 Nov 2016

Steps to reproduce the issue

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.

avatar infograf768 infograf768 - open - 3 Nov 2016
avatar joomla-cms-bot joomla-cms-bot - change - 3 Nov 2016
Labels Added: ?
avatar infograf768
infograf768 - comment - 3 Nov 2016

I can get rid of the second notice.
Looking now at the first one.

avatar infograf768
infograf768 - comment - 3 Nov 2016

@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?

avatar infograf768 infograf768 - change - 3 Nov 2016
The description was changed
avatar infograf768 infograf768 - edited - 3 Nov 2016
avatar infograf768 infograf768 - change - 3 Nov 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-11-03 16:16:35
Closed_By infograf768
avatar infograf768 infograf768 - close - 3 Nov 2016
avatar infograf768 infograf768 - close - 3 Nov 2016
avatar infograf768
infograf768 - comment - 3 Nov 2016

Closed as there is a PR

#12737


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/12726.

Add a Comment

Login with GitHub to post a comment