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

Error when clicking 'Show all' (headers already sent) #16

Closed quovadit closed 10 years ago

quovadit commented 10 years ago

I just upgraded piwigo from 2.5 to 2.6.1 and now have the following errors with 2.6b:

Opening osmmap from Home (http://my-url/osmmap.php?/categories) gives the following warning, which disappears after a few seconds:

Warning: session_start() [function.session-start]: 
Cannot send session cache limiter - headers already sent 
(output started at <my-path>/plugins/piwigo-openstreetmap/osmmap2.php:1) 
in <my-path>/include/common.inc.php on line 136

Zooming in and Clicking on 'Show All' (http://my-url/osmmap.php?min_lat=xy&min_lng=xy&max_lat=xy&max_lng=xy) gives the following error (which does not disappear!):

Warning: session_start() [function.session-start]: 
Cannot send session cache limiter - headers already sent 
(output started at <my-path>/plugins/piwigo-openstreetmap/osmmap2.php:1) 
in <my-path>/include/common.inc.php on line 136

Warning: Cannot modify header information - 
headers already sent by 
(output started at <my-path>/plugins/piwigo-openstreetmap/osmmap2.php:1) 
in <my-path>/plugins/piwigo-openstreetmap/osmmap2.php on line 133

Tried reinstalling 2.6b and applying the latest 7 commits

Opening osmmap from one category (http://my-url/osmmap.php?/category/xy) gives no error, clicking on 'Show All' without Zooming in just reloads the current page (still showing only x photos out of xx)

xbgmsharp commented 10 years ago

Hello

Thanks for reporting and sorry for the delay. There might be some debug no commented, or a real bug. However I could not figure out how to reproduce the issue.

On line 133, I send a location header to redirect the URL.

I will have to check if a category_id is present.

xbgmsharp commented 10 years ago

Hello,

I think you have multiple issue. Let's split them up.

  1. Correct "clicking on 'Show All' without Zooming in just reloads the page" The Showall is refresh only only after the first Zooming
  2. Commit 6822bab should solve the issue of "Zooming in and Clicking on 'Show All'"
  3. Duplicate items has been fix with commit 1fc652e4a6
  4. I am not able to reproduce the error using hte URL http://my-url/osmmap.php?/category Would you be able to provide some additional details, by email if require.

Please re-test after updating to the latest version. There is 26 commit since last release.

Then if all fix i will be able to release a new version.

quovadit commented 10 years ago

thanks for your reply, I just applied the 26 commits, and now I get the following error:

Warning:  [mysql error 1054] Unknown column 'category_id' in 'where clause'
SELECT  `id`, `latitude`, `longitude` 
FROM piwigo_images 
WHERE `latitude` IS NOT NULL AND `longitude` IS NOT NULL 
AND `latitude` > 48.x AND `latitude` < 48.x
AND `longitude` > 16.x AND `longitude` < 16.x

 AND (category_id NOT IN (...)

Do I have to update db? I have category_id in table 'image_category', not in 'images'

pjrobertson commented 10 years ago

I am also getting the same error:

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /somewhere/piwigo-openstreetmap/osmmap2.php:1) in /somewhere/gallery/include/common.inc.php on line 136 

The problem is because the file osmmap2.php has a BOM (Byte Order Mark) If you open that file with less (from the terminal) you will see the file starts like this:

<U+FEFF><?php
....

To remove the BOM, use vi(m):

$ vi osmmap2.php
:set nobomb
:wq

I will submit a patch now

Also, the leaflet js marker 'clusters' don't seem to be working for me: http://patrick.is/gallery/osmmap.php?/categories

quovadit commented 10 years ago

the mysql error (Unknown column 'category_id') still occurs as guest/user. When logged in as webmaster/administrator there is no error!

pjrobertson commented 10 years ago

I do see that problem, and anyway - that's a different issue and so you should open a new ticket here

It's most probably a problem with your database. You need to create the category_id column.

quovadit commented 10 years ago

ok, I just opened a new issue for the unknown column (#28). This issue (headers already sent) is solved with the commit by pjrobertson