#1 2025-02-06 18:22:38

strutha
Member
2025-01-10
18

Warning message when trying to view additional properties

When trying to view the additional properties for an image on /admin.php?page=plugin-manage_properties_photos-iap&image_id=466 I get these warning messages displayed:


Warning: Undefined array key "info_photosI" in /home/fellfixe/public_html/piwigo/_data/templates_c/p6jhns^e489bf388c6e1ef581bbd37d7946f97861dbad48_0.file.admin.tpl.php on line 536

Warning: Attempt to read property "value" on null in /home/fellfixe/public_html/piwigo/_data/templates_c/p6jhns^e489bf388c6e1ef581bbd37d7946f97861dbad48_0.file.admin.tpl.php on line 536

and although these are only warnings the additional properties do not get displayed.

The line of code where the error occurs is:

$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['info_photosI']->value, 'infophoto');

I have no knowledge of php to be able to debug this any further. Can anybody help me diagnose and fix this?


Environment

Piwigo 15.3.0
Installed on 9 January 2025, 3 weeks 6 days ago
Operating system: Linux
PHP: 8.3.16 (Show info) [2025-02-06 17:16:40]
MySQL: 10.11.10-MariaDB-cll-lve [2025-02-06 12:16:40]
Graphics Library: ImageMagick ImageMagick 7.1.1-43
Cache size 144.93 Mo   calculated 2 weeks ago Refresh


Activated plugin list8

Admin Tools
Batch Downloader
Export Data
LocalFiles Editor
Manage Properties Photos
Read Metadata
Rotate Image
Tag Groups

Last edited by strutha (2025-02-06 18:24:45)

Offline

 

#2 2025-02-06 21:36:33

strutha
Member
2025-01-10
18

Re: Warning message when trying to view additional properties

Update: I decided to de-activate and de-install the Manage Properties Photos plug-in, purge various caches (in case any of them keep info relating to the plug-in) then re-installed and re-activated it and recreated the additional properties using the same reference photo and mapping to the same IPTC and EXIF fields as before.

The error still occurs.

The additional properties all show up and are correctly populated when viewing the photo in the gallery. It's  only when I try to display the Properties additional tab on the Admin page Edit photo.

Offline

 

#3 2025-02-07 03:39:16

strutha
Member
2025-01-10
18

Re: Warning message when trying to view additional properties

Another update.

By researching other forum topics and continuing to poke around I have arrived at the following understanding:

In the header of the file

../piwigo/_data/templates_c/p6jhns^e489bf388c6e1ef581bbd37d7946f97861dbad48_0.file.admin.tpl.php

which throws the error it says it is generated from the file

../piwigo/plugins/manage_properties_photos/admin/admin.tpl

I looked in the source admin.tpl file and at line 392 found the statement:
           

{foreach from=$info_photosI item=infophoto}

What I also noticed in that file were some other lines of code with similar statements without the trailing 'I' on $info_photos:
           

{foreach from=$info_photos item=infophoto}

So thinking the whole thing might just be due to a typo I edited the file ../piwigo/plugins/manage_properties_photos/admin/admin.tpl to delete the 'I', purged the cached templates and tried again to view the additional properties page. I still got the errorbut the error message at least showed that the edit I made to the source template was reflected in the generated file.

So now I'm stumped: the error message seems to be saying that info_photosI is not a valid array key, while info_photos seems to be valid in other lines of the code but not when I substitute it for the reference to info_photosI in the tpl.php file that throws the error.

What I haven't been able to find is where these array variables get defined and how they are initialized with values.

From my reading around I have learned that Smarty is used to generate the file which errors. I know even less about Smarty than I do about PHP so it's quite possible I was on the right track with my theory of a typo in admin.tpl but there is something else I needed to do after editing it. It seems like the *.file.admin.tpl.php file gets generated on the fly when going to the 'Properties additional' tab but is there maybe something like a 'pre-compile' step needed by Smarty to reflect changes to variable names?

As a non-coder I'm thrashing around trying to get to the root of this problem but now I'm out of ideas. Can anybody help me with this, please?

Offline

 

#4 2025-02-07 04:25:25

strutha
Member
2025-01-10
18

Re: Warning message when trying to view additional properties

I just found my way to the Trac pages for the Manage Properties Photos plugin where I discovered that admin.tpl was indeed edited to replace info_photos with info_photoI. But that change happened 5 years ago so it's surprising if this is the first time this issue has arisen, especially given that the plug-in has been downloaded about 22k times in its 10 year existence.

I'm really hoping the author @ddtddt has a few moments to spare to give me some input on how to diagnose and fix this issue.

Offline

 

#5 2025-02-24 14:58:57

xiphias
Member
2025-02-24
1

Re: Warning message when trying to view additional properties

I'm having the same issue. Looks like $info_photosI nor $info_photos are declared in this template. I sure hope @ddtddt can shed some light on the subject.

-XiP

Offline

 

Board footer

Powered by FluxBB