[3.0.x.x] Minor pagination bugs in admin: Theme Editor / Language Editor
briuri opened this issue · comments
- Language Editor has incorrect pagination URL. Translations after page 1 cannot be managed.
opencart/upload/admin/controller/design/translation.php
Replace incorrect URL on line 232:
- $pagination->url = $this->url->link('design/translation/history', 'user_token=' . $this->session->data['user_token'] . '&page={page}', true);
+ $pagination->url = $this->url->link('design/translation', 'user_token=' . $this->session->data['user_token'] . '&page={page}', true
- Language Editor doesn't respect Admin Results Per Page configuration value.
opencart/upload/admin/controller/design/translation.php
Replace hard-coded limit on line 231:
- $pagination->limit = 10;
+ $pagination->limit = $this->config->get('config_limit_admin');
- Theme Editor doesn't respect Admin Results Per Page configuration value.
opencart/upload/admin/controller/design/theme.php
Replace hard-coded limit on line 83:
- $pagination->limit = 10;
+ $pagination->limit = $this->config->get('config_limit_admin');
Replace hard-coded limits on line 88:
- $data['results'] = sprintf($this->language->get('text_pagination'), ($history_total) ? (($page - 1) * 10) + 1 : 0, ((($page - 1) * 10) > ($history_total - 10)) ? $history_total : ((($page - 1) * 10) + 10), $history_total, ceil($history_total / 10));
+ $data['results'] = sprintf($this->language->get('text_pagination'), ($history_total) ? (($page - 1) * $this->config->get('config_limit_admin')) + 1 : 0, ((($page - 1) * $this->config->get('config_limit_admin')) > ($history_total - $this->config->get('config_limit_admin'))) ? $history_total : ((($page - 1) * $this->config->get('config_limit_admin')) + $this->config->get('config_limit_admin')), $history_total, ceil($history_total / $this->config->get('config_limit_admin')));
It looks like the master branch does things a little differently, so this bug is only on the 3.0.x.x branch.
Thanks for spotting it, now fixed, see #13716
My apologies -- one more change needed. I was sloppy with my patch!
opencart/upload/admin/controller/design/theme.php
Replace hard-coded limit on line 58:
- $results = $this->model_design_theme->getThemes(($page - 1) * 10, 10);
+ $results = $this->model_design_theme->getThemes(($page - 1) * $this->config->get('config_limit_admin'), $this->config->get('config_limit_admin'));