-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
The danbooru_api plugin's tagging is broken (maybe?) #1209
Comments
Thank you, I have the same problem. And I fix it followed by your method. |
Sorry for the delay - that fix does look correct, and I am very confused as to why the current code isn't throwing more explicit errors o_O Specifically phpstan recognises that |
So it looks like if any part of the type signature is |
So this extension was designed to be compatible with danbooru 1.0 in 2008, and it's kind of inherently a mess - I'm not familiar with the latest clients of this API -- I wonder if either of you can recommend any that I can test with? In particular if these API clients support the latest danbooru API as described on https://danbooru.donmai.us/wiki_pages/help:api - that looks much more pleasant to support ^^;; |
@shish Regardless, thank you for your response! Have a good one. |
Server Software
about:
title: "Shimmie"
theme: "default"
url: "http://localhost:8080/index.php?q="
versions:
shimmie: "2.12.0-alpha-20240707-8a8d78a"
schema: 21
php: "8.2.20"
db: "sqlite 3.40.1"
os: "Linux 2e2071790582 6.9.7-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 28 Jun 2024 04:32:50 +0000 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: ["bulk_actions","bulk_import_export","danbooru_api","downtime"]
handled_mimes: ["image/jpeg","image/gif","image/png","image/webp","application/zip"]
stats:
images: 2
comments: 0
users: 2
media:
memory_limit: "8.0MB"
disk_use: "11GB"
disk_total: "31GB"
thumbnails:
engine: "convert"
quality: 75
width: 192
height: 192
scaling: 100
mime: "image/jpeg"
What steps trigger this bug
What did you expect to happen?
Data from the form-data value "tags" should be properly parsed and end up in the "Tags" field on the post.
What actually happened?
2024/07/08 01:25:37 [notice] 132#132 [unit] #239: php message: PHP Warning: Array to string conversion in /app/ext/post_tags/main.php on line 135
Discussion
I admit maybe I am doing this wrong, but I really don't think so. Here's a code snippet:
I've actually "fixed" this (assuming it's broken and I'm not just Doing It Wrong) by changing
shimmie2/ext/danbooru_api/main.php
Line 335 in 8a8d78a
I changed it to:
$posttags = isset($_REQUEST['tags']) ? $_REQUEST['tags'] : $_REQUEST['post']['tags'];
since there's actually call to Tag::explode() atshimmie2/ext/post_tags/main.php
Line 135 in 8a8d78a
I considered submitting a PR, but I don't actually know if this is broken or if my script is broken, and I can't get the docker image to compile without modification locally (I get an error in Smoke Test about the get-page command not existing, which I think may have been updated to Get:page) so I can't do full testing; I modified the docker container live to test this.
The text was updated successfully, but these errors were encountered: