Using 1.x-dev. Geocoding from an Addressfield on the OG Membership Entity. I receive the following error after trying to update the membership. It doesn't seem to affect core node types with the same setup.
Recoverable fatal error: Argument 3 passed to l() must be of the type array, null given, called in /modules/geocoder/geocoder.widget.inc on line 540 and defined in l() (line 2481 of /includes/common.inc).
Any thoughts?
I found similar issues in other contrib modules for reference.
#2315905: Recoverable fatal error: Argument 3 passed to l() must be an array, string given with references_dialog
#1806944: Recoverable fatal error: Argument 3 passed to l() must be an array, null given
The code that the error is referencing:
function geocoder_widget_get_link($entity_type, $entity) {
$uri_info = entity_uri($entity_type, $entity);
list($id, , $bundle) = entity_extract_ids($entity_type, $entity);
$label = t('View offending @entity_type (@bundle # @id)', array(
'@entity_type' => $entity_type,
'@bundle' => $bundle,
'@id' => $id,
));
return l($label, $uri_info['path'], $uri_info);
}I am going to assume there is something about it being the OG Membership Entity, since we are not experiencing the same with the core content entity.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | interdiff-2806741-8-9.diff.txt | 810 bytes | szeidler |
| #9 | geocoder-argument_l_function-2806741-9.patch | 1.3 KB | szeidler |
| #8 | geocoder-argument_l_function-2806741-8.patch | 1.14 KB | szeidler |
| #4 | geocoder-2806741-4.patch | 932 bytes | pifagor |
Comments
Comment #2
pixelsweatshop commentedComment #3
pifagor commentedPatch
Comment #4
pifagor commentedAdd end line
Comment #5
pixelsweatshop commentedWow. That was fast @pifagor. Thank you.
The patch failed to apply against the 1.x-dev but I manually changed it and the error still persists.
Here is the output of the rejected patch.
Comment #6
polAs soon as someone reviewed the patch, I'll commit it.
Comment #7
nigelw commentedI have tried to apply the patch as well and unfortunately it doesn't work. Still shows Recoverable fatal error: Argument 3 passed to l() must be of the type array, null given
Comment #8
szeidlerI also ran into the issue and it seems, that the affected function was refactored quite drastically.
I applied the hotfix of patch 4 for the current codebase.
It basically happens when
return NULL values, which are passed into the l() function later on. It's not nice, because we're not logging the
watchdog_exception(), but better than having the fatal error.Comment #9
szeidlerMaybe this is a cleaner approach, because actually an empty
$uri_infocauses the error, not the entity ids.Comment #11
polHi,
Re-rolled and pushed.
Comment #12
pifagor commentedWhy didn't we add credits to people?
Comment #13
polHi there,
I usually credit people when the applies without any issue.
In this case, the submitted patch was completely outdated and I did something different in the code.
Don't worry, I always credit people as it should otherwise.
Thanks.