Posted by pcambra on July 15, 2009 at 11:01am
| Project: | Link |
| Version: | 6.x-2.6 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
I am getting this error when I save a node:
( ! ) Fatal error: Cannot use string offset as an array in /webs/mysite.com/sites/mysite.com/modules/link/link.module on line 249
I've added a chek of is_array for $item['attributes'] in _link_process function
<?php
if (is_array($item['attributes'])) {
if (!$item['attributes']['target'] || $item['attributes']['target'] == "default") {
unset($item['attributes']['target']);
}
}
?>I am attaching a patch.
Comments
#1
here is the patch
#2
Checking if the variable is an array fixes the problem, but the correct solution would be to initialize the attributes array so that we don't have is_array() checks everywhere in the code.
#3
Could you please check with the current development snapshot and report back if the issue continues ?
#4
fixed a year ago. we are @ 6.x-2.9