Hello,

is it possible to add a new method in view.inc file?

function set_current_page($id){
$this->pager['current_page'] = $id;
}

I want it in order to set the $id page of a view with the pager enabled. Or is there another way to set the page without having to use the url and the GET method.

Thank you.
apanag

CommentFileSizeAuthor
#5 views-510920.patch702 bytesdawehner
#3 views-510920.patch645 bytesapanag
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

you could also use hook_views_pre_query or something similar to change the $view object to what you need.

but sure if you create a patch its possible to add.

apanag’s picture

Where hook_views_pre_query is defined?

apanag’s picture

FileSize
645 bytes

Hello,

here is the patch adding the above method.

apanag’s picture

Hello,

i know that you are working hard to provide the best results with the views module, but i need that function to add functionality to my module.
Is it possible to review the patch?

Thanks in advanced,
apanag

dawehner’s picture

Status: Active » Needs review
FileSize
702 bytes

lets first set it to needs review

ok reviewed it, two minor coding style issues, the rest is fine.

Also applies clean on 6.x-3.x

apanag’s picture

Hello dereine,

thanks for reviewing my patch.

apanag

merlinofchaos’s picture

Status: Needs review » Fixed

Works for me. Committed!

apanag’s picture

Thank you very much.
apanag

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.