Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.
For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email firstname.lastname@example.org.
This doesn’t seem to be directly related. Your error indicates that current category inside layer was somehow overwritten.
The two lines you should have added would not cause this.
Maybe you try to list products from non-existing category ? That could be one cause.
Are there any other changes you might have made to the Mage/Catalog/Block/Product/List.php or Mage/Catalog/Model/Layer.php files ?
Thanks for your code. It works fine,but only problem is it doesn’t show the products correctly on th epage. For example,if u set number of products per page 8 and if there are 9 total products, then on one page it shows all 9 products instead of 8 in one page and 1 in another page.