Hi All,
When the link URl is equal to page URL, I get this fatal error:
Fatal error: [] operator not supported for strings in /home/ss81/EclipseWorkspace/pcms2011/includes/common.inc on line 2314
The reason of it is that function l() tries to expand link class with "active":
...
// Append active class.
if (($path == $_GET['q'] || ($path == '<front>' && drupal_is_front_page())) &&
(empty($options['language']) || $options['language']->language == $language_url->language)) {
$options['attributes']['class'][] = 'active'; <<< line 2314
}
...
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | link_active_class-1199806.patch | 963 bytes | ss81 |
Comments
Comment #1
ss81 commentedSo far I found only this way to fix this:
But I think there should be better way.
Comment #2
ss81 commentedFixed patch:
Comment #3
jcfiala commentedWow, that's a pretty crazy error. Thanks for working on a patch.
Thing is, usually we upload a patch as a fire instead of including it like this. But, this is easier to read.
Comment #4
ss81 commentedUnfortunately yesterday I didn't have a time to checkout Link module from Git repository and make correct patch. So I made only a quick patch with SVN and posted it. Today I have a bit more free time, so I made it in correct way :)
Comment #5
acbramley commentedVery strange error, good work for finding it! Can confirm this patch fixes the problem
Comment #6
dqdfinally committed to latest --dev and pushed to repo. ss81++! ROCK!
?? from June ... o.Ô
Comment #8
mikebell_ commentedHi sorry to re-open this but this is causing the following error on our setup:
Notice: Array to string conversion in theme_link_formatter_link_default() (line 754 of /var/www/vhosts/nsacademynew.co.uk/www/sites/all/modules/link/link.module).Removing array() fixes.
Comment #9
dqd@ digital006, can U provide more infos to what you think hay caused it exactly and why and what you have removed? Thanks
Comment #10
jkingsnorth commentedNo further information came back, and the original issue was fixed. So I'm going to close this old issue. Please open a new issue (and reference this one) if you are still experiencing the problem.