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

avoiding "Indirect modification of overloaded property $paginate ... no effect" #857

Closed
wants to merge 1 commit into
base: 2.3
from

Conversation

Projects
None yet
4 participants
@dereuromark
Member

dereuromark commented Sep 18, 2012

After some research I found the issue described as warning in the book:

You can run into a situation where assigning a value to a nonexistent property will throw errors:
    $this->paginate['limit'] = 10;
will throw the error “Notice: Indirect modification of overloaded property $paginate has no effect”. 

but with this little fix we can make life easier without the notice.

@ADmad

This comment has been minimized.

Show comment
Hide comment
@ADmad

ADmad Sep 18, 2012

Member

Controller::$paginate was specifically removed in favor of using the PaginatorComponent. Controller::$paginate is now available only for BC as an overloaded property. If you add the property back you will get rid of the possible error and its functionality too as it will be no longer mapped to $this->Components->load('Paginator')->settings; through overloading.

Member

ADmad commented Sep 18, 2012

Controller::$paginate was specifically removed in favor of using the PaginatorComponent. Controller::$paginate is now available only for BC as an overloaded property. If you add the property back you will get rid of the possible error and its functionality too as it will be no longer mapped to $this->Components->load('Paginator')->settings; through overloading.

@ADmad ADmad closed this Sep 18, 2012

@dereuromark

This comment has been minimized.

Show comment
Hide comment
@dereuromark

dereuromark Sep 18, 2012

Member

I see.
So the only real fix would be to upgrade all 1.3 pagination code from array to 2.x Paginator syntax then.

Member

dereuromark commented Sep 18, 2012

I see.
So the only real fix would be to upgrade all 1.3 pagination code from array to 2.x Paginator syntax then.

@ADmad

This comment has been minimized.

Show comment
Hide comment
@ADmad

ADmad Sep 18, 2012

Member

I don't quite remember exactly in which version PaginatorComponent was added. If it was available since 2.0 then the manual should be updated and all code examples using Controller::$paginate should be changed to using the component.

Edited for typos and grammer.

Member

ADmad commented Sep 18, 2012

I don't quite remember exactly in which version PaginatorComponent was added. If it was available since 2.0 then the manual should be updated and all code examples using Controller::$paginate should be changed to using the component.

Edited for typos and grammer.

@dereuromark

This comment has been minimized.

Show comment
Hide comment
@dereuromark

dereuromark Mar 21, 2014

Member

We should revisit my declined PR regarding this issue, now that this way is not deprecated after all.
And we should remove the deprecate notices like https://github.com/cakephp/cakephp/blob/master/lib/Cake/Controller/Controller.php#L1076

Member

dereuromark commented Mar 21, 2014

We should revisit my declined PR regarding this issue, now that this way is not deprecated after all.
And we should remove the deprecate notices like https://github.com/cakephp/cakephp/blob/master/lib/Cake/Controller/Controller.php#L1076

@lorenzo

This comment has been minimized.

Show comment
Hide comment
@lorenzo

lorenzo Mar 21, 2014

Member

Yeah, we need to remove that notice

Member

lorenzo commented Mar 21, 2014

Yeah, we need to remove that notice

@ravage84

This comment has been minimized.

Show comment
Hide comment
@ravage84

ravage84 Mar 21, 2014

Member

👍

Member

ravage84 commented Mar 21, 2014

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment