After upgrading to 14.4.0, I get this error after doing a synchronization:
Fatal error: Cannot redeclare strip_html_in_metadata() (previously declared in /usr/local/piwigo/include/functions_metadata.inc.php:186) in /usr/local/piwigo/include/functions_metadata.inc.php on line 186
The photos do seem to sync in though, so not sure if it's causing any other problems.
Piwigo 14.4.0
Installed on 28 December 2014, 9 years 3 months 2 weeks 6 days ago
Operating system: Linux
PHP: 8.2.10-2ubuntu1 (Show info) [2024-04-17 21:03:29]
MySQL: 8.3.0 [2024-04-17 21:03:29]
Graphics Library: External ImageMagick 7.1.1-29
Cache size 16366.98 Mo calculated 7 months ago
Last edited by windracer (2024-04-18 03:30:17)
Offline
Sorry for this new bug :-(
[Github] Piwigo issue #2150
Offline
Using the old functions_metadata.inc.php from 14.3.0 and it works again. There html is not stripped, the function doesn't exist. :)
Offline
plg wrote:
Sorry for this new bug :-(
[Github] Piwigo issue #2150
No worries, thanks for addressing it!
Offline
Fwiw, this should fix it applying the issue's commit's patch:
cd YOURPIWIGODIRECTORY curl https://github.com/Piwigo/Piwigo/commit/e8090d4149bb83289f6aa2d1d971a420ecdd706f.patch | patch -p1
Offline
erAck wrote:
Fwiw, this should fix it applying the issue's commit's patch:
That did indeed fix it, thank you.
Offline
Hm, uploading images seems not work properly any more.
I tried to upload an image to an existing album using the web interface. It uploads it with 97% and then shows an exclamation mark with "HTTP error". Tried with several images.
I tried this before and after applying the patch as provided above. Same behaviour.
The uploaded images appear after a while in the selected album. What is wrong?
Next test:
I created a new empty album and tried to upload images to that album. Same behaviour as described above (for each image I wanted to upload). Additionally the album does not even appear on the startpage of my website.
I checked the newly uploaded images and selected one of them and went into edit mode. The image was not connected with the selected album (shown as orphaned). After assigning it to the new album the album appeared and also the other uploaded images suddenly appear in that album.
What is wrong here and how to resolve?
Thanks
Offline
Here are some more details:
It seems to depend on the image whether this happens. When I choose an image with no EXIF data it uploads as expected.
When I choose an image with EXIF and IPTC data I can see the following error in the developer tools (Firefox):
Uncaught TypeError: piwigoApiResponse is null
Error https://mywebsite/_data/combined/157h752.js:138
...
Uncaught TypeError: uploadCategory is null
UploadComplete https://mywebsite/_data/combined/157h752.js:138
...
When I add an IPTC copyright content then the upload fails. This is what I added (output from "exiv2 -pa image.jpg")
Iptc.Application2.Copyright String 48 Copyright 2023
Without that IPTC metadata the upload succeeds.
Last edited by OHappyDay (2024-04-18 23:47:20)
Offline
Any idea why IPTC data are interfering with the upload process?
Offline
Any news/ideas from developers on the above topic?
Offline
Last week I upgraded to 14.4.0 and since then I have the same issue as the original poster.
I use FTP upload and when I upload multiple images I get
Fatal error: Cannot redeclare strip_html_in_metadata()
Curiously I dont have the problem when uploading images then synchronising one at a time . It only happens if I upload 2 or more images and synchronise at the same time.
I looked at the patch above but have not figured out how to use it yet. :o(
For now the first work around is upload images one at a time.
The second workaround is: when I get the above error the new images are added but the gallery does not display the information contained in the IPTC, ie image description. If I use the plug in photo update and then replace the images with the same file from my hard drive it then incorporates my IPTC as normal.
Offline
I found the root cause:
I had IPTC mapping enabled in my LocalFiles Editor. After disabling it (I don't need it actually) upload works as expected.
Offline
Has the patch mentioned been committed yet? The latest seems to be 14.4.0 that has the issue.
Offline
Hi,
The changes seams to "fix" the error.
Is there a easy way to apply this in the docker version of piwigo? as either apt nor patch is available!
I managed to make these change by hand, as it's not much of a change.
Many thanks
roman
Offline
I too am seeing this problem.
The patch posted, How do I use that?
I am thinking that I have to apply the patch on the local copy of piwigo on my PC, then re-upload to the server.
Is that correct?
Offline