Both ctools page manager and i18ncontent module implement a replacement of Drupal's default node_add. Whichever has a higher weight prevails, which has been a nuisance since the weights have been changed in a recent update.
We have a multi language site and until not long ago we could not use panels for node_add and we did not understand why at the moment. We were using i18ncontent to translate content type names and the page titles were being correctly translated until the update (we did a major update of core and several other modules). We investigated further and ctools overwrite was determined as the culprit.
I fixed it with the following patch although I would like some feedback before proposing as a patch
@@ -126,7 +126,12 @@
'language' => '',
);
+ if(function_exists('i18nstrings')){
+ // Copied from i18ncontent_node_add
+ drupal_set_title(t('Create @name', array('@name' => i18nstrings("nodetype:type:$type:name", $types[$type]->name))));
+ } else {
drupal_set_title(t('Create @name', array('@name' => $types[$type]->name)));
+ }
return page_manager_node_edit($node);
}
Comments
Comment #1
merlinofchaos commentedPage Manager very specifically checks to see if something else is already overriding the page and, if so, it will elect not to. So it shouldn't be a case of higher weight wins; it's actually the reverse. Page Manager will only override if i18nstrings comes after Page Manager and it can't see that i18nstrings wanted to override it.
Comment #2
merlinofchaos commentedThis kind of patch isn't the sort I would normally commit. Instead, you could achieve a similar result by using something such as hook_form_alter or some other hook that operates on this page in order to set the title using i18nstrings module.
Comment #3
josepvalls commentedThanks for your feedback.
I may have jumped to conclusions with the weights; nevertheless we updated a bunch of modules along with core so the reason it stopped working might had been something else. Maybe this issue can help someone else in the future.
I'm looking forward for i18n support in panels in the future. I will notify the maintainers of i18n that enabling their module would prevent panels from being able to operate on node/add and node/edit.