Page 2 of 3
1 · 2 · 3

Victor :: 04.03.2013 09:13:56
Hi lecterror

Thank you for fixing the other errors. The only error that i am getting and which needs to be fixed is the 1 below

Strict (2048): Declaration of PolymorphicBehavior::setup() should be compatible with ModelBehavior::setup(Model $model, $config = Array) [APP\Plugin\Feedback\Model\Behavior\PolymorphicBehavior.php, line 148]

Strict (2048): Declaration of PolymorphicBehavior::afterFind() should be compatible with ModelBehavior::afterFind(Model $model, $results, $primary) [APP\Plugin\Feedback\Model\Behavior\PolymorphicBehavior.php, line 148]
Victor :: 04.03.2013 11:04:48
Managed to fix the problem by doing this

Just tweaking the plug-in files to make the suggested changes. The reference implementations is this:

public function setup(Model $model, $config = array()) {
public function afterFind(Model $model, $results, $primary) {
Damion Young :: 26.07.2013 10:02:25
This is a great Plugin - thank you - and much easier to understand than the CakeDC Ratings Plugin. However, while it is displaying correctly and saving to the db, I don't know how to get it to show previously submitted votes - I get empty stars and 'Rating: 0.00 Votes: 0'. The data which is coming being passed to the view where I call:

$this->Ratings->display_for($tip, array('model'=>'Tip'));

is in this format:

'Tip' => array(
(int) 0 => array(
'title' => '',
'slug' => '',
'description' => '',
'id' => '3',
'modified' => '2012-01-19 06:40:44',
'user_id' => '4',
'Comment' => array(),
'Rating' => array(
(int) 0 => array(
'id' => '2',
'foreign_model' => 'Tip',
'foreign_id' => '3',
'author_ip' => '127.0.0.1',
'rating' => '2.5',
'created' => '2013-07-25 20:49:31'
)
)

Is is expecting something else?

Many thanks again

Damion

lecterror :: 28.07.2013 23:17:05
Hi Damion!

How are you retrieving the data? The plugin is expecting data as it is returned by this call:

$this->Tip->read(null, $id)

When in doubt, always peek at the unit tests, most of the time there's a clue there.
Damion Young :: 29.07.2013 10:19:52
Thanks lecterror. Realised this last night - I had been trying to attach it to tips returned by the UsersController as User->Tip...will have to have a bit of a rethink about how to read one tip at a time...possibly ajax loading of tips.
Damion