I was getting this error

[error] [client 155.52.208.80] PHP Fatal error:  Unsupported operand types in /path/to/drupal/sites/all/modules/views/plugins/views_plugin_row_rss_fields.inc on line 123

I added this to the render() function in views_plugin_style_atom_fields.inc


      // This will be filled in by the row plugin and is used later on in the
      // theming output. copied from views_plugin_style_rss.inc
      $this->namespaces = array('xmlns:dc' => 'http://purl.org/dc/elements/1.1/');

It was trying to add other namespaces but $this->view->style_plugin->namespaces was not defined

Comments

adbo’s picture

The offending statement was
$this->view->style_plugin->namespaces += $xml_rdf_namespaces; should be
$this->view->style_plugin->namespaces = array_merge($this->view->style_plugin->namespaces, $xml_rdf_namespaces); since I don't think you can '+=' an array that doesn't already exist.

Patch to follow shortly

adbo’s picture

Status: Active » Needs review
StatusFileSize
new794 bytes

Here is the simple patch. This patch produces the following warnings: Warning: array_merge() [function.array-merge]: Argument #1 is not an array

I will replace this patch to correct this.

adbo’s picture

StatusFileSize
new752 bytes

Updated patch attached

adbo’s picture

StatusFileSize
new1.06 KB

Better formatted patch

jmdeleon’s picture

None of the patches in this issue worked for me.

There appears to be a related issue directly in the Views issue queue. I submitted a patch to Views in that issue that resolved the issue for me.

jmdeleon’s picture

StatusFileSize
new480 bytes

After running into other similar errors with this module, I am attaching a patch to the Views Atom module itself, which initializes the namespace array in the Views display plugin.