Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strange beforeFind error #126

Closed
yii-joblo opened this issue Sep 27, 2013 · 13 comments
Closed

strange beforeFind error #126

yii-joblo opened this issue Sep 27, 2013 · 13 comments

Comments

@yii-joblo
Copy link

I checked out the current code.
Now I get the error 'CModelEvent.criteria' is not defined in EMongoDocument::beforeFind

$event = new CModelEvent($this);
$event->criteria = func_num_args() > 0 ? func_get_arg(0) : null;

This is right, because CModelEvent has no criteria property (or setCriteria() method).
But this line was in my last working code too, before updating ... strange.

@Sammaye
Copy link
Owner

Sammaye commented Sep 27, 2013

That is quite strange I am working on the latest now on the test repo.

What file is this in and the line? Unless it is your own code?

@yii-joblo
Copy link
Author

EMongoDocument line 439

@Sammaye
Copy link
Owner

Sammaye commented Sep 27, 2013

Holy crap I didn't see that sneak its way into there, I should find out who did that.

I can see why that code might be showing its ugly face, there was a change recently that actually made beforeFind() work.

I will get rid of that code.

@Sammaye
Copy link
Owner

Sammaye commented Sep 27, 2013

ff0f4a3 gone, checked this in CActiveRecord, it wasn't there so had no idea why it is there now.

@yii-joblo
Copy link
Author

Thanks

@rmatulat
Copy link

As a side note:
We received the mentioned error 'CModelEvent.criteria' with Yii 1.1.12.
It was gone in 1.1.13 so we never opened an issue here.

@Sammaye
Copy link
Owner

Sammaye commented Sep 27, 2013

Ahh, hmm I should look into exactly how that code got there when I have a moment but it seems weird and I definitely never put it there :S

@yii-joblo
Copy link
Author

ok, still working with 1.1.12, I should upgrade...

@rmatulat
Copy link

Regarding to git blame, it was rathil and you added a comment:

git blame -L435,+20 581ead3 -- EMongoDocument.php

:)

0f9c8ac5 protected/extensions/MongoYii/EMongoDocument.php (Sammaye 2013-01-31 13:16:33 +0000 438)                       // for backward compatibility
3b94beaa EMongoDocument.php                               (rathil  2013-08-29 15:51:39 +0300 439)                       $event->criteria = func_num_args() > 0 ? func_get_arg(0) : null;

@Sammaye
Copy link
Owner

Sammaye commented Sep 27, 2013

Which commit? That one sends to args in trace function which I reverted and my Eclipse shows the line all the way in history

@Sammaye
Copy link
Owner

Sammaye commented Sep 27, 2013

@Sammaye
Copy link
Owner

Sammaye commented Sep 27, 2013

I actualy see this at the beginning: https://github.com/Sammaye/MongoYii/blob/28235ce9ebcb4371247053354f66cb4d76e181b6/protected/extensions/MongoYii/EMongoDocument.php

I think this is some code I must have got from some place

@rmatulat
Copy link

Ok, maybe rathil just did some formatting. The mentioned commit did a lot of formatting, so I guess, thats why I missinterpreted git blame.

pahanini pushed a commit to pahanini/MongoYii that referenced this issue Nov 2, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants