This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

axomat
axomat

Hi I am really struggling to understand what might be going on here. This is the onrun method from a component class that used to work fine until today. Now the class variables are not behaving as you would expect. A simple test shows the problem.

public function onRun()
{
    $this->test = 'test';
    dd($this->test);
}

This produces an output of null. Does anyone have any clue what might be going on? The weird thing is that it works correctly if the property ($test in this case) is declared explicitly at the top of the class. I did not have to do that until today. I had just done an october update but I really dont think this could have caused the problem. Thanks

Last updated

axomat
axomat

I have done another test, I used the same code above on a older version of october and it worked fine, just as expected.

Then I upgraded to the latest version and reproduced the same problem. So it looks more like an upgrade problem than I thought. Has anyone else noticed this?

ndcisiv
ndcisiv

I'm just noticing it as we speak. Find an answer?

Tschallacka
ndcisiv
ndcisiv

hah! You are correct. Thought about it a bit more, and realized what the underlying problem was. ME! Trying to do something completely un-necessary, but works now.

axomat
axomat

Yes I was wrong, Daftspunk explained what I was doing wrong.

1-6 of 6

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.