Book Manager list pagination does not work on backend

Started by iberan, 27 July 2023, 10:36:34

Previous topic - Next topic
A financial contribution is greatly appreciated as a support, to help us to keep live the project.
If you like this project you can donate some piece of BitCoin to this address: bc1qy5tgq6tvrckac2a57unxvqcnxamrvhduve9sj9

iberan

Hi Federica,

As you can see also on Abook v4.0.1 demo site, the pagination doesn't work on Book Manager.

Based on /administrator/components/com_abook/models/authors.php protected function populateState(...) it is solved me on /administrator/components/com_abook/models/books.php from #58 to #100 change:
        protected function populateState($ordering = null, $direction = null)
        {
$app = JFactory::getApplication();
if ($layout = $app->input->get('layout')) {
                        $this->context .= '.'.$layout;
                }
$search = $this->getUserStateFromRequest($this->context.'.filter.search', 'filter_search');
                $this->setState('filter.search', $search);

$access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int');
                $this->setState('filter.access', $access);

$published = $this->getUserStateFromRequest($this->context.'.filter.published', 'filter_published', '');
                $this->setState('filter.published', $published);

$categoryId = $this->getUserStateFromRequest($this->context.'.filter.category_id', 'filter_category_id');
                $this->setState('filter.category_id', $categoryId);

$level = $this->getUserStateFromRequest($this->context.'.filter.level', 'filter_level', 0, 'int');
                $this->setState('filter.level', $level);

$language = $this->getUserStateFromRequest($this->context.'.filter.language', 'filter_language', '');
                $this->setState('filter.language', $language);

$author = $this->getUserStateFromRequest($this->context.'.filter.author_id', 'filter_author_id', '');
                $this->setState('filter.author_id', $author);

$editor = $this->getUserStateFromRequest($this->context.'.filter.editor_id', 'filter_editor_id', '');
                $this->setState('filter.editor_id', $editor);

$tag = $this->getUserStateFromRequest($this->context.'.filter.tag_id', 'filter_tag_id', '');
                $this->setState('filter.tag_id', $tag);

parent::populateState('a.title', 'asc');
// Force a language
                $forcedLanguage = $app->input->get('forcedLanguage');

                if (!empty($forcedLanguage))
                {
                        $this->setState('filter.language', $forcedLanguage);
                        $this->setState('filter.forcedLanguage', $forcedLanguage);
                }
        }
to:
        protected function populateState($ordering = null, $direction = null)
        {
$app = JFactory::getApplication();
if ($layout = $app->input->get('layout')) {
                        $this->context .= '.'.$layout;
                }
$search = $app->getUserStateFromRequest($this->context.'.filter.search', 'filter_search');
                $this->setState('filter.search', $search);

$access = $app->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int');
                $this->setState('filter.access', $access);

$published = $app->getUserStateFromRequest($this->context.'.filter.published', 'filter_published', '');
                $this->setState('filter.published', $published);

$categoryId = $app->getUserStateFromRequest($this->context.'.filter.category_id', 'filter_category_id');
                $this->setState('filter.category_id', $categoryId);

$level = $app->getUserStateFromRequest($this->context.'.filter.level', 'filter_level', 0, 'int');
                $this->setState('filter.level', $level);

$language = $app->getUserStateFromRequest($this->context.'.filter.language', 'filter_language', '');
                $this->setState('filter.language', $language);

$author = $app->getUserStateFromRequest($this->context.'.filter.author_id', 'filter_author_id', '');
                $this->setState('filter.author_id', $author);

$editor = $app->getUserStateFromRequest($this->context.'.filter.editor_id', 'filter_editor_id', '');
                $this->setState('filter.editor_id', $editor);

$tag = $app->getUserStateFromRequest($this->context.'.filter.tag_id', 'filter_tag_id', '');
                $this->setState('filter.tag_id', $tag);

parent::populateState('a.title', 'asc');
// Force a language
                $forcedLanguage = $app->input->get('forcedLanguage');

                if (!empty($forcedLanguage))
                {
                        $this->setState('filter.language', $forcedLanguage);
                        $this->setState('filter.forcedLanguage', $forcedLanguage);
                }
        }

A financial contribution is greatly appreciated as a support, to help us to keep live the project.
If you like this project you can donate some piece of BitCoin to this address: bc1qy5tgq6tvrckac2a57unxvqcnxamrvhduve9sj9

federica

Hi iberan,
thanks. I already fixed this bug in the last beta version. I will publish it as soon as possible.
Al mondo ci sono 10 tipi di persone, quelli che hanno capito il codice binario e quelli che non l'hanno capito.
Informatizzati [url="https://informatizzati.org"]https://informatizzati.org[/url]
Stacca la spina [url="https://disconnessi.org"]https://disconnessi.org[/url]