Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion gii/mongoCRUD/templates/defaul t/admin.php

Received: by 10.142.196.11 with SMTP id t11mr673257wff.36.1300826590498;
        Tue, 22 Mar 2011 13:43:10 -0700 (PDT)
X-BeenThere: yiimongodbsiute@googlegroups.com
Received: by 10.142.97.18 with SMTP id u18ls3672386wfb.2.p; Tue, 22 Mar 2011
 13:43:09 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.142.195.3 with SMTP id s3mr448317wff.21.1300826589946; Tue, 22
 Mar 2011 13:43:09 -0700 (PDT)
Received: by f15g2000pro.googlegroups.com with HTTP; Tue, 22 Mar 2011 13:43:09
 -0700 (PDT)
Date: Tue, 22 Mar 2011 13:43:09 -0700 (PDT)
In-Reply-To: <717a5155-821d-401e-bdc5-8bf4bf5508b9@q40g2000prh.googlegroups.com>
X-IP: 173.65.190.34
References: <f8616d23-b551-45e4-923a-909840b63dbf@8g2000prt.googlegroups.com>
 <4D5D8A9B.2030701@gmail.com> <8fb9132c-b1f3-437f-bb21-068451d52c8f@b15g2000pra.googlegroups.com>
 <8122b4cb-6cca-45db-b721-e1818a08010c@l22g2000pre.googlegroups.com> <717a5155-821d-401e-bdc5-8bf4bf5508b9@q40g2000prh.googlegroups.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US)
 AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.151 Safari/534.16,gzip(gfe)
Message-ID: <5a6d5f51-e126-42cb-a86e-26980457ab29@f15g2000pro.googlegroups.com>
Subject: Re: gii/mongoCRUD/templates/default/admin.php
From: nickelstar <nickcga...@gmail.com>
To: YiiMongoDbSuite <yiimongodbsiute@googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

I too had this same issue. After debugging, it appears the trouble
maker is line 1284 in EMongoDocument.php which is the return line of
the search() method:

 return new EMongoDocumentDataProvider($this);

I changed it to:

return $this;

And the issue was resolved. The problem is that the admin.php view
passes $model->search() as the first parameter to the
EMongoDocumentDataProvider constructor. But $model->search is itself
returning an EMongoDocumentDataProvider. So the object is being passed
as a parameter to it's own constructor. The constructor is really
wanting an EMongoDocument object which is what the above fix provides.


On Feb 17, 5:51=A0pm, stutteringp0et <richeyweb....@gmail.com> wrote:
> I realize that I'm the only other member of this group (for now), so I
> hope you don't feel annoyed by my frequent posts.
>
> On Feb 17, 3:49=A0pm, stutteringp0et <richeyweb....@gmail.com> wrote:
>
>
>
>
>
>
>
> > $model->search()->model works
>
> > and I'm able to search/filter.
>
> > On Feb 17, 3:46=A0pm, stutteringp0et <richeyweb....@gmail.com> wrote:
>
> > > EMongoDocumentDataProvider::__construct wants a $modelClass (text or
> > > object) as the first argument, while $model->search() returns a
> > > EMongoDocumentDataProvider object.
>
> > > I was getting an error on r=3Dproject/admin when $model->search() was
> > > present:
> > > =A0PHP Fatal error: =A0Call to a member function getDbCriteria() on a=
 non-
> > > object in /var/www/yii/trackstar/protected/extensions/YiiMongoDbSuite=
/
> > > EMongoDocumentDataProvider.php on line 73
>
> > > Removing the ->search() method resolves the error, but I'm unable to
> > > search/filter.
>
> > > On Feb 17, 2:52=A0pm, Dariusz G=F3recki <darek....@gmail.com> wrote:
>
> > > > No, it should be 'dataProvider'=3D>$model->search()
>
> > > > I changed it recently, to match default Yii AR behavior
>
> > > > canni
>
> > > > W dniu 17.02.2011 21:21, stutteringp0et pisze:
>
> > > > > Line 53:
> > > > > 'dataProvider'=3D>new EMongoDocumentDataProvider($model->search()=
,
> > > > > array(
>
> > > > > should be: