Hi
I'm using display suite and I'm getting this error message.
The line highted in bold
Many Thanks for your help
Notice: Undefined index: #formatter in commons_origins_preprocess_field() (line 1101 of /var/www/mysite/profiles/commons/themes/commons/commons_origins/template.php).
foreach ($links as $key => $link) {
if (!isset($link['#access']) || $link['#access'] !== FALSE) {
$class = array($key);
// Add first, last and active classes to the list of links to help out themers.
if ($i == 1) {
$class[] = 'first';
}
if ($i == $num_links) {
$class[] = 'last';
}
if (isset($link['href']) && ($link['href'] == $_GET['q'] || ($link['href'] == '' && drupal_is_front_page())) && (empty($link['language']) || $link['language']->language == $language_url->language)) {
$class[] = 'active';
}
$output .= '
if (isset($link['href'])) {
// Pass in $link as $options, they share the same keys.
$output .= l($link['title'], $link['href'], $link);
}
elseif (!empty($link['title'])) {
// Some links are actually not links, but we wrap these in for adding title and class attributes.
if (empty($link['html'])) {
$link['title'] = check_plain($link['title']);
}
$span_attributes = '';
if (isset($link['attributes'])) {
$span_attributes = drupal_attributes($link['attributes']);
}
$output .= '' . $link['title'] . '';
}
$i++;
$output .= "
\n";
}
}
$output .= '
';
}
return $output;
}
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | commons_commons_origins_isset_trusted_contact.patch | 840 bytes | freakalis |
Comments
Comment #1
charlie charles commentedComment #2
charlie charles commentedComment #3
Antonio01 commentedHi Charlie Charles,
I had this same problem to
In this function in template.php I added this line. "if (isset($variables['element']['#formatter'])){ .... }"
The problem is i don't know to create a patch and really no have any idea of what is a "Formatter". Ezra on the irc told me i need to put an isset and they will investigate.
I hope it could help, i will try to create the patch file ...
Antonio
Comment #4
freakalis commentedHere is a patch that solves this by adding an isset first.
Comment #5
japerryAhh that makes sense with display suite. Looks good to me, I don't have DS to test against, but if it doesn't regress into commons stock (which it shouldn't.. its just an additional check), then we can commit.
Comment #6
japerryComment #8
japerryTested on our stock version of commons, no regressions there. Fixed!