Changes to "delete" or "list" checkboxes in the image list are not saved, even though message appears that "changes have been saved". This issue occurs only on hosted server - it works fine when running exact same code on local windows pc with XAMPP. File and database permissions look fine.

Server config:
Apache/1.3.34 (Debian) mod_auth_pam/1.1.1 mod_gzip/1.3.26.1a mod_perl/1.29 mod_fastcgi/2.4.2 AuthMySQL/4.3.9-2 mod_ssl/2.8.25 OpenSSL/0.9.8c

Comments

PeterE’s picture

While trying to debug the form submit handler in 'node_images.pages.inc', I discovered that the issue seems to be caused by the 'list' and 'delete' checkboxes passing the default value (0 or 1) instead of the user selection - i.e. the state of checked or unchecked.

e.g. $row['list'] = array('#type' => 'checkbox', '#default_value' => 0) will always return a value of 0, regardless of what the state of the checkbox was when submitted.

I am still puzzled why this behaviour only occurs on the hosted Apache server (php 5.2.0) as this exact same code works fine on my notebook (php 5.2.8). The only thing I can think of is the PHP version.

Any ideas?

PeterE’s picture

After some more troubleshooting I discovered that the issue seems to be caused by the 'wrapper for fieldset contents' in 'node_images.pages.inc'.

// Wrapper for fieldset contents (used by ahah.js).
$form['node_images']['wrapper'] = array(
'#prefix' => '

',
'#suffix' => '

',
);

As a temporary fix I made the following changes :

//$form['node_images']['wrapper'] += _node_images_edit_form($form_state, $node);
$form['node_images'] = _node_images_edit_form($form_state, $node);

//$form['node_images']['wrapper'] += _node_images_attach_form($form_state, $node);
$form['node_images'] = _node_images_attach_form($form_state, $node);

The only visible side-effect seems to be that the page does not refresh when new images a loaded.

Hopefully this bug will be resolved soon.