When the next button of a DataTable with data straight from the HTML is clicked, nothing happens. Additionally, an error can be found in the console similar to: Uncaught TypeError: q is undefined Note that this problem does not occur when the data is sourced using Ajax. Steps to reproduce: 1. Open itemtypes.pl. 2. If there are fewer than 11 item types, create additional item types until there are more than 10, so that the next button can be used. 3. Click on the next button / link. 4. Notice that nothing happens.
Created attachment 142679 [details] [review] Bug 31994: DataTable next button does not work when using data in the HTML This patch resolves the issue that occurs when the next button of a DataTable with data straight from the HTML is clicked. Test plan: 1. Open itemtypes.pl. 2. If there are fewer than 11 item types, create additional item types until there are more than 10, so that the next button can be used. 3. Click on the next button / link. 4. Notice that nothing happens. 5. Apply the patch. 6. Restart plack / memcached if using. 7. Reload itemtypes.pl. 8. Click on the next button / link. 9. Notice that the next page is displayed.
Cannot reproduce. Works as expected in the current sandbox version without applying the patch.
I can reproduce this bug on the latest 21.11 and 21.05. I checked these versions: - master: can't reproduce (works as expected) - 22.05: can't reproduce (works as expected) - 21.11: can reproduce - 21.05: can reproduce - 20.11: can't reproduce (works as expected)
Patch doesn't apply on 21.11.13. I haven't changed the status. git bz apply 31994 Bug 31994 - Clicking the next button of a DataTable loading its data from the HTML does nothing 142679 - Bug 31994: DataTable next button does not work when using data in the HTML Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 31994: DataTable next button does not work when using data in the HTML Using index info to reconstruct a base tree... M koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc Falling back to patching base and 3-way merge... Auto-merging koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc error: Failed to merge in the changes. Patch failed at 0001 Bug 31994: DataTable next button does not work when using data in the HTML
Olivier, I am also unable to reproduce this issue in either master or 21.11. Your patch applies cleanly in master but does not in 21.11.x Can you confirm which version your patch is intended for?
Hi Lucas, The patch is intended for master only. I have not tested it on any other version so far. I confirm that I am able to reproduce the issue on a clean master, and that applying the patch fixes the issue. However, I can confirm that the bug cannot be reproduced on a Bywater sandbox. I don't understand how that is possible, since the master branch should be the same, as long as it's up-to-date. We run all of our tests on local installations, not using docker images. Do you know if there are differences between the master branch and the version available through KTD?
I figured it out. The problem only occurs if the Default Display Length was never updated through column_settings.pl. When that is the case, the default display length is used, and that variable is a string, not an int, therefore causing the issue. To reproduce, add the following before Step 3 of the test plan: 2a: Run the following SQL query: DELETE FROM tables_settings WHERE tablename = 'table_item_type'; If someone can confirm reproduction on master, I will update the test plan accordingly.
(In reply to Olivier Hubert from comment #7) > If someone can confirm reproduction on master, I will update the test plan > accordingly. Hi Olivier. I was able to reproduce on the current master (using koha-testing-docker), here is what I did: 1. Followed steps 1-2 in the current test plan. 2. Followed new step 2a. 3. Ran a flush_memcached, restart_all, and cleared the browser cache.[1] 4. The first time I go to Administration > Basic parameters > Item types the behavour as identified occurs. That is, clicking on Next or Last options don't work (from both at the top and bottom of the table). 5. If I click on the menu in the sidebar again (Item types) to refresh the page, then the Next and Last options work as expected. 6. I applied the patch and followed the rest of the test plan, and this resolved the issue. I'm happy to sign off once you have updated the test plan. Thanks for persevering with this! David [1] Clearing the browser cache: I normally use the Firefox Developer Edition, and have set things so that all history, etc., are deleted when it is closed.
Created attachment 145903 [details] [review] Bug 31994: DataTable next button does not work when using data in the HTML This patch resolves the issue that occurs when the next button of a DataTable with data straight from the HTML is clicked. Test plan: 1. Run the following SQL query on the database: DELETE FROM tables_settings WHERE tablename = 'table_item_type'; 2. Restart plack / memcached if using. 3. Open itemtypes.pl. 4. If there are fewer than 11 item types, create additional item types until there are more than 10, so that the next button can be used. 5. Click on the next button / link. 6. Notice that nothing happens. 7. Apply the patch. 8. Restart plack / memcached if using. 9. Reload itemtypes.pl. 10. Click on the next button / link. 11. Notice that the next page is displayed.
Created attachment 148899 [details] [review] Bug 31994: DataTable next button does not work when using data in the HTML This patch resolves the issue that occurs when the next button of a DataTable with data straight from the HTML is clicked. Test plan: 1. Run the following SQL query on the database: DELETE FROM tables_settings WHERE tablename = 'table_item_type'; 2. Restart plack / memcached if using. 3. Open itemtypes.pl. 4. If there are fewer than 11 item types, create additional item types until there are more than 10, so that the next button can be used. 5. Click on the next button / link. 6. Notice that nothing happens. 7. Apply the patch. 8. Restart plack / memcached if using. 9. Reload itemtypes.pl. 10. Click on the next button / link. 11. Notice that the next page is displayed. Signed-off-by: Magnus Enger <magnus@libriotech.no> I can reproduce the problem on ktd, after a restart_all and a hard reload of itemtypes.pl. Patch fixes the problem.
Created attachment 148930 [details] [review] Bug 31994: DataTable next button does not work when using data in the HTML This patch resolves the issue that occurs when the next button of a DataTable with data straight from the HTML is clicked. Test plan: 1. Run the following SQL query on the database: DELETE FROM tables_settings WHERE tablename = 'table_item_type'; 2. Restart plack / memcached if using. 3. Open itemtypes.pl. 4. If there are fewer than 11 item types, create additional item types until there are more than 10, so that the next button can be used. 5. Click on the next button / link. 6. Notice that nothing happens. 7. Apply the patch. 8. Restart plack / memcached if using. 9. Reload itemtypes.pl. 10. Click on the next button / link. 11. Notice that the next page is displayed. Signed-off-by: Magnus Enger <magnus@libriotech.no> I can reproduce the problem on ktd, after a restart_all and a hard reload of itemtypes.pl. Patch fixes the problem. Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Pushed to master for 23.05. Nice work everyone, thanks!
Nice work, thanks everyone! Pushed to 22.11.x for the next release.