PHP Fatal Error on submission of webform

jrglasgow - July 15, 2008 - 14:34
Project:Akismet
Version:6.x-1.0-beta1
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

Using Drupal 6.3

I create a new webform, on submission of the webform I get the White Screen of Death. My logs show the following error.

PHP Fatal error: Unsupported operand types in /var/www/vhosts/example.com/includes/common.inc on line 1265, referer: http://example.com/node/add/webform

#1

jrglasgow - July 15, 2008 - 14:40

on looking into this further I see that the string of code in common.inc is in the url() function.

The url function changed from D5 to D6
D5 usage

url($path = NULL, $query = NULL, $fragment = NULL, $absolute = FALSE)

D6 usage
url($path = NULL, $options = array())

the error appears to be coming at the concatenation of defaults to the $options array

<?php
function url($path = NULL, $options = array()) {
 
// Merge in defaults.
 
$options += array(
   
'fragment' => '',
   
'query' => '',
   
'absolute' => FALSE,
   
'alias' => FALSE,
   
'prefix' => ''
 
); // <---- this is the line 1265 in the error message

?>

#2

jrglasgow - July 15, 2008 - 15:12
Project:Webform» Akismet
Version:6.x-2.1.1» 6.x-1.0-beta1

This error, only happening on submission of webform node, is actually being caused by akismet module

#3

jrglasgow - July 15, 2008 - 15:18

I've used grep to track down the offending lines of code:

./akismet/akismet.module:1026:      '!content-link' => url('node/'. $content->nid, NULL, 'comment-'. $content->cid, TRUE)
./akismet/akismet.module:1034:      '!content-link' => url('node/'. $content->nid, NULL, NULL, TRUE)
./akismet/akismet.module:1547:    $comment_data['permalink'] = url('node/'. $content->nid, NULL, 'comment-'. $content->cid, TRUE);

#4

jrglasgow - July 15, 2008 - 15:37
Status:active» fixed

I was going to make a patch but it has already been fixed in HEAD

#5

Anonymous (not verified) - July 31, 2008 - 04:47
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.