I have Drupal 6.14, CCK 2.6. I have tried it with 2.5 as well, same problem.

I have installed the following:
Views 2.7
Content Profile 1.0-b4 (switched off, but didn't matter)
Automatic Nodetitles 1.2 (switched off, but didn't matter)

plus a bunch of other modules that don't seem relevant to this issue.
____________
I am able to add fields to a node, but when I try to update the field I get a blank page and the updated information is not saved. When trying to delete a field the same happens. So I basically see the update / delete page, but when I confirm I get a blank page. The action is not performed either.

The path of the blank page is for example:
/admin/content/node-type/page/fields/field_test4?destinations[0]=admin%2Fcontent%2Fnode-type%2Fpage%2Ffields

It happens to Text fields, Number fields. There are no errors reported or logged.
Field groups seem to work just fine.

Some other weird behavior:
- Option widget doesn't ever appear as a possible field when I install it.

- When I want to make a Usernode reference I get the following error on the edit page (perhaps unrelated and entirely different bug, but I guess it should be mentioned):
"user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE key_name = 'field_test6_uid'' at line 1 query: SHOW INDEX FROM drupalcontent_type_page WHERE key_name = 'field_test6_uid' in
/sites/all/modules/cck/content.module on line 2069."
When submitting the edit page I get a blank page again.

Since, I haven't found any other reports about this, I get the strong impression that it's me and not the CCK module. Could you tell me how I could provide more detailed bug information?

Comments

eelkeboezeman’s picture

forget the thing I said about the Option Widget

eelkeboezeman’s picture

when trying to uninstall the modules that make up cck, I get white pages again upon confirmation. The modules are not deleted

markus_petrux’s picture

Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

- Version of PHP?
- Version of MySQL?
- What do your logs say? hmm... nothing in PHP or Apache logs? (so, check corresponding PHP/Apache options).
- Since you have a lot more modules, try testing CCK alone.
- Also, make sure the files in the CCK package have been installed in their correct locations.

Many sites are running CCK. So there should be something odd in your installation. We need to know a step by step procedure to reproduce the issue. Otherwise, it is not possible to guess what's going on.

eelkeboezeman’s picture

I reinstalled drupal in a different location and installed CCK. The same error occurs.

- Version of PHP?
5.0.5

- Version of MySQL?
4.1.14

- What do your logs say? hmm... nothing in PHP or Apache logs? (so, check corresponding PHP/Apache options).
I've sent an e-mail to the system admin to ask whether there's anything in the server logs. No errors reported in Drupal's logs.

- Since you have a lot more modules, try testing CCK alone.
Check, I've done this. Clean install with only CCK Content and Text installed and the same error occurs.

- Also, make sure the files in the CCK package have been installed in their correct locations.
It is installed in /sites/all/modules/cck

I've tried to do some debugging myself. When I try to delete a CCK field somewhere along the process content_field_instance_delete($field_name, $type_name, $rebuild = TRUE) is called (includes/content.crud.inc, line 546). Line 550 is:
$field = array_pop(content_field_instance_read(array('field_name' => $field_name, 'type_name' => $type_name)));

This line is not (completely) executed: when I echo something after this line, it is not printed (anything before line 550 is printed). content_field_instance_read(array('field_name' => $field_name, 'type_name' => $type_name)) is completely executed. I split up line 550 into the following:

$temp = content_field_instance_read(array('field_name' => $field_name, 'type_name' => $type_name));
$field = array_pop($temp);

Now, the code executes fine without problem - the field is deleted and the confirmation page is loaded.

When I searched for more instances of array_pop() I saw the same pattern, for example line 329:

  $previous = content_field_instance_read(array('field_name' => $field['field_name'], 'type_name' => $field['type_name']));
  $prev_field = array_pop($previous);

This code is called when I try to update a field. The function content_field_instance_update() (line 321) is completed successfully, but I can't find what code called this function, so this is where my debugging streak ended :)

Any idea, what I could do now to resolve this?
Thanks,
Eelke

eelkeboezeman’s picture

The system admin has checked the logs and found this:

[Sun Nov 29 16:43:59 2009] [error] [client 193.11.209.53] PHP Fatal error:  Only variables can be passed by reference in /vol/www/rimun/web-docs/2010/sites/all/modules/cck/includes/content.admin.inc on line 1283, referer: http://www.rimun.org/2010/admin/content/node-type/page/fields/field_test1?destinations[0]=admin%2Fcontent%2Fnode-type%2Fpage%2Ffields                       
[Sun Nov 29 16:52:58 2009] [error] [client 193.11.209.53] PHP Fatal error:  Only variables can be passed by reference in /vol/www/rimun/web-docs/2010/sites/all/modules/cck/includes/content.admin.inc on line 1283, referer: http://www.rimun.org/2010/?q=admin/content/node-type/page/fields/field_test1                                                                                
[Sun Nov 29 16:57:19 2009] [error] [client 193.11.209.53] PHP Fatal error:  Only variables can be passed by reference in /vol/www/rimun/web-docs/2010/sites/all/modules/cck/includes/content.admin.inc on line 1283, referer: http://www.rimun.org/2010/?q=admin/content/node-type/page/fields/field_test1                                                                                
[Sun Nov 29 16:59:53 2009] [error] [client 193.11.209.53] PHP Fatal error:  Only variables can be passed by reference in /vol/www/rimun/web-docs/2010/sites/all/modules/cck/includes/content.crud.inc on line 550, referer: http://www.rimun.org/2010/?q=admin/content/node-type/page/fields/field_test1/remove

basically the list is much longer but all the same type of error.

I figure my PHP version is out of date?

eelkeboezeman’s picture

Title: Blank page when trying to update / delete content field » CCK does not work with PHP 5.0.5. Fatal error;

The source of the problem is PHP 5.0.5

http://the-stickman.com/web-development/php/php-505-fatal-error-only-var...

function getAnArray() {
  $myArray = array ( 1, 2, 3 );
  return $myArray;
}
echo( array_pop( getAnArray() ) );

now results in
Fatal error: Only variables can be passed by reference

An ugly fix:

function getAnArray() {
  $myArray = array ( 1, 2, 3 );
  return $myArray;
}
echo( array_pop( $my_temp_variable= getAnArray() ) );

I would like to help you by offering patches but I have zero experience in this area.