Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product

In this Discussion

Vanilla 2.6 is here! It includes security fixes and requires PHP 7.0. We have therefore ALSO released Vanilla 2.5.2 with security patches if you are still on PHP 5.6 to give you additional time to upgrade.

Need help with the event UserCell

R_JR_J Cheerleader & TroubleshooterMunich Moderator

For the dashboard users view, there are two files that contain a FireEvent['UserCell']:
https://github.com/vanilla/vanilla/blob/2.1/applications/dashboard/views/user/index.php#L51
https://github.com/vanilla/vanilla/blob/2.1/applications/dashboard/views/user/users.php#L37-38

In the index.php I can add my TH tag and in the users.php I can add my user data. Sounds good, but I can't manage to get it working. My first problem has been to determine which of both Events is called. I've take that approach:

    public function userController_userCell_handler ($Sender) {
        if (!isset($Sender->EventArguments['User'])) {
            echo '<th>rubbish</th>';
        } else {
            echo '<td>'.$Sender->EventArguments['User']->Name.'</td>';
        }
    }

In the users.php the current user is passed as a EventArgument. If it is not set, I must be in the index.php, and if it is set, I can show some information from the User object.
To my big surprise, I have no entry in the first row, and in the second row I see the name of user one in my "rubbish" column! I keep staring at the code but cannot find any solution for that.

Can anyone explain to me why this is happening?

Comments

  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    HA! It's a typo in Vanilla! They wrote EventArgs while it must be EventArguments and the User is set later on correctly as an EventArguments and that's why it appears as shifted! BINGO!

    So please forget my question.

    hgtonightBleistivt
Sign In or Register to comment.