View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001296 | OXID eShop (all versions) | 1.08. Listmania, Notice list, Gift registry | public | 2009-09-07 11:29 | 2012-12-07 14:33 |
Reporter | MichaelZ | Assigned To | |||
Priority | high | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 4.1.5 revision 21618 | ||||
Fixed in Version | 4.1.6 revision 22740 | ||||
Summary | 0001296: No page navigation for recomm lists in account | ||||
Description | Assumed, the customer created 12 recomm lists, only the first 10 lists are shown under the create new list form. Although there are no navigation controls in the standard oxid template, I added one to my custom template. To create the page navigation elements, I used the Account_Recommlist::getPageNavigation() getter method. The object returned by this method looks okay concerning its structure, however the fields are not populated with the correct information: stdClass Object ( [NrOfPages] => [iArtCnt] => 0 [actPage] => 1 ) NrOfPages does not seem to be populated at all iArtCnt is 0 which is okay, as we are paging lists here. Maybe another type of object should be introduced for paging lists, as we are not paging a list of articles but a list of recomm lists. actPage is populated with 1, however you don't have the possitility to change this as NrOfPages is not populated at all. When I look at the implementation of Account_Recommlist::getPageNavigation(), I notice, that oxUBase::generatePageNavigation() is called which refers to object fields like _iAllArtCnt or _iCntPages. As these fields are not present in the Account_Recommlist class, the generation of the page navigation object fails. | ||||
Tags | Listmania | ||||
Theme | |||||
Browser | All | ||||
PHP Version | 5.2.6 | ||||
Database Version | 5.0.33 | ||||
|
I guess, the same problem applies to the RecommList class as the implementation of the RecommList::getPageNavigation() method also calls oxUBase::generatePageNavigation(). |
|
fixed if you cant wait until next release you can fix the problem by making simple module for account_recommlist class: .. public function render() { $sReturn = parent::render(); $this->_aViewData['pageNavigation'] = $this->getPageNavigation(); return $sReturn; } .. |
|
Sorry to reopen this. I'm currently not able to check your fix, but after looking at your code, I doubt that this will fix the issue. What your suggested code fragment does is call the Account_Recommlist::render() method, then adds the result of $this->getPageNavigation() to the template variables array and returns the result of the call to parent::render(). However as you don't override the Account_Recommlist::getPageNavigation() method in the module for Account_Recommlist, $this->getPageNavigation() still refers to the Account_Recommlist::getPageNavigation() method. So on the template using $pageNavigation and $oView->getPageNavigation() would return the very same result as mentioned in the original description of this issue. |
|
please just try the code or wait for next release |
|
So, sorry this took so long. I tried your fix: 1. I created a file account_recommlist_module.php in <shop>/modules/ with the following content: <?php class Account_Recommlist_Module extends Account_Recommlist_Module_parent { public function render() { $sReturn = parent::render(); $this->_aViewData['pageNavigation'] = $this->getPageNavigation(); return $sReturn; } } ?> The module is registered in the backend (I can confirm this by adding some debug output to the module's render() method). 2. I created 12 recomm lists with the default admin account in a fresh 4.1.5 installation with the default database. 3. The first 10 recomm lists are shown, but no page navigation. When I echo out the $pageNavigation variable on the template (which is set in the created module's render() method), I receive the following output: stdClass Object ( [NrOfPages] => [iArtCnt] => 0 [actPage] => 1 ) As the page navigation is only rendered, when $pageNavigation->iArtCnt is greater than 0, no page navigation is rendered at all. |
|
Replace with this: public function render() { $sReturn = parent::render(); $this->_oPageNavigation = null; $this->_aViewData['pageNavigation'] = $this->getPageNavigation(); return $sReturn; } |
|
fixed! |