Hi,
when adding this file to my theme (garland or my own) I get the following error message when viewing the created comment:

Fatal error: Unsupported operand types in /includes/common.inc on line 1586

when removing this line it works but than I would like to know what is wrong with this line and how to fix it to work properly.

print l($node->title, $_GET['q'], NULL, NULL, "comment-$node->nid") . ' ' . theme('mark', $node->new);

Thank you!

Comments

dopedwizard’s picture

As for what I could find out on the net, it seems to be something with old and new code.

When adding the "dirty trick" from this page ( I only added the second part, because adding the first part of the fix would also result in a different error message)

http://justinhileman.info/articles/unsupported-operand-types-in-drupal-6x


First, you can just make things work

Here's what it'll take to make the errors go away. I wouldn't suggest using this method unless you're bypassing an error in a module you didn't write, and you don't really feel like hacking around in it to fix things. Simply drop these two snippets into drupal/includes/common.inc.

  /**
   * And drop this surprisingly similar code right
   * after the line that says:
   *
   * `function l($text, $path, $options = array()) {`
   *
   * (currently on line 1541)
   */
  // Convert arguments and move on...
  $args = func_get_args();
  if (count($args) > 3) {
    $options = array();
    if (isset($args[2])) $options['attributes'] = $args[2];
    if (isset($args[3])) $options['query'] = $args[3];
    if (isset($args[4])) $options['fragment'] = $args[4];
    if (isset($args[5])) $options['absolute'] = $args[5];
    if (isset($args[6])) $options['html'] = $args[6];
  }

Your code should work exactly as intended. Note that this method is a dirty hack, but will get the job done (i.e. treat the symptoms). Don't come crying to me when something breaks later, because I'm warning you now.

It worked, but obviously this is not the way to go in the long-run.

dopedwizard’s picture

Issue with the "stable" download, if you copy the file from the dev version it works.

crea’s picture

Status: Active » Closed (fixed)

D6 1.x branch is not supported anymore. Closing.