Jump to:

10931 Posts in 2614 Topics by 1810 members

All other Modules

SilverStripe Forums » All other Modules » Rating Module

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1287 Views
  • lanks
    Avatar
    Community Member
    61 Posts

    Rating Module Link to this post

    I am trying to get the rating module to work. When clicking the rate button to rate the website is crashing with this error:

    [User Error] Uncaught Exception: Object->__call(): the method 'data' does not exist on 'RatingControllerDecorator'
    POST /test232/sample-blog-entry/RatingForm

    Line 515 in /var/www/test232/sapphire/core/Object.php
    Source

    506             case isset($config['function']) :
    507                return $config['function']($this, $arguments);
    508             
    509             default :
    510                throw new Exception (
    511                   "Object->__call(): extra method $method is invalid on $this->class:" . var_export($config, true)
    512                );
    513          }
    514       } else {
    515          throw new Exception("Object->__call(): the method '$method' does not exist on '$this->class'");
    516       }
    517    }
    518    
    519    // -----------------------------------------------------------------------------------------------------------------
    520    
    521    /**

    Trace

    * Object->__call(data,Array)
    * RatingControllerDecorator->data()
    Line 39 of RatingControllerDecorator.php
    * RatingControllerDecorator->Rate(Array,Form,HTTPRequest)
    * call_user_func_array(Array,Array)
    Line 489 of Object.php
    * Object->__call(Rate,Array)
    * BlogEntry_Controller->Rate(Array,Form,HTTPRequest)
    Line 241 of Form.php
    * Form->httpSubmission(HTTPRequest)
    Line 129 of RequestHandler.php
    * RequestHandler->handleRequest(HTTPRequest)
    Line 143 of RequestHandler.php
    * RequestHandler->handleRequest(HTTPRequest)
    Line 122 of Controller.php
    * Controller->handleRequest(HTTPRequest)
    Line 29 of ModelAsController.php
    * ModelAsController->handleRequest(HTTPRequest)
    Line 277 of Director.php
    * Director::handleRequest(HTTPRequest,Session)
    Line 121 of Director.php
    * Director::direct(/sample-blog-entry/RatingForm)
    Line 118 of main.php

    It is crashing on this line of code trying to call a method "data()" that doesn't seem to exist. So I am not too sure if this is a method or if its a mistake and is meant to be a different method:

    $this->data()->Rate((int)$data['Rating'], $this->owner->getRequest()->getIP());

    If anyone has any ideas as to what it's trying to do that would be great. I think it's possible this method could have been taken out as I believe this module hasn't been updated for some time.

  • lanks
    Avatar
    Community Member
    61 Posts

    Re: Rating Module Link to this post

    Heres the whole function and the link to the module if anyone can help.

    function Rate($data) {
    $this->data()->Rate((int)$data['Rating'], $this->owner->getRequest()->getIP());

    if (Director::is_ajax()){
    FormResponse::add('Application updated', 'good');
    return FormResponse::respond();
    }
    else {
    Director::redirectBack();
    }
    }

    Link to download: http://open.silverstripe.com/changeset/latest/modules/rating/trunk?old_path=/&filename=/modules/rating/trunk&format=zip

    1287 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.