Adding `q=...` to admin filtered image admin listing causes crash.
See original GitHub issueIssue Summary
If you try to combine ?q=
search type URL with filtering by collection in the Image view, you get a crash. (AttributeError at /admin/images/
)
File "/Users/daniel/tmp/search-crash/.v/lib/python3.10/site-packages/wagtail/images/views/images.py", line 96, in get_context_data
context = super().get_context_data(**kwargs)
File "/Users/daniel/tmp/search-crash/.v/lib/python3.10/site-packages/wagtail/images/views/images.py", line 67, in get_context_data
images = images.filter(collection=self.current_collection)
Exception Type: AttributeError at /admin/images/
Exception Value: 'SQLiteSearchResults' object has no attribute 'filter'
(We have a client who wants to be able to search within an image collection, so were exploring options)
Steps to Reproduce
- Start a new project with
wagtail start myproject
cd myproject
./manage.py migrate
./manage.py createsuperuser
./manage.py runserver
- http://localhost:8000/admin/images/?collection_id=1&q=1
Crash.
- I have confirmed that this issue can be reproduced as described on a fresh Wagtail project: (yes)
Technical details
- Python version: 3.8, 3.9, 3.10
- Django version: 3.2, 4.0
- Wagtail version: 2.15, 2.16.1
- Browser version: N/A
- Search backends: SQLLite, Postgres (database backend) and ElasticSearch backends all have this.
e.g:
'SQLiteSearchResults' object has no attribute 'filter'
'Elasticsearch6SearchResults' object has no attribute 'filter'
'PostgresSearchResults' object has no attribute 'filter'
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Wagtail Admin Images Crash - django - Stack Overflow
Try removing some of the more recent or larger images and reloading the page. The problem could be the result of a corrupt...
Read more >Chapter 7. Kernel crash dump guide - Red Hat Customer Portal
kdump is a service which provides a crash dumping mechanism. The service enables you to save the contents of the system memory for...
Read more >EVERY ADMIN PROGRAM CRASHES - Microsoft Community
Click on the Startup Tab and click open task manager. This will open another window which contains all your startup applications on the...
Read more >React-admin - Filtering the List
React-admin uses the filter query parameter from the URL to determine the filters to apply to the list. To change the filters, react-admin...
Read more >User Guide - Cold Turkey
Blocker needs admin rights for various reasons and there's no way to install ... To add a website to the list, type the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Go for it. Nothing stopping you or anyone picking up a bug to fix. @ParitoshKabra
I would recommend for something like this you start with the unit test, sometimes finding where to add a test can be tricky and PRs must come with a test to ensure won’t break this again in the future.
Thanks for digging into this @ParitoshKabra
There is also this issue that may be related. https://github.com/wagtail/wagtail/issues/3746