$element['namespace'] is sometimes and array not a single value.

a_c_m - July 17, 2008 - 15:35
Project:Comment RSS
Version:5.x-1.0
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

As the title says, $element['namespace'] is sometimes and array not a single value. Which means when you array_merge on line 198 and then implode on line 201 the result is :

xmlns:dc="http://purl.org/dc/elements/1.1/" Array

This is due to the code on line 115-> 121

<?php

     
foreach ($extra as $element) {
        if (
$element['namespace']) {
         
$namespaces[] = $element['namespace'];
        }
      }
?>

Should be (assuming it may be an array or single value) :

<?php

     
foreach ($extra as $element) {
        if(
is_array($element['namespace'])) {
          foreach (
$element['namespace'] as $elements_namespace) {
           
$namespaces[] = $elements_namespace;
          }
        }
        else if (
$element['namespace']) {
         
$namespaces[] = $element['namespace'];
        }
      }
?>

a_c_m

#1

Gábor Hojtsy - September 9, 2008 - 08:53
Status:needs review» postponed (maintainer needs more info)

When is it a single value and not an array? I believe this might be an issue in another contributed module. I did not stumble on this issue with Drupal core itself.

#2

Gábor Hojtsy - October 1, 2008 - 14:30
Status:postponed (maintainer needs more info)» fixed

This was effectively dead code. The node feed called out to modules as if we are displaying a node in a feed, but we do not (before, the module did include the node as the first item in the feed, but the previous maintainer removed this functionality).

Code in 5.x-1.x and 6.x-1.x only added namespace items to the comment rss feed, but did not add anything from the node. Removed that dead functionality in new releases on 5.x-2.0 and 6.x-2.0. These are the new supported branches, with lots of other improvements.

#3

Anonymous (not verified) - October 15, 2008 - 14:33
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.