I download Flexinode 4.6.0, put it into /modules/flexinode in my Drupal 4.6.3 site, and executed flexinode.mysql which it successfully created the tables. When I went to my Drupal site, instead of my Drupal site I saw what I pasted below. Note that I didn't even enabled the module through Drupal's admin screen, since I just had no admin screen and no Drupal anymore because what I was seeing was this:

field_id; if ($node->$fieldname) { $table=$node->$fieldname; $rows=count($table)+1; $cols=count($table[0])+1; } else { $table=array(); $rows=8; $cols=5; } $output = ''; $output .= form_hidden($fieldname.'_rows',$rows); $output .= '
'.t($field->label).':
'; $output .= ''; $title = t($field->label); for ($i = 0; $i < $rows; $i++) { $output .= ''; for ($j = 0; $j < $cols; $j++) { $output .= ''; } $output .= ''; } $output .= '
'; $value = (isset($table[$i]) && isset($table[$i][$j])) ? $table[$i][$j] : ''; $output .= form_textarea('', $fieldname.'_'.$i.'][', $value, 10, 3); $output .= '
  '; return $output; } function flexinode_field_table_validate($field, $node) { $fieldname = 'flexinode_'. $field->field_id; if (!isset($_POST['edit'])) { return array('value' => $node->$fieldname); } $rows = $_POST['edit'][$fieldname.'_rows']; $value = array(); $deleted_cols = array(); foreach ($_POST['edit'][$fieldname.'_0'] as $key=>$val) { if (empty($val) && $key) { $deleted_cols[] = $key; } } for ($i = 0; $i <= $rows; $i++) { if ($i && empty($_POST['edit'][$fieldname.'_'.$i][0])) { continue; } $newrow = $_POST['edit'][$fieldname.'_'.$i]; foreach ($deleted_cols as $key) unset($newrow[$key]); $value[] = array_values($newrow); // reindex from 0 } return (array('value' => $value)); } function flexinode_field_table_insert($field, $node) { $fieldname = 'flexinode_'. $field->field_id; db_query("INSERT INTO {flexinode_data} (nid, field_id, serialized_data) VALUES (%d, %d, '%s')", $node->nid, $field->field_id, serialize($node->$fieldname)); } function flexinode_field_table_db_select($field) { $fieldname = 'flexinode_'. $field->field_id; return $fieldname .'.serialized_data AS '. $fieldname; } function flexinode_field_table_load($field, $node) { $fieldname = 'flexinode_'. $field->field_id; if (isset($table_phase)) $table_phase++; else $table_phase=0; return unserialize($node->$fieldname); } function flexinode_field_table_format($field, $node, $brief = 0) { $fieldname = 'flexinode_'. $field->field_id; $table = $node->$fieldname; $output = ""; $i=0; foreach ($table as $row) { $output .= ''; $i=1-$i; } $output .= "
'.implode('  ',$row).'
  "; return $output; } function theme_flexinode_table($field_id, $label, $value, $formatted_value) { $output = theme('form_element', $label, $formatted_value); $output = '
'. $output .'
'; return $output; } ?> 
  '.$output.'
   '; return theme('form_element', $title, $output, $description, 'edit-'. $name, $required, _form_get_error($name)); } function _add_colorpickerjs(){ $js = '   '; drupal_set_html_head($js); return $js; } ?>

and it even generated an image (colour picker!).

Now my Drupal works fine because I dropped the database tables and removed the flexinode directory.

My environment is: Drupal 4.6.3, MySQL 4.1.9, PHP 5.0.3, Apache 1.3, GNU/Linux.

In short, Flexinode couldn't even work and even affected my Drupal, until I removed it.

Comments

nsk’s picture

Log entry:

Cannot modify header information - headers already sent by (output started at /var/www/html/portal/modules/flexinode/contrib/colorpickerform.inc:1) in /var/www/html/portal/includes/common.inc on line 192.
Dublin Drupaller’s picture

I just downloaded flexinode.module installed the msyql tables and it worked fine.

Am using similar setup with Drupal 4.6.3.

Based on the output you got and posted..it looks like you didn't upload the module files correctly. Recommend you

  1. delete the /flexinode/ folder and all it's contents,
  2. download a fresh copy of flexinode.module
  3. upload and reinstall

The reason I say that is because I'm working on a patch for flexinode called flexiMAX and have been talking to a lot of drupal users who are helping me test it...all need the flexinode.module and none are having problems with it.

Hope that helps..

Dub

sangamreddi’s picture

This happes due to incorrect module download/upload.
I tried now it's working fine.
I think internally the module has been saved in the html format rather than php.

As suggested by the Dub, delete the module and download the module from the drupal site and upload.

Cheers,
Sunny

nsk’s picture

I am getting crazy, I downloaded again and I have the same problem.

Here's what I did:

cd /var/www/html/portal/modules

wget http://drupal.org/files/projects/flexinode-4.6.0.tar.gz

tar -zxf flexinode-4.6.0.tar.gz

rm *gz

cd flexinode/

ls

mysql -uroot -D drupaldb < flexinode.mysql

The tables are imported correctly. This is how I install all of my Drupal modules and any other software out there, and I never had any problems, but flexinode still doesn't work for me.

johnalbin’s picture

This is caused by the PHP configuration directive short_open_tag being set to off.

I’ve searched the drupal code base and the only files that don’t use the long form of the PHP open tag (<?php ?>) are two files under modules/flexinode/contrib:

  • colorpickerform.inc
  • field_table.inc

If these two files are updated to use long form PHP tags, the “strange output” disappears. (i.e. change the first line of each file to be <?php instead of <?.)

nsk’s picture

Thank you very much for finding the cause of this problem! Setting short tags to off is standard practice and full tags are recommended for PHP. The next version of flexinode's contrib files should use proper PHP full tags.

ax’s picture

Status: Active » Fixed

should be fixed with `Short PHP tags `_

Anonymous’s picture

Anonymous’s picture

Status: Fixed » Closed (fixed)