Index: trunk/extensions/SemanticMaps/QueryPrinters/SM_MapPrinter.php |
— | — | @@ -142,7 +142,6 @@ |
143 | 143 | |
144 | 144 | } |
145 | 145 | } |
146 | | - |
147 | 146 | } |
148 | 147 | |
149 | 148 | /** |
— | — | @@ -156,14 +155,20 @@ |
157 | 156 | $legend_labels = array(); |
158 | 157 | |
159 | 158 | // Look for display_options field, which can be set by Semantic Compound Queries |
160 | | - if (property_exists($row[0], 'display_options')) { |
161 | | - if (array_key_exists('icon', $row[0]->display_options)) { |
162 | | - $icon = $row[0]->display_options['icon']; |
| 159 | + // the location of this field changed in SMW 1.5 |
| 160 | + if (method_exists($row[0], 'getResultSubject')) // SMW 1.5+ |
| 161 | + $display_location = $row[0]->getResultSubject(); |
| 162 | + else |
| 163 | + $display_location = $row[0]; |
| 164 | + if (property_exists($display_location, 'display_options') && is_array($display_location->display_options)) { |
| 165 | + $display_options = $display_location->display_options; |
| 166 | + if (array_key_exists('icon', $display_options)) { |
| 167 | + $icon = $display_options['icon']; |
163 | 168 | |
164 | 169 | // This is somewhat of a hack - if a legend label has been set, we're getting it for every point, instead of just once per icon |
165 | | - if (array_key_exists('legend label', $row[0]->display_options)) { |
| 170 | + if (array_key_exists('legend label', $display_options)) { |
166 | 171 | |
167 | | - $legend_label = $row[0]->display_options['legend label']; |
| 172 | + $legend_label = $display_options['legend label']; |
168 | 173 | |
169 | 174 | if (! array_key_exists($icon, $legend_labels)) { |
170 | 175 | $legend_labels[$icon] = $legend_label; |