-
Notifications
You must be signed in to change notification settings - Fork 908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Persisting sorting, ordering, and visibility is broken after a recent update #5762
Comments
Hello there! Thanks for opening your first issue on this repo! Just a heads-up: Here at Backpack we use GitHub Issues only for tracking bugs. Talk about new features is also acceptable. This helps a lot in keeping our focus on improving Backpack. If you issue is not a bug/feature, please help us out by closing the issue yourself and posting in the appropriate medium (see below). If you're not sure where it fits, it's ok, a community member will probably reply to help you with that. Backpack communication channels:
Please keep in mind Backpack offers no official / paid support. Whatever help you receive here, on Gitter, Slack or Stackoverflow is thanks to our awesome awesome community members, who give up some of their time to help their peers. If you want to join our community, just start pitching in. We take pride in being a welcoming bunch. Thank you! -- |
Based on the information provided in the knowledge sources and the user's question, I can address this issue related to Backpack's persistentTable feature. The user is experiencing a bug with the persistentTable feature in Backpack CRUD, which is supposed to maintain table state (page length, search, etc.) across page refreshes. The issue appears to be related to a recent update, specifically version 6.5.47. The problem stems from a code block in the if($dtCachedInfo.length !== 0 && $pageLength.indexOf($dtCachedInfo.length) === -1) {
localStorage.removeItem('DataTables_crudTable_/{{$crud->getRoute()}}');
} This code is incorrectly clearing the table state from localStorage due to a faulty comparison. The user has found a solution by modifying the code to: if($dtCachedInfo.length !== 0 && $pageLength[0].indexOf($dtCachedInfo.length) === -1) {
localStorage.removeItem('DataTables_crudTable_/{{$crud->getRoute()}}');
} This issue is similar to problems reported in previous versions of Backpack, where persistent table settings were not working correctly. For example, in Github Issue #3545, there was a problem with entries per page not being remembered correctly. To address this issue, you can try the following:
If these steps don't resolve the issue, you may need to wait for an official fix from the Backpack team. Keep an eye on the Backpack CRUD GitHub repository for updates or potential fixes related to this issue. ℹ️ Please note our AI Bot does not reply to follow-ups, this will be the only AI answer in this thread. If the AI helped you find the answer, please mark it as answered or write details below so it can learn. Then close the conversation. If not, please give more information for when a human reads this. ℹ️ Relevant sources: Github Issue (closed): [Bug] Entries per page are not remembered (persistent table - true) |
Bug report
What I did
Used the persistentTable feature in Backpack CRUD to maintain table state (page length, search, sort, visibility etc.) across page refreshes. The issue manifests when checking the cached table information against available page lengths.
What I expected to happen
The persistentTable feature should maintain the table state correctly across page refreshes, storing and retrieving the correct page length settings from localStorage.
What happened
The table state is being incorrectly cleared from localStorage due to a faulty comparison in the new code block introduced in version 6.5.47
9d1c5a6
What I've already tried to fix it
the below code block causes the issue in
datatables_logic.blade.php
.If we change it with the below snippet. It works
Is it a bug in the latest version of Backpack?
After I run
composer update backpack/crud
the bug... is it still there?Yes
Backpack, Laravel, PHP, DB version
When I run
php artisan backpack:version
the output is:PHP VERSION:
8.3.16
PHP EXTENSIONS:
Core, date, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dba, dom, hash, FFI, fileinfo, filter, ftp, gd, gettext, gmp, json, iconv, SPL, session, standard, mbstring, igbinary, imagick, imap, intl, ldap, exif, mongodb, mysqlnd, mysqli, pcntl, PDO, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, random, readline, redis, Reflection, shmop, SimpleXML, soap, sockets, sodium, sysvmsg, sysvsem, sysvshm, tokenizer, xml, xmlreader, xmlwriter, xsl, zip, zstd, herd, Zend OPcache
LARAVEL VERSION:
11.41.0.0
BACKPACK PACKAGE VERSIONS:
backpack/activity-log: 2.0.6
backpack/backupmanager: v5.0.5
backpack/basset: 1.3.6
backpack/crud: 6.7.50
backpack/editable-columns: 3.0.11
backpack/filemanager: 3.0.10
backpack/generators: v4.0.7
backpack/logmanager: v5.0.2
backpack/pagemanager: 3.3.2
backpack/permissionmanager: 7.2.1
backpack/pro: 2.2.32
backpack/settings: 3.1.1
backpack/theme-tabler: 1.2.17
The text was updated successfully, but these errors were encountered: