You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When all the images in the piwigo_images table have an md5sum value and the pwg.images.setMd5sum API is called, a JSONDecodeError is thrown. Issue is with the call to get_photos_no_md5sum():
I have a fix in my local repo that wraps it in an if statement similar to how this is handled on the admin UI that I'll submit after I figure out pull requests:
nathanz@piwigo-01:~$ python3 piwigo_api_test.py
Traceback (most recent call last):
File "/home/nathanz/.local/lib/python3.10/site-packages/piwigo/ws.py", line 124, in __call__
result = r.json()
File "/usr/lib/python3/dist-packages/requests/models.py", line 900, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python3.10/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/nathanz/piwigo_api_test.py", line 8, in <module>
response = mysite.pwg.images.setMd5sum(block_size="20", pwg_token=pwg_token)
File "/home/nathanz/.local/lib/python3.10/site-packages/piwigo/ws.py", line 96, in checking
return fn(self, **kw)
File "/home/nathanz/.local/lib/python3.10/site-packages/piwigo/ws.py", line 135, in __call__
raise WsErrorException(r.text)
piwigo.ws.WsErrorException: <br />
<b>Fatal error</b>: Uncaught mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 3 in /var/www/html/include/dblayer/functions_mysqli.inc.php:132
Stack trace:
#0 /var/www/html/include/dblayer/functions_mysqli.inc.php(132): mysqli->query()
#1 /var/www/html/include/dblayer/functions_mysqli.inc.php(888): pwg_query()
#2 /var/www/html/admin/include/functions.php(3294): query2array()
#3 /var/www/html/include/ws_functions/pwg.images.php(2602): add_md5sum()
#4 /var/www/html/include/ws_core.inc.php(600): ws_images_setMd5sum()
#5 /var/www/html/include/ws_protocols/rest_handler.php(41): PwgServer->invoke()
#6 /var/www/html/include/ws_core.inc.php(281): PwgRestRequestHandler->handleRequest()
#7 /var/www/html/ws.php(22): PwgServer->run()
#8 {main}
thrown in <b>/var/www/html/include/dblayer/functions_mysqli.inc.php</b> on line <b>132</b><br />
The text was updated successfully, but these errors were encountered:
When all the images in the piwigo_images table have an md5sum value and the pwg.images.setMd5sum API is called, a JSONDecodeError is thrown. Issue is with the call to get_photos_no_md5sum():
Piwigo/include/ws_functions/pwg.images.php
Line 2596 in 5621705
I have a fix in my local repo that wraps it in an if statement similar to how this is handled on the admin UI that I'll submit after I figure out pull requests:
Piwigo/admin.php
Lines 290 to 295 in 5621705
Sample Code:
Output:
The text was updated successfully, but these errors were encountered: