View Issue Details

IDProjectCategoryView StatusLast Update
0001296OXID eShop (all versions)1.08. Listmania, Notice list, Gift registrypublic2012-12-07 14:33
ReporterMichaelZ Assigned To 
PriorityhighSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version4.1.5 revision 21618 
Fixed in Version4.1.6 revision 22740 
Summary0001296: No page navigation for recomm lists in account
DescriptionAssumed, 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.
TagsListmania
Theme
BrowserAll
PHP Version5.2.6
Database Version5.0.33

Activities

MichaelZ

2009-09-07 13:21

reporter   ~0001671

I guess, the same problem applies to the RecommList class as the implementation of the RecommList::getPageNavigation() method also calls oxUBase::generatePageNavigation().

arvydas_vapsva

2009-09-08 15:09

reporter   ~0001689

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;

}
..

MichaelZ

2009-09-09 08:16

reporter   ~0001694

Last edited: 2009-09-09 08:17

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.

arvydas_vapsva

2009-09-09 14:09

reporter   ~0001699

please just try the code or wait for next release

MichaelZ

2009-09-14 16:24

reporter   ~0001728

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.

arvydas_vapsva

2009-09-15 15:48

reporter   ~0001738

Replace with this:

    public function render()
    {
        $sReturn = parent::render();
        $this->_oPageNavigation = null;
        $this->_aViewData['pageNavigation'] = $this->getPageNavigation();
        return $sReturn;
    }

arvydas_vapsva

2009-09-15 15:48

reporter   ~0001739

fixed!