I currently have D7 build with location nodes which I am filtering for a view. I am using custom markers with the use of a folder with my marker images added in a folder with the markers folder and a .ini file. I am trying to create a view with multiple location nodes in a map with GMap Markers.
So based on the way Taxonomy works now in Drupal 7, Taxonomy vocabularies are not assigned to nodes through taxomony, but through the content types with the addition of a Term field. Which is different from Drupal 6 and begs a question about how to create views maps with GMap Taxomony, Location nodes, and custom marker sets. So although you create the the GMap Vocabulary into your content type, the old GMap Marker field is not available in the node form, but is a choice in views, which make this somewhat confusing.
When creating with the GMap views style and using a Single Marker type, thinks went well and the map displayed as designed.
When creating the map using the marker field handling and selecting Node:Marker as the marker field I receive the following message with no map display.
* The view gmap_display has been saved.
* Debug:
'Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column \'gmap_taxonomy_node.vid\' in \'on clause\''
in views_plugin_query_default->execute() (line 1314 of /Users/vin/Sites/casaswingseven/sites/all/modules/drupal-contrib/views/plugins/views_plugin_query_default.inc).
* Debug:
'Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column \'gmap_taxonomy_node.vid\' in \'on clause\''
in views_plugin_query_default->execute() (line 1314 of /Users/vin/Sites/casaswingseven/sites/all/modules/drupal-contrib/views/plugins/views_plugin_query_default.inc).
So instead I tried to create the map using the marker field handling and selecting the GMap Taxonomy Term field as the marker field. The map reurned with no pins but not before a Javascript window appeared with the following message.
Request for invalid marker set 11!
With the message I believe appearing to come form icon.js.
I'm aware that this is still in dev and this functionality may still be a work in progress, but I just wanted to open this issue to either clarify if I am doing something wrong or clarify that documentation may be needed when this functionality comes into place in the D7 port.
Otherwise. Love the module. Keep up the good work!
Comment | File | Size | Author |
---|---|---|---|
#81 | gmap_7_x.zip | 1.53 MB | liminu |
#80 | gmap-taxonomy_markers_fix-1057922-80.patch | 4.89 KB | victoriachan |
#59 | designtn - gmap.tar_.gz | 929 KB | andrea.cavattoni |
#45 | gmap_taxonomy.module-reformatted.patch | 1.77 KB | juhaniemi |
#44 | gmap_taxonomy.module.patch | 2.08 KB | Digeridoo |
Comments
Comment #1
casaswing CreditAttribution: casaswing commentedThis issue adds a bit more clarity to my previous issue...
http://drupal.org/node/1054482
Which can be closed. I don't think this is a bug, but either functionality which is not there yet or a need for support to properly configure marker fields.
FYI, I am using Location 7.x-3.x-dev (as of 2/7/11), Node Locations 7.x-3.x-dev along with GMap 7.x-1.x-dev, GMap Location 7.x-1.x-dev, GMap Macro Builder 7.x-1.x-dev, and GMap Taxonomy Markers 7.x-1.x-dev
Comment #2
alfarovive CreditAttribution: alfarovive commentedSubscribing. I'm in the same boat.
Comment #3
zabelc CreditAttribution: zabelc commentedI'm seeing the same thing
Comment #4
sebish CreditAttribution: sebish commentedSubscribing.
Comment #5
elgandoz CreditAttribution: elgandoz commentedme too!
Comment #6
Jānis Bebrītis CreditAttribution: Jānis Bebrītis commentedcannot get this working either, subscribe
Comment #7
rumblewand CreditAttribution: rumblewand commentedsubscribing
Comment #8
rumblewand CreditAttribution: rumblewand commentedShould this thread be changed to a coding issue? I don't think it is functioning properly regardless of documentation.
Comment #9
skaduI am also running in to this same issue. I did a very brief amount of digging and have run in to what I believe are two things contributing to this issue...I do not claim to have a full understanding of this, just saw everyone else having the same issue and wanted to drop in my thoughts:
The following is from gmap_taxonomy.module, and as noted in the code // @@@ PROBLEM -- $node->taxonomy doesn't exist anymore!. So this update never runs even when the function is called. This is probably what is leading to the empty table and calls to the wrong column. The call seems to be looking for vid, and even if this table where to update, there is still no vid, it seems to be set up to work with the nid.
The gmap_taxonomy_term table has the correct relationship between terms and markers, this just needs to be carried over into the gmap_taxonomy_node table, which then links the node, to its term, and its marker.
Like I said, no solution yet, just thoughts about the problem. If I am totally wrong feel free to let me know. I will be working on this a little bit in the near future to hopefully dig deeper and see if I can update this to work.
@rumbleweed I also believe this is a coding issue and not a documentation issue.
Comment #10
rumblewand CreditAttribution: rumblewand commentedI'm going to move it over into code if no objections.
Comment #11
casaswing CreditAttribution: casaswing commentedNo objections whatsoever rumblewand. Thanks!
Thanks for the info. I'll look into the code myself to see if I can get this to work. Thanks
Comment #12
farald CreditAttribution: farald commentedI did a workaround on the problem with lacking taxonomy marker support.
In 'extended gmap' display type, you are able to display markers based on a field in the row.
Do this:
Example: Under field value code, enter
'return "monday";'
I found this very powerful, as you may override marker types on whatever custom conditions you may want.
Comment #13
lolmaus CreditAttribution: lolmaus commentedAh, this is a result of using a dev version. Subscribing.
PS Shouldn't broken functionality be categorized as a bug?
Comment #14
dan1eln1el5en CreditAttribution: dan1eln1el5en commentedsubscribing
Comment #15
rumblewand CreditAttribution: rumblewand commentedtrue story - changed to bug report
Comment #16
casaswing CreditAttribution: casaswing commentedThanks everyone,
Getting a better idea what is happening now. This does seem like a bug.
This seems like a good opportunity for me to submit my first patch. Been busy last week, but will try my best.
Comment #17
sogesan CreditAttribution: sogesan commentedALTER TABLE `gmap_taxonomy_node` ADD `vid` INT NOT NULL
Comment #18
lolmaus CreditAttribution: lolmaus commentedHey sogesan #17,
now the view works without displaying an error. But all markers are default.
I'm displaying nodes of a certain node type. The node type is associated with a number of taxonomy vocabs. One of the vocabs is set to determine the marker. I've chosen different markers for each term in that vocabulary.
So how do i make my view display markers based on that vocabulary settings?
Comment #19
nonsiesub
Comment #20
Digeridoo CreditAttribution: Digeridoo commentedPatch is correcting gmap_taxonomy_node_update() function which is called after node/revision/fields saving routines. So, we can get all node's taxonomy terms which is are markers. And then save terms and markers info into gmap_taxonomy_node table.
Befor
After
Comment #21
TimelessDomain CreditAttribution: TimelessDomain commentedDid #17 & #20 , but still not working
Upon saving ANY node(with or without taxonomy markers enabled for the taxonomies applied to that node) i get
perhaps my problem is from using table prefixes in the database. Shouldn't "INSERT INTO {gmap_taxonomy_node}" include the table prefix as "INSERT INTO {prefix_gmap_taxonomy_node}" ?
Comment #22
Wouter Van den Bosch CreditAttribution: Wouter Van den Bosch commentedI'm getting the same message as @TimelessDomain, even though I'm not doing the whole db prefix thing, so it shouldn't be related to that.
Can you have a look again at your patch to see what's up? I'd be glad to provide more info if needed.
Comment #23
Wouter Van den Bosch CreditAttribution: Wouter Van den Bosch commentedAnd thanks for the tip Hamaldus (#12) !
I'm using the same approach in a simple GMap style view now, because I am using the actual location fields. Apart from that, I'm now fetching the marker type via a custom PHP function, which I call in the excluded PHP field.
Great thinking from your part! Thanks for sharing.
Comment #24
Syph CreditAttribution: Syph commentedhi Wouter Van den Bosch,
Can you please share your custom php function so that I may adapt it to my site?
Regards,
Aaron
Comment #25
webthingee CreditAttribution: webthingee commented+1
Full error when trying to use taxonomy markers.
Debug:
'Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column \'gmap_taxonomy_node.vid\' in \'on clause\''
in views_plugin_query_default->execute() (line 1380 of /home/public_html/xxx/sites/all/modules/views/plugins/views_plugin_query_default.inc).
Comment #26
zabelc CreditAttribution: zabelc commentedI've tried the same tactic as Wouter Van den Bosch, but the non-extended GMap view doesn't appear to use the value of the field.
Has anyone actually gotten "Marker Fields" to work? I've even tried having my php field hard-coded to 'drupal' (also 'Drupal', also a numeric constant), and I *always*l get the "fall-back marker".
I've upped the priority to major because there appears to be no work-around for this.
Comment #27
dafederI'm having the same problem. I added a marker field, it is requesting a marker set with the correct name, which is defined in an .ini file. It LOOKS to me like this set is being called correctly in gmap_makers.js after rebuilding the marker cache, although that file is hard to understand... However, this is not, I don't think, anything DB related, so maybe this is a different issue.
Comment #28
dafederI have gotten this working now - I had a problem in my .ini file. Markers working as expected!
Comment #29
zabelc CreditAttribution: zabelc commented@dafeder, did you have to change anything in the standard .ini file? What text are you putting in your field? Are you just somehow including the marker set?
E.g. if I wanted to use the small.ini marker set and the Small Red marker specified below, what should my field contain?
[small red]
name = "Small Red"
sequence = "red.png"
Thanks!
Comment #30
dafederHi zalbec. Here is how I did it: I added a bunch of marker images to the marker directory. I then created a new ini file called "placetypes.ini" and added a marker set for each image. For instance, I have an image of a plate for restaurants, so I have:
(I think the name could probably just be "Plate" there)
Now, my content type for locations has a term reference field for a "place type" vocabulary. The terms in THAT vocabulary have a custom field, "icon", which is a text field with a select widget, with an allowed value for each of my marker sets (for instance, all food-related place types get a value of "plate" in this field).
In my view, I use relationships to load the "icon" field for each location. Then in the style settings for my gmapextended view type, I set that field to be "marker type". After re-generating the marker cache in gmap settings, it worked.
My case is a little more complicated because I have several taxonomy terms sharing the same icon. The great thing about how this works is that it is very flexible, you can use any views field to define your markers, not necessarily just taxonomy.
Comment #31
zabelc CreditAttribution: zabelc commenteddafeder, many thanks for the detailed description.
Unfortunately, I don't think this works for the non-extended GMap view.
After setting my default marker to something else, I've tried creating a simple Custom Text type field which always contains the word 'drupal', but I can't seem to get the normal drupal marker to appear: only my separate default one.
Comment #32
dafederzabelc - why can't you use the extended style?
Comment #33
Todd Young CreditAttribution: Todd Young commentedWhat the crap?!? I tried the PHP field trick in the non-extended gmap and it worked - did I miss something?
Comment #34
zabelc CreditAttribution: zabelc commented@dafeder, I'm using a Location Field (i.e. Location CCK), so my node/entity doesn't have a Latitude/Longitude field to plug into the GMap Extended properties, rather my field has a "sub-field".
@Todd Young, how are the nodes in your view set up? do they have locations directly, or are you using location fields?
Comment #35
dafederzabelc - I'm using location field as well. I load latitude and longitude as separate fields (displaying them in decimal degrees).
Comment #36
Todd Young CreditAttribution: Todd Young commentedOK I take it back. I can do various tricks with PHP to make the markers change, but the problem I'm having is that no matter how I try to refer back to the node (by using taxonomy or a dedicated marker field) the returned value is always the Node ID and never what you would expect it to be (a string, array, taxonomy ID, anything!)
I think there's something seriously broken in the relationship between location and content revision.
Comment #37
Todd Young CreditAttribution: Todd Young commentedI have a temporary fix until views relationships to taxonomy fields actually bring back the correct values of related fields.
Put the following into the VALUE php code of a Global PHP field:
...where field_loc_marker is a list field in the nodes that references marker type by exact names. You do not need anything in the output php code.
It looks strange to be selecting the same value that I am providing in the WHERE clause, normally you'd ask why the SELECT statement is required if you already know the value. But keep in mind that $row->field_loc_marker is incorrectly returning the node ID. Plus you have the added benefit of this automatically breaking when the underlying problem is fixed, ie. $row->field_loc_marker starts returning the correct value.
This is probably horrifyingly inefficient, but so far it's the only way I've found to call up varying markers by node and/or taxonomy.
Comment #38
dafederTodd Young: I highly recommend something more along the lines of what I describe in #30. It's not as tidy as it should be but once it's set up, it works fairly painlessly without having to run a new db query for each row of your view, which believe me will slow your view down noticeably if you have a significant number of results.
Comment #39
rrom CreditAttribution: rrom commentedI have tried all things above. Works only with php views field and static marker like "small brown" from #37 but not with marker assigned to taxonomy term.
Subscribing.
Comment #40
rickmartin CreditAttribution: rickmartin commentedAlso have this issue. Subscribed.
I keep forgetting how much of a headache researching drupal problems is...
Comment #41
rickmartin CreditAttribution: rickmartin commented@hamaldus, Is there anyway that you/someone who has gotten this to work could elaborate on #12 a little?
(I'm not a developer, just someone who -- regrettably -- chose drupal to try to make a map with exposed filters)
Comment #42
kwseldman CreditAttribution: kwseldman commentedSeconding @rickmartin's request to @hamaldus. Not sure how to state the allowed values in the field. I'm trying
small red|small red marker for current projects
small blue|small blue marker for former projects
and getting an error - undefined marker set.
Comment #43
stanley78 CreditAttribution: stanley78 commented33 weeks... the only issue prevents me from switching to D7... help! :)
Comment #44
Digeridoo CreditAttribution: Digeridoo commentedI corrected the patch from #20. Problem was when taxonomy term doesn't have a marker. In this case, left join operator is worked incorrect in query. I just replace it to join operator. Please, test it.
And don't forget about this:
ALTER TABLE `gmap_taxonomy_node` ADD `vid` INT NOT NULL
Comment #45
juhaniemi CreditAttribution: juhaniemi commented@44 Patch was malformed, so I re-formatted patch based on Creating a patch instructions.
I didn't test it though.
Comment #46
evets33 CreditAttribution: evets33 commentedThis patch doesn't work for me :-(
Comment #47
stanley78 CreditAttribution: stanley78 commentedyep. gmap_taxonomy_node still hasn't any records.
Comment #48
evets33 CreditAttribution: evets33 commentedyes stanley78, the same problem :-(
The module GMAP is still updated for D7 ?
Comment #49
Steven.Pescador CreditAttribution: Steven.Pescador commentedSubscribing.
Comment #50
Aldus CreditAttribution: Aldus commentedSame here. Choosing taxonomy markers in a view give this error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'gmap_taxonomy_node.vid' in 'on clause'
Using D7 and a location cck
Comment #51
smitty CreditAttribution: smitty commentedChoosing taxonomy markers in a view results in this error:
Using D7, GMap Location, Node Locations and GMap Taxonomy Markers.
Same problem with and without the patch from #45.
Comment #52
andrea.cavattoni CreditAttribution: andrea.cavattoni commentedSame here... :-(
Comment #53
beauz CreditAttribution: beauz commentedSame as #51, subscribing.
Comment #54
andrea.cavattoni CreditAttribution: andrea.cavattoni commentedi'll upload a working gmap version in a cople of days..
Comment #55
evets33 CreditAttribution: evets33 commentedHello cavax
Please, have you progress in your work ?
Comment #56
andrea.cavattoni CreditAttribution: andrea.cavattoni commentedok there we go, taxonomy is working and also the php macros
Let me know if it works for all
http://www.de-signtn.it/gmap.tar.gz
Comment #57
evets33 CreditAttribution: evets33 commentedI've tested that but it doesn't work for me :-(
In my taxonomy, i have in GMap Marker : I have Small Red
In database, i have in gmap_taxonomy_term
Textes complets tid marker
Modifier Effacer 556 small red
556 is my tid which is real present in taxonomy_term_data
I flushed the cache... But i have the default google icon :-(
Comment #58
indaloweb CreditAttribution: indaloweb commentedThe problem persist with the cavax gmap module
Comment #59
andrea.cavattoni CreditAttribution: andrea.cavattoni commentedHope this one is working, i've attacehd also the extinfowindow.,
Let me know
Comment #60
vchukhantsev CreditAttribution: vchukhantsev commentedWork's for me. But you forgot comment die() in gmap.module in function template_preprocess_gmap_view_gmap.
Comment #61
indaloweb CreditAttribution: indaloweb commentednothing....
My taxonomy view doesnt show the location coordinates in gmap mode, and I can't add the field in html list for example. I think that there is a problem between the taxonomy location and the view.
The message persist... SQLSTATE[42S22]: Column not found: 1054 Unknown column 'latitude' in 'field list'
Comment #62
vchukhantsev CreditAttribution: vchukhantsev commentedHmmm... create new taxonomy dict with custom markers and test again. Now gmap markers don't work, if i understand correctly some hook must add record to gmap_taxonomy_node table, but this doesn't happen.
Try to debug this, found bad query in gmap_taxonomy.module in function gmap_taxonomy_node_update near 160 line. It works with one dict, but don't work with other.
Comment #63
vchukhantsev CreditAttribution: vchukhantsev commentedQuick dirt fix work's for me. I can't explain wtf. Don't have much experience with Drupal, m.b. somebody explain me this.
Comment #64
Atomox CreditAttribution: Atomox commentedSubscribing.
Comment #65
ditcheva CreditAttribution: ditcheva commentedSubscribing. Unfortunately, #12 doesn't work for me either (though I appreciate the detailed description). :-(
Comment #66
beauz CreditAttribution: beauz commentedI finally managed to sort my problems out with getting custom taxonomy markers working.
Here is some tips:
1. Make sure to add the vid field to the gmap_taxonomy_node table as in #22
ALTER TABLE `gmap_taxonomy_node` ADD `vid` INT NOT NULL
2. I used the version of the module cavax posted in #56. This has important changes in the gmap_taxonomy.module file in the function gmap_taxonomy_node_update($node) ~line 159
3. Resaved each node that needed a custom marker which seemed to add the right entries into the gmap_taxonomy_node table.
4. Made sure the gmap view settings were set to "By term" under marker handling
5. Made sure the taxonomy terms themselves had a custom marker select under the term edit page
Hopefully this helps someone as it took me nearly a whole day to sit down with all this code and properly understand it and get it working.
Comment #67
alexio2170 CreditAttribution: alexio2170 commented@beauz Hi, I'm following your way but now I have a strange white page with "Here".
Did you install the #22 release from scratch or did you just override old files?
Of course I've followed steps 1 to 5...
Many thanks.
Comment #68
beauz CreditAttribution: beauz commentedAh yes there was some debug code left in the gmap module cadax posted. If you do a search through the code you should be able to find the spot where it has
print("Here.");
Just comment out those lines.
Comment #69
alexio2170 CreditAttribution: alexio2170 commentedgreat, it's working now!
Comment #70
alexio2170 CreditAttribution: alexio2170 commentedactually there 2 working workaround solutions
http://drupal.org/node/1057922#comment-5698944
http://drupal.org/node/1054482#comment-4368976 (just tried)
many thanks
Comment #71
webcultist CreditAttribution: webcultist commentedcavax could you please also provide the last patch you did for the downloadable version you linked? I have already a patched version (http://drupal.org/node/1459606) and need to combine them.
Thanks a lot!
Comment #72
andreas hagerman CreditAttribution: andreas hagerman commentedCan you specify more precisely where to comment out? I can't find it and all I get on my view is "Here". Thanks
Comment #73
jday CreditAttribution: jday commentedI followed all the steps in #66 but the markers are still all using the default color.
Comment #74
Macronomicus CreditAttribution: Macronomicus commentedSame as #73
Perhaps the php field option is the only way?
I've not tried that yet.
Comment #75
jday CreditAttribution: jday commentedAfter re-saving some nodes I am now seeing the various marker colors I've selected for the terms, however, they are not displaying the correct color per term, it seems random. For example, term A is set to be blue, and term B set to be red...some of the term A node markers are blue but some are red! And some of the term B markers are correct but some are blue! I have 7 different terms, each with a different color but the colors are not matching correctly...
Comment #76
leda.ch CreditAttribution: leda.ch commentedI just wanted to create a gmap view based on a cck location field in my nodes and another cck taxonomy-field therein - which obviously not works right.
Also I just didn't want to apply patches or such, so I ended up with creating my own module for a individual q&d solution in this case:
1. Adding this field is necessary:
ALTER TABLE `gmap_taxonomy_node` ADD `vid` INT NOT NULL DEFAULT 0
2. New module, coding hook_node_update, just copied over from the gmap_taxonomy-module:
This at least keeps node and one term in sync.
3. The contents in gmap_taxonomy_node are missing yet, so insert them with a bulk update, p.e. via un/publishing nodes.
Now views works as expected.
Comment #77
kiwimind CreditAttribution: kiwimind commentedIt would seem that following the steps as outlined in #66 doesn't quite work as expected.
If you create a new node, the default marker is used. If you then go straight back in and resave this node without changing anything, the correct taxonomy based marker is then used.
I have now, somehow, removed all of the location details from both the display nodes and the map popups. Not quite sure what I've done as everything should be back as it was... Back to the drawing board.
Comment #78
Slovak CreditAttribution: Slovak commentedI replaced parts of #76 and put that straight into the gmap_taxonomy.module - it is finally saving info to gmap_taxonomy_node even though I used my specific CCK field name in the code. Would like to see it make back into the module soon.
Comment #79
dmegatool CreditAttribution: dmegatool commentedJust tried the taxonomy module to figure it doesn't work. So what's the solution ? I'm not using any cck field so the #76 seems to confuse me. Wouldn't know that to change. #66 make a reference to #56 which gives a 404... I just want to assign a taxonomy term to a node so that the marker is based on it.
Is the "Use marker field" option work ? How are we suppose to use this option ? I tried to supply data with a taxonomy term named the same as my marker but I guess that's not what it's looking for.
Comment #80
victoriachan CreditAttribution: victoriachan commentedI've created a patch to fix the problem in gmap_taxonomy_node_update() and gmap_taxonomy_views_data().
gmap_taxonomy_node_update() needed to get at the taxonomy_term_reference fields in a different way since in D7 $node->terms does not exist anymore.
gmap_taxonomy_views_data() needed to use nid instead of vid as there is no vid in the gmap_taxonomy_node table.
The patch is made for 7.x-2.x-dev
Please review.
Thanks!
Comment #81
liminu CreditAttribution: liminu commentedMy solution:
1) do this query:
ALTER TABLE `gmap_taxonomy_node` ADD `vid` INT NOT NULL DEFAULT 0
2)remove primary key from table gmap_taxonomy_node
3)use the patched attachment
4)resave all the node.
5)enjoy! :-)
P.S.
if you use an attachment remember to set Ajax to yes, Inherit to yes and expose the same filter (with the same default value) in the block and in the attachment.
In the settings of gmap remember to set "Marker handling" to "by term".
Comment #82
gillarf CreditAttribution: gillarf commented#66 worked for me - thanks @beaux and @cavax
If you want to update loads of existing nodes with new terms (as i did) use views bulk operations. Use the 'Change entity value' action, applied to the taxonomy reference.
This also saves all the nodes again, which helps with step 3.
Comment #83
podarok#80 looks good
commited to 7.x-2.x and 7.x-1.x branches
thanks!