?
avatar infograf768
infograf768
20 Sep 2016

Steps to reproduce the issue

Load the articles manager
Fatal error: Can't use method return value in write context in ROOT/administrator/components/com_content/models/articles.php on line 329

avatar infograf768 infograf768 - open - 20 Sep 2016
avatar infograf768
infograf768 - comment - 20 Sep 2016

Looks like it would be solved by using ! instead of empty? I.e.

if (JPluginHelper::isEnabled('content', 'vote'))
        {
            $orderCol  = !($this->state->get('list.fullordering', 'a.id')) ? 'a.id' : $this->state->get('list.fullordering', 'a.id');
            $orderDirn = '';
        }
avatar alikon
alikon - comment - 20 Sep 2016

#11225 has been tested on 3.6.x branch not on 3.7 branch I'll look at it
with the 3.7...

On 20 Sep 2016 9:13 am, "infograf768" notifications@github.com wrote:

Looks like it would be solved by using ! instead of empty? I.e.

if (JPluginHelper::isEnabled('content', 'vote'))
{
$orderCol = !($this->state->get('list.fullordering', 'a.id')) ? 'a.id' : $this->state->get('list.fullordering', 'a.id');
$orderDirn = '';
}


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#12095 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AALFsSHLLKwSw_YHHl6x80Khld8x0_Gfks5qr4e0gaJpZM4KBSgQ
.

avatar zero-24 zero-24 - change - 20 Sep 2016
Labels Added: ? ?
avatar sovainfo
sovainfo - comment - 20 Sep 2016

Seriously?

$orderCol = !($this->state->get('list.fullordering', 'a.id')) ? 'a.id' : $this->state->get('list.fullordering', 'a.id');

for

$orderCol = $this->state->get('list.fullordering', 'a.id');

avatar infograf768
infograf768 - comment - 20 Sep 2016

What we have now and causes the Fatal error is:

        if (JPluginHelper::isEnabled('content', 'vote'))
        {
            $orderCol  = empty($this->state->get('list.fullordering', 'a.id')) ? 'a.id' : $this->state->get('list.fullordering', 'a.id');
            $orderDirn = '';
        }
avatar sovainfo
sovainfo - comment - 20 Sep 2016

Indeed, should never have been accepted!

avatar ggppdk
ggppdk - comment - 20 Sep 2016

How many people test with PHP 5.3 and 5.4 ?
empty() in these versions, works on variable only

avatar infograf768
infograf768 - comment - 20 Sep 2016

My test was on php 5.4.4

avatar mbabker
mbabker - comment - 20 Sep 2016

All you need is the line @sovainfo pointed out, $orderCol = $this->state->get('list.fullordering', 'a.id');. If you have to check if the state's value is empty after you've pulled from the object then you've royally screwed something up along the way. If it can't be empty don't allow an empty value to be saved to the state!

avatar ggppdk
ggppdk - comment - 20 Sep 2016

@infograf768

My test was on php 5.4.4

yes i understood that because you got the error,
but i meant not your test , i meant the 2 human "acceptance" tests on every PR

avatar alikon
alikon - comment - 20 Sep 2016

@infograf768 i'm unable to reproduce on PHP Version 5.5.30

just want to remember that still minimum Requirements for Joomla! 3.x is 5.3.10

and yes should be $orderCol = $this->state->get('list.fullordering', 'a.id'); my mistake
i'll fix it

avatar sovainfo
sovainfo - comment - 20 Sep 2016

People are known to make mistakes, procedures are in place to avoid mistakes getting into the product. That doesn't mean every mistake is caught! Luckily, this one was.

Of the almost 500 $this->state->get statements in the product a few also use escape() around it. Don't know whether it needs it.

avatar zero-24 zero-24 - change - 20 Sep 2016
Labels Removed: ?
avatar zero-24
zero-24 - comment - 20 Sep 2016

Closing as there is a PR. Thanks!

avatar zero-24 zero-24 - change - 20 Sep 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-09-20 17:19:26
Closed_By zero-24
avatar zero-24 zero-24 - close - 20 Sep 2016

Add a Comment

Login with GitHub to post a comment