Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Some strange issue detected with print discussions

steamsteam www.planamigo.org - #1 foro planes amigo

Hi,
I have detected some strange and important issue when I was printing print_r($Sender); on DiscussionsController_BeforeDiscussionContent_Handler

I have a 22 discussions but when I print on my plugin like:
public function DiscussionsController_BeforeDiscussionContent_Handler($Sender) { print_r($Sender); }
I can find 67 matches of discusion text. It seems to recur discussion.

I have disabled all plugins and applications and still have this issue.
I do not understand why it prints with print_r($Sender); more than 22 times and with echo "some text"; its print 22 times (22 discussions).

I will appreciate any help and sugestion. Thanks.

Comments

  • steamsteam www.planamigo.org - #1 foro planes amigo
    edited December 2015

    I have created new test discussion with text - "test discussion description" and now there are 70 matches "test discussion description" ...

    I do not understand anything ...

  • hgtonighthgtonight ∞ · New Moderator

    That specific even gets fired before each discussion's content.

    The sending variable ($Sender) is the object that fired the event (DiscussionsController). The controller has a reference to the model object which has the result set. The model object has a reference to the database object which probably has the result cached somewhere.

    Is there some concern you have?

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • steamsteam www.planamigo.org - #1 foro planes amigo

    @hgtonight dijo:
    That specific even gets fired before each discussion's content.

    The sending variable ($Sender) is the object that fired the event (DiscussionsController). The controller has a reference to the model object which has the result set. The model object has a reference to the database object which probably has the result cached somewhere.

    Is there some concern you have?

    Thanks for reply, I thought no one answers me.

    My concern is if this is a bug on performance. Now I have a 22 discussions but it will growing and if it print x times the same... I don't understand why clone the same object and if it not have been cloned why it is printed x times.

    Maybe I don't understand how it works but I was expected only one time print object.

  • hgtonighthgtonight ∞ · New Moderator

    The event only fires 22 times, but the object can store as many references as it wants.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • steamsteam www.planamigo.org - #1 foro planes amigo

    @hgtonight dijo:
    The event only fires 22 times, but the object can store as many references as it wants.

    I hope so. Thanks @hgtonight

Sign In or Register to comment.