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.

Arguments in plugin function

edited December 2009 in Vanilla 2.0 - 2.8
Hi,

I debug a plugin (Score) to understand how to plug Garden/Vanilla.
I have an url like :
garden/vanilla/discussion/score/84/Pos/ZCRWU503BXB2?Target=discussion%2F26%2Frapport-de-bug-probl-me

In the plugins/VanillaCommentScore/class.commentscore.plugin.php we find :
public function DiscussionController_Score_Create(&$Sender, $Args) {

So I have take a look to pluginmanager classe and, normaly, this class and especialy function CallNewMethod returns the arguments into my function. But when I do a var_dump on $Args, it returns nothing.

How fixe this prob ?

Comments

  • When I var_dump($Sender) into CallNewMethod, I obtain this :

    ["EventArguments"]=> array(0) { } ["Returns"]=> array(0) { } ["HandlerType"]=> string(6) "NORMAL" } ["ModuleSortContainer"]=> string(0) "" ["OriginalRequestMethod"]=> string(5) "score" ["RedirectUrl"]=> string(0) "" ["RequestArgs"]=> array(3) { [0]=> string(2) "84" [1]=> string(3) "Pos" [2]=> string(12) "ZCRWU503BXB2" }

    So, EventArguments (this stuff is supposed return me the differents arguments) it's empty; only OriginalRequestMethod contains them.
  • SS ✭✭
    edited December 2009
    Url: /garden/plugin/mymethod/myarg1/myarg2/myarg3/

    PluginController_MyMethod_Create(&$Sender, $Args){ // $Sender = $PluginController // $Args[0] = myarg1 // $Args[1] = myarg2 // $Args[2] = myarg3 // .... }
  • OK so I tried :
    /garden/discussion/score/var1/var2

    But when I test $Args var i have something like :
    $Args[0] = 's';
    $Args[1] = 'c';

    $Args contains "score".

    But now, when I var_dump($Sender->RequestArgs) (instead of $Sender->EventArguments) I have the good result.

    I have still something wrong ?

  • SS ✭✭
    edited December 2009
    delete
Sign In or Register to comment.