NOTE: A review of the issue queue and multiple efforts to search via Google did not turn up any relevant results to my issue. All issues that came up regarding this were from years ago and not relevant to unsupported operand types.
Running PHP 5.5.14 with Drupal 8 locally. Requirements state PHP 5.5.9 and above so I should be covered. I was receiving the below fatal error after migrating a site from D6 to D8. Sorry I don't have exact steps to reproduce, but I think the issue is a pretty clear one just reviewing the code.
Fatal error: Unsupported operand types in /Users/jessenicola/projects/jessenicola.com/docroot/core/lib/Drupal/Core/Utility/LinkGenerator.php on line 153
The code on line 153:$attributes = array('href' => '') + $variables['options']['attributes'];
As you can see, it's trying to bring two arrays together just using +, when array merge seems to really be the correct way of accomplishing this.
This code resolves the issue for me:$attributes = array_merge(array('href' => ''), $variables['options']['attributes']);
Steps to reproduce are rather prohibitive for the casual issue queue goer, but are as follows:
- Create a Drupal 6 site.
- Use CCK, and link modules.
- Create a content type with links.
- Create content with links (Devel generate is advised).
- Port site from D6 to D8.
- Attempt to view content, enjoy fatal error.