When i post a new node and preview it. Taxonomy image don´t show any image or shows the first image alphabetically.
When i post a new node, I select term/16 on the combo list and the preview source code tries to show term/17 image.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | Viewing a node | 34.58 KB | organicwire |
| #4 | Previewing the same node | 45.21 KB | organicwire |
Comments
Comment #1
nancydruIs this still happening in the latest code?
Comment #2
xman commentedI don't know. I have test the 1.4 version. I will try the new 1.5 version.
Comment #3
nancydruNo further information.
Comment #4
organicwire commentedHi,
I encountered the same error.
I have a node type that is linked to a taxonomy vocabulary. Of the vocabulary, each taxonomy term has an image. When creating a new node and previewing it before submitting, the wrong image is shown. When the image is saved, it shows the right image (see attached screenshots).
As far I could understand this is due a bug in
taxonomy_image_node_display_nodeapi(..). Here, in line 120 is writtenforeach ($node->taxonomy as $tid => $term) { [...]You assume that you get $tid and $term (the term object). This is only the case if a node is actually viewed. If it's previewed, foreach gets you the vocabulary ID and the term ID. Therefore, in case the node is previewed, I'd propose