Jump to:
| Project: | Internationalization |
| Version: | 4.6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
I am working on a multilanguage site.
After the translating of an item I got a page wich shows the title "submit" and the new node id.
If I submit an translated page with an error (for example without a title) I will also get the page with "Submit" as title and node id. This time including an error message but without the form to correct my input.
I use i18n 4.6.0 and drupal 4.6.3. Do others have the same experience?
I have fixed this in my installation by editting the function i18n_translation_page() in i18n.inc (v 1.11).
The added code I took from the function node_page() in node.module.
a line beginning with a '-' indicates te code removed.
a line beginning with a '+' indicates te code I added.
function i18n_translation_page() {
$op = $_POST['op'] ? $_POST['op'] : arg(1);
$edit = $_POST['edit'];
switch ($op) {
case 'node':
print theme('page', i18n_translation_add(arg(2), arg(3)));
break;
case t('Preview'):
$edit = node_validate($edit);
print theme('page', node_preview($edit), t('Preview'));
break;
case t('Submit'):
- drupal_set_title(t('Submit'));
- print theme('page', node_submit($edit));
+ if ($nid = node_submit($edit)) {
+ if (node_access('view', $edit)) {
+ drupal_goto('node/'. $nid);
+ }
+ else if (db_result(db_query('SELECT nid FROM {node} WHERE nid = %d', arg(1)))) {
+ drupal_access_denied();
+ }
+ else {
+ drupal_goto();
+ }
+ }
+ else {
+ drupal_set_title(t('Submit'));
+ print theme('page', node_preview($edit));
+ }
+ break;
case t('Delete'):
print theme('page', node_delete($edit), t('Delete'));
break;
default:
// print theme('page', node_page_default(), '');
}
}
Comments
#1
#2
Thanks for the patch.. That was annoying me earlier on today...
Mike
#3