This issue is probably related to Notice: Array to string conversion in _link_sanitize(), but as the error message is somehow different I opened an own issue for this.

After adding one or more fields of type "Link" with user-defined attributes and title (both, "real" title and attribute) to a custom content type, I'm getting this error message after creating a new node of that content type:

Warning: unserialize() expects parameter 1 to be string, array given in _link_load() (Line 315 in ${DRUPALHOME}/sites/all/modules/link/link.module).

Though, the new node is created, each link shows up just as a "<" character.

Comments

torbjoernk’s picture

Title: Array given, but string expected as argument 1 for unserialize() in _link_load():315 » Array given, but string expected as argument 1 for unserialize() in _link_load():315 (when title-attribute is user defined)

Additional info:
This problem only occurs, when the "title" attribute is chosen to be defined by the user. Disabling the option "Allow the user to enter a link 'title' attribute" dismisses the warning message.

However, the aforementioned problem while displaying the link only the "<" character shows up, seems not related to this issue.

dqd’s picture

Priority: Major » Normal

thanks 4 report, torbjoernk. I will try to reproduce.

yang_yi_cn’s picture

I experience the same issue when I work on the issue #1417520: Fire hook_field_load and hook_field_attach_load for fields when aggregation is used..

In that issue, it tries to call hook_field_load and hook_field_attach_load when view renders a row, and that triggers this error.

I think any one use field API to do field_load / field_attach_load might experience the same thing.

A patch is provided to check if the attribute is a string, if so, unserialize, otherwise if it's already an array, return the array itself.

dqd’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Issue summary: View changes
Status: Active » Closed (outdated)

Does this issue still persist? If so keep me posted. Link module is in Drupal core now. I'll close this issue due to inactivity for 12 years and upcoming EOL of Drupal 7 in January 2025. While the project version for Drupal 7 will keep providing support for security issues and website breaking bug fixes for Drupal 7, we should try to minimize the open issues for Drupal 7 in the queue as much as possible. Thanks for the report and all the efforts in here. Feel free to re-open if you can provide a fix, a patch re-roll against latest dev which can be committed or found an additional related problem which increases the issue priority.