Announcement

#1 2024-04-18 03:04:20

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

14.4.0: fatal error: Cannot redeclare strip_html_in_metadata()

After upgrading to 14.4.0, I get this error after doing a synchronization:

Code:

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

 

#2 2024-04-18 14:22:00

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13847

Re: 14.4.0: fatal error: Cannot redeclare strip_html_in_metadata()

Sorry for this new bug :-(

[Github] Piwigo issue #2150

Offline

 

#3 2024-04-18 14:38:05

tomwag
Member
2021-04-22
1

Re: 14.4.0: fatal error: Cannot redeclare strip_html_in_metadata()

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

 

#4 2024-04-18 15:03:21

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

Re: 14.4.0: fatal error: Cannot redeclare strip_html_in_metadata()

plg wrote:

Sorry for this new bug :-(

[Github] Piwigo issue #2150

No worries, thanks for addressing it!

Offline

 

#5 2024-04-18 18:24:58

erAck
Only trying to help
2015-09-06
2141

Re: 14.4.0: fatal error: Cannot redeclare strip_html_in_metadata()

Fwiw, this should fix it applying the issue's commit's patch:

Code:

cd YOURPIWIGODIRECTORY
curl https://github.com/Piwigo/Piwigo/commit/e8090d4149bb83289f6aa2d1d971a420ecdd706f.patch | patch -p1

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

Offline

 

#6 2024-04-18 23:02:29

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

Re: 14.4.0: fatal error: Cannot redeclare strip_html_in_metadata()

erAck wrote:

Fwiw, this should fix it applying the issue's commit's patch:

That did indeed fix it, thank you.

Offline

 

#7 2024-04-18 23:04:41

OHappyDay
Member
2023-02-08
95

Re: 14.4.0: fatal error: Cannot redeclare strip_html_in_metadata()

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

 

#8 2024-04-18 23:41:45

OHappyDay
Member
2023-02-08
95

Re: 14.4.0: fatal error: Cannot redeclare strip_html_in_metadata()

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

 

#9 2024-04-20 14:08:45

OHappyDay
Member
2023-02-08
95

Re: 14.4.0: fatal error: Cannot redeclare strip_html_in_metadata()

Any idea why IPTC data are interfering with the upload process?

Offline

 

#10 2024-04-23 00:16:25

OHappyDay
Member
2023-02-08
95

Re: 14.4.0: fatal error: Cannot redeclare strip_html_in_metadata()

Any news/ideas from developers on the above topic?

Offline

 

#11 2024-04-23 15:17:25

J0nny
Member
2017-12-15
35

Re: 14.4.0: fatal error: Cannot redeclare strip_html_in_metadata()

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

 

#12 2024-04-25 12:59:16

OHappyDay
Member
2023-02-08
95

Re: 14.4.0: fatal error: Cannot redeclare strip_html_in_metadata()

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

 

#13 2024-05-02 21:52:08

kinsham
Member
2017-09-05
17

Re: 14.4.0: fatal error: Cannot redeclare strip_html_in_metadata()

Has the patch mentioned been committed yet? The latest seems to be 14.4.0 that has the issue.

Offline

 

#14 2024-05-05 21:15:55

rgischig
Member
Switzerland
2019-10-15
10

Re: 14.4.0: fatal error: Cannot redeclare strip_html_in_metadata()

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

 

#15 2024-05-09 13:41:46

digitography
Member
2016-10-27
49

Re: 14.4.0: fatal error: Cannot redeclare strip_html_in_metadata()

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

 

Board footer

Powered by FluxBB

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