Piwigo / piwigo-openstreetmap

OpenStreetMap integration for Piwigo
http://piwigo.org/ext/extension_view.php?eid=701
GNU General Public License v3.0
35 stars 35 forks source link

unable to edit places piwigo 13.1 #222

Open grantiago opened 1 year ago

grantiago commented 1 year ago

Hi. On the admin page settings -> places tab none of the buttons work. submit, edit, delete. Warning: Attempt to read property "value" on null in /www/piwi/_data/templates_c/p6jhns^6caaed17a20c8c4c21840c5d21766c16755e6f6a_0.file.admin_place.tpl.php on line 242

from the apache log: PHP Warning: Undefined array key "PWG_TOKEN" in /www/piwi/_data/templates_c/p6jhns^6caaed17a20c8c4c21840c5d21766c16755e6f6a_0.file.admin_place.tpl.php on line 242

Editing the photos I can save the lat lng. but have no option to pull down a saved place.

Environment Piwigo 13.1.0 Installed on 7 May 2022, 5 months 3 weeks 3 days ago Operating system: Linux PHP: 8.0.25 MySQL: 8.0.31-0ubuntu0.20.04.1 [2022-11-01 11:31:45] Graphics Library: External ImageMagick 6.9.10-23 Cache size 5.58 Mo   calculated 24 minutes ago Refresh Activated plugin list2 LocalFiles Editor VideoJS OpenStreetMap

Thank you.

gueba commented 1 year ago

I found two possible solutions for this that work for me without noticeable problems: I prefer the second.

  1. Edit plugins/piwigo-openstreetmap/admin/admin_place.tpl lline148: change <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}"> to: <input type="hidden" name="pwg_token" value="">
  2. Edit plugins/piwigo-openstreetmap/admin/admin_place.php from line 155: $template->assign( array( 'OSM_PATH' => OSM_PATH, 'all_places' => $all_places, ) ); add: $template->assign( array( 'OSM_PATH' => OSM_PATH, 'all_places' => $all_places, 'PWG_TOKEN' => get_pwg_token(), ) );
grantiago commented 1 year ago

@gueba Nice work. thank you. The first worked for me. the second didn't. though I left it in place.