I have this code:

<?php
	$v = views_get_view('moreNews');
	$v->init_display('default');
	$v->display_handler->set_option('items_per_page', 0);
	$v->display_handler->set_option('offset', 2);
	echo $v->execute_display();		
?>

The offset is working when i set items_per_page to a number different than 0. But if i set it to 0 (unlimited), the view retrieves all the records no matter the offset passed.
Is this a bug or i am doing something wrong?

Thanks,

Matias.

Comments

merlinofchaos’s picture

Status: Active » Fixed

Unfortunately, this is a limitation of SQL; there is no way to apply an offset without limiting items per page; you can put an arbitrarily large number there if you like.

I've modified the documentation to reflect this.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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