When I tried to prepopulate a field by passing in an id as part of an array, like /node/add/page?og_group_ref[]=3, I received the following error message.
Warning: explode() expects parameter 2 to be string, array given in entityreference_prepopulate_get_values_from_url() (line 221 of ...\sites\all\modules\contrib\entityreference_prepopulate\entityreference_prepopulate.module).
Recoverable fatal error: Argument 1 passed to EntityReference_SelectionHandler_Generic::validateReferencableEntities() must be of the type array, null given, called in ...\sites\all\modules\contrib\entityreference_prepopulate\entityreference_prepopulate.module on line 226 and defined in EntityReference_SelectionHandler_Generic->validateReferencableEntities() (line 167 of ...\sites\all\modules\contrib\entityreference\plugins\selection\EntityReference_SelectionHandler_Generic.class.php).
I know it isn't stated anywhere that the module supports this format, but it is always good to be prepared for errors.
Comment | File | Size | Author |
---|---|---|---|
#1 | entityreference_prepopulate-url_handling_error-1790632.patch | 656 bytes | glekli |
Comments
Comment #1
glekli CreditAttribution: glekli commentedAttaching a patch to address the issue.
Comment #2
amitaibuI took a different approach (if you have an error, we just ignore it), and committed. Thanks for the report.