Skip to content

Commit 1f50679

Browse files
author
Jen Lampton
committed
Fix bug with missing non-square icons.
1 parent bda5a0c commit 1f50679

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

on_the_web.module

+7-8
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,12 @@ function on_the_web_display_block($delta, $settings = array(), $contexts = array
185185
$classes = array('on-the-web', 'otw-' . $size, 'otw-' . $service);
186186

187187
$icon = FALSE;
188-
if (isset($info['fa-icon'])) {
189-
$icon = $info['fa-icon'];
190-
}
191-
if ($config->get('type') == 'font' && $config->get('square') == TRUE) {
192-
if (isset($info['fa-icon-square'])) {
188+
if ($config->get('type') == 'font') {
189+
if (isset($info['fa-icon'])) {
190+
$icon = $info['fa-icon'];
191+
}
192+
// Only use a square version if it exists.
193+
if ($config->get('square') == TRUE && isset($info['fa-icon-square'])) {
193194
$icon = $info['fa-icon-square'];
194195
}
195196
}
@@ -198,14 +199,12 @@ function on_the_web_display_block($delta, $settings = array(), $contexts = array
198199
'#theme' => 'on_the_web_item',
199200
'#service' => $service,
200201
'#link' => $link,
202+
'#icon' => $icon,
201203
'#size' => $size,
202204
'#title' => $title,
203205
'#classes' => $classes,
204206
'#weight' => $config->get($service . '_weight'),
205207
);
206-
if ($icon) {
207-
$links['#icon'] = $icon;
208-
}
209208
}
210209

211210
if ($type == 'anchor') {

0 commit comments

Comments
 (0)