Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
All my clusters show double the count they should.
Popups list each row, then repeats the entire list. So each node appears twice in the popup.
I don't actually know if the problem exists without clustering, because without clustering if two points are appearing directly over each other there's no way to know. (Right?)
The other displays of my view show the correct number of rows. The view preview of my overlay also shows the correct number.
Comments
Comment #1
PolOh that's strange.
Could you tell us which JS files are loaded ? (the one related to OpenLayers of course).
Thanks
Comment #2
Dave Cohen CreditAttribution: Dave Cohen commentedFor completeness, here's all the .js included in my html head. Is that what you're asking?
Comment #3
Dave Cohen CreditAttribution: Dave Cohen commentedAlso, I can see my points listed in jQuery.extend(...) that appears below the js files. I think the points appear there more than once. It's hard to parse that string. It's long and not displayed well. If I can pretty print it, I will post to this thread.
Comment #4
Poljsbeautifier.org :-)
Comment #5
Dave Cohen CreditAttribution: Dave Cohen commentedjsbeautifier very handy. Thanks.
So, with that, I think its safe to say the point is in fact listed twice in the layer. So probably not a bug in the JS, but on the server side. Still I don't get why my table display shows only one row, but the layer shows two.
Again, when I preview the view, I see only one. But on the real page, I get two.
Here's a chunk of the beautified settings where the point is duplicated.
Comment #6
Dave Cohen CreditAttribution: Dave Cohen commentedI suspect my data appears twice in the js settings because openlayers module calls drupal_add_js twice for my map. Drupal later does a deep merge of the javascript settings that doubles the points.
Here's a stack trace the first time openlayers calls drupal_add_js...
And later in the same page request...
That's all I've managed to figure out so far. Anything in those traces jump out at you?
Is this because my overlay and map are both displays on the same view?
Comment #7
Dave Cohen CreditAttribution: Dave Cohen commentedThe problem may be related to code in openlayers_views_style_map.inc. Both query() and render() call openlayers_render_map()!
query has a cryptic comment "override to make sure this doesn't get run" On my system, it is getting run!
I commented out lines in query() below. I confirmed, with these lines commented out my map shows the proper number of points.
I'm not suggesting that commenting out those lines is the proper fix. Just sharing what I've tracked down. Any idea what the right fix should be?
Comment #8
gunwald CreditAttribution: gunwald commentedCommenting out these lines worked for me too. I did not see any site effects.
Comment #9
PolHi all,
I just committed a fix for it, could you test and report feedback please ?
Thanks !
Comment #10
Dave Cohen CreditAttribution: Dave Cohen commentedThat works. Thanks.
Comment #11
gunwald CreditAttribution: gunwald commentedCan't test the commit, the dev isn't working for me. I get:
on every page where a map is included.
The strange thing is, that I did not see any log message.
Comment #12
PolInteresting, do you have any error in the log ?
(tail -f /var/log/apache2/error_log)
Comment #13
gunwald CreditAttribution: gunwald commentedNo, I can't find anything that has something to do with Openlayers.
Comment #14
PolThis is weird, you should have an error somewhere.
Did you checked in the wecent log messages (admin/reports/dblog) ?
Comment #15
gunwald CreditAttribution: gunwald commentedCould not find any log messages in admin/reports/dblog? That came from Openlayers.
But, after I have deleted all files of the module, restored the database (for some reason the update to the dev broke my views), redownloaded the dev, cleared the cache, it works again. Sorry for making much noise here.
Seems, that the problem with the double rendered entities is gone.
Thanks
Gunwald
Comment #17
jamix CreditAttribution: jamix commented#9 also worked for me, thanks.
Comment #18
juantxo_kupul CreditAttribution: juantxo_kupul commented#9 also worked for me
Comment #19
pvaling CreditAttribution: pvaling commentedDuplicates are still broken in 7.x-2.0-beta9. render() is called twice.
Comment #20
imshuffling CreditAttribution: imshuffling commentedYeah i am getting the same, tried upgrading to dev branch with no luck.
Comment #21
PolI need help on this bug please!
Comment #22
stefank CreditAttribution: stefank commentedHi all,
I narrow down the problem. When an user has the permission "Use contextual links" then the point is showing as duplicate. This is only for map overlay using clusters.