Announcement

#1 2022-09-19 21:10:19

dev3
Member
2021-02-01
14

Can't edit pictures anymore

I'm a long-time user of Piwigo.

I can't edit the meta data for any pictures anymore. I change the title or author or something in the description (like the word 'picture') and I get:

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 'art' picture',

..../public_html/piwigopix/include/dblayer/functions_mysqli.inc.php on line 847


Could this have anything to do with Linux file permission? What should they be... or where can I find out?

Piwigo 12.3.0 Check for upgrade
Operating system: Linux
PHP: 8.0.23 (Show info) [2022-09-19 12:03:06]
MySQL: 8.0.30-0ubuntu0.20.04.2 [2022-09-19 12:03:06]
Graphics Library: ImageMagick 6.9.10-23
Cache size 517.79 Mo   calculated 11 minutes ago

Piwigo URL: https://answer123.com/piwigopix/index.php?/category/10

Offline

 

#2 2022-09-19 21:44:48

erAck
Only trying to help
2015-09-06
1998

Re: Can't edit pictures anymore

You omitted to post the SQL statement that was displayed along with the source code line number (which on its own doesn't tell anything) and could give a hint what query failed.
And no, it's quite certainly not related to file system permissions.


Running Piwigo at https://erack.net/gallery/

Offline

 

#3 2022-09-19 21:55:17

dev3
Member
2021-02-01
14

Re: Can't edit pictures anymore

The following did not show up on the error box at top of page. I got it by viewing the page source:

<b>Warning</b>:  [mysql error 1064] 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 't smoke that often but Phil was never without his pipe.',
    `date_creation` = ' at line 6

UPDATE `piwigo_images`
  SET `id` = '819',
    `name` = 'Phil and his pipe',
    `author` = NULL,
    `level` = '0',
    `comment` = 'We both smoked pipes, which is what we did back then to look suave and sophisticated. I didn't smoke that often but Phil was never without his pipe.',
    `date_creation` = NULL
  WHERE `id` = '819' in <b>/var/www/html/answer123.com/public_html/piwigopix/include/dblayer/functions_mysqli.inc.php</b> on line <b>847</b><br />
</pre><!DOCTYPE html>

I FOUND IT. The new system would not let me update the word "pipe" in the title because in the description there was the word "didn't" and the SQL parser did not like the apostrophe. As soon as I changed "didn't" to "did not" it let me update the title.

Maybe now you have to enclose all contractions with an escape character... perhaps a ` or / ? If so, I don't remember this being necessary before.

Offline

 

#4 2022-09-20 00:18:46

windracer
Member
St. Pete, FL
2014-12-28
444

Re: Can't edit pictures anymore

Yup, text with apostrophes in it are a problem now. I reported that here and someone posted a workaround that has worked for me:

https://piwigo.org/forum/viewtopic.php?id=31560

If you don't want to make the code changes, you have to remember to "escape" the apostrophe by using two of them, like: don''t

Last edited by windracer (2022-09-20 00:19:38)

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact