Page-title breaks CCK's content-copy.
| Project: | Page Title |
| Version: | 6.x-2.2 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | fixed |
Jump to:
With page title enabled, CCK exports are invalid and cannot be imported - if you attempt to import a CCK content-type, it fails stating: "An illegal choice has been detected. Please contact the site administrator."
Steps to reproduce:
- install Drupal 6.13, CCK 6.x-2.4 and Page-title 6.x-2.2
- ensure the content module, content-copy module and page title modules are enabled
- export any content type (at admin/content/types/export) - copy the export code to clipboard or a temporary file
- remove the content type
- import the content type (at admin/content/types/import) using the previously supplied export code
Result: Error message is displayed
Expected result: Success message is displayed; content type is created
You can see the issue in the CCK exported code, where you'll find a section which reads:
'page_title' =>
array (
'show_field' =>
array (
0 => 1,
'show_field' => false,
),
'pattern' => '',
),The line containing 0 => 1 is invalid and breaks the export.
The error is caused by line 189 in page_title.module, in the form_alter function:
'#default_value' => array('show_field' => variable_get('page_title_type_'. $form['#node_type']->type .'_showfield', 0) ? 'show_field' : 0),The format for #default_value on checkboxes is array('foo', 'bar'), not array('foo' => 'foo', 'bar' => 'bar') - this is described in comment 7 of http://drupal.org/node/216295#comment-725034
Line 189 could read:
'#default_value' => variable_get('page_title_type_'. $form['#node_type']->type .'_showfield', 0) ? array('show_field') : array(),Patch attached.
Using Drupal 6.13, CCK 6.x-2.4 and Page-title 6.x-2.2
| Attachment | Size |
|---|---|
| page_title.module.patch | 605 bytes |

#1
#2
The patch fixes the problem for me, thanks.
#3
Patch works for me, many thanks!
#4
Applied to Drupal 5, 6 and 7 dev branches. Will be included in the next release. Cheers guys :-)