shish / shimmie2

An easy-to-install community image gallery (aka booru)
http://code.shishnet.org/shimmie2/
GNU General Public License v2.0
411 stars 115 forks source link

Sorting Tag Edit Cloud by Relevance returns an Internal error #1265

Closed HawaiianPizza closed 2 months ago

HawaiianPizza commented 2 months ago

Server Software about: title: "Booru" theme: "danbooru2"

versions: shimmie: "2.12.0-alpha-20240905-3981ea1" schema: 21 php: "8.2.20" db: "pgsql PostgreSQL 15.8 on x86_64-pc-linux-musl, compiled by gcc (Alpine 13.2.1_git20240309) 13.2.1 20240309, 64-bit" os: "Linux e7ad0c9a204b 5.15.0-112-generic #122-Ubuntu SMP Thu May 23 07:48:21 UTC 2024 x86_64" server: "Unit/1.32.1"

extensions: core: ["admin","alias_editor","bbcode","comment","download","et","ext_manager","four_oh_four","handle_pixel","help_pages","image","index","media","mime","post_lock","post_owner","post_source","post_tags","replace_file","setup","static_files","system","tag_list","upgrade","upload","user","user_config","view"] extra: ["auto_tagger","autocomplete","bulk_actions","bulk_add","filter","home","image_view_counter","private_image","random_image","rating","relationships","reverse_search_links","tag_categories","tag_editcloud","tag_tools","wiki"] handled_mimes: ["image/jpeg","image/gif","image/png","image/webp"]

stats: images: 168 comments: 0 users: 2

media: memory_limit: "8.0MB" disk_use: "807GB" disk_total: "913GB"

thumbnails: engine: "convert" quality: 75 width: 192 height: 192 scaling: 100 mime: "image/jpeg"

Client Software (please complete the following information)

What steps trigger this bug

  1. Go to System > Board Config
  2. Under Tag Edit Cloud, change Sort the tags by to Relevance
  3. Click Save Settings
  4. Go to an image that you've already populated with tags, and click on it.

What did you expect to happen? My post was supposed to load up normally.

What actually happened? Internal error message.


Internal Error

Message: SQLSTATE[42703]: Undefined column: 7 ERROR: column t1.tag_id does not exist LINE 8: WHERE t1.count >= $2 AND t1.tag_id IN (34,1123,220,4,12... ^ HINT: Perhaps you meant to reference the column "it1.tag_id".

Query: SELECT t2.tag AS tag, COUNT(image_id) AS count, FLOOR(LN(LN(COUNT(image_id) - :tag_min1 + 1)+1)*150)/200 AS scaled FROM image_tags it1 JOIN image_tags it2 USING(image_id) JOIN tags t1 ON it1.tag_id = t1.id JOIN tags t2 ON it2.tag_id = t2.id WHERE t1.count >= :tag_min2 AND t1.tag_id IN (34,1123,220,4,121,122,306,271,1124,47,114,274,113,3,124,176,52) GROUP BY t2.tag ORDER BY count DESC LIMIT :limit

Args: array ( 'tag_min1' => 2, 'tag_min2' => 2, 'limit' => 4096, )

Version: 2.12.0-alpha (on 8.2.20)

Stack Trace:

#0 /app/core/database.php(248): Shimmie2\Database->_execute()
#1 /app/ext/tag_editcloud/main.php(93): Shimmie2\Database->get_all()
#2 /app/ext/tag_editcloud/main.php(22): Shimmie2\TagEditCloud->build_tag_map()
#3 /app/core/send_event.php(162): Shimmie2\TagEditCloud->onImageInfoBoxBuilding()
#4 /app/ext/view/main.php(99): Shimmie2\send_event()
#5 /app/core/send_event.php(162): Shimmie2\ViewPost->onDisplayingImage()
#6 /app/ext/view/main.php(64): Shimmie2\send_event()
#7 /app/core/send_event.php(162): Shimmie2\ViewPost->onPageRequest()
#8 /app/index.php(91): Shimmie2\send_event()
#9 {main}

This also happens when you change the **Sort the tags by** to **Categories**.
shish commented 2 months ago

Looks like the errors with Relevance and Categories are unrelated, but both should be fixed now /o/