When creating a translation for a panel, a new language neutral panel is created instead.

Comments

luckystrikerin’s picture

I have the same prob.

This is because "?translation=[sourcenodeid]&target=[languagecode]" is missing behind the URL after clicking "add translation"

zilverdistel’s picture

Version: 7.x-3.0-alpha2 » 7.x-3.0-alpha3

Also having this problem in the 7.x-3.0-alpha3 version, though I'm not getting language neutral panel nodes as a result because I disabled language neutral for panel nodes in my content type settings. The new panel node is not marked as being a translation of the source node.

The link in the "en/node/%nid/translate" page is "nl/node/add/panel?translation=77&target=nl".
Clicking on it redirects me to "nl/node/add/panel/choose-layout".
After clicking on a panel layout, this is my landing page: "nl/node/add/panel/twocol_bricks". The option "Dutch" has been preselected in the language dropdown.

My i18n version is 7.x-1.0-beta4.

zilverdistel’s picture

If I manually add the "?translation=77&target=nl" to the landing page (after selecting the panel layout), I'm succeeding in translating panel nodes.

To summarize: for an english panel node with nid = 77, I can create a dutch panel node as a translation of node 77 with the url "nl/node/add/panel/twocol_bricks?translation=77&target=nl".

So all we need to find out is where these arguments are being chopped off the links.

zilverdistel’s picture

Version: 7.x-3.0-alpha3 » 7.x-3.x-dev
Status: Active » Needs review
StatusFileSize
new1001 bytes

I created a patch for the latest dev version. The problem seemed to be an api change for the drupal 7 version of the url function which is used by drupal_goto(). The query arguments should now be in a subarray $opts['query'].

Please review the patch, but I have to say it's pretty straight-forward, so it shouldn't be a problem at all.

FYI: the patch also applies to the 7.x-3.0-alpha3 release.

luckystrikerin’s picture

for me this is working fine (7.x-3.0-alpha3). Thanks for the patch.

zilverdistel’s picture

Status: Needs review » Reviewed & tested by the community
zilverdistel’s picture

Can this be committed to dev?

lklimek’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new727 bytes

Hi,

I've tested this patch and found another bug.
If we get to a page like: /node/15#overlay=node/add/panel%3Fdestination%3Dnode/15/translate%26translation%3D15%26target%3Dpl then panels module does not work - it tries to redirect to "node/15/translate" instead of "node/add/panel/choose-layout" .
A dirty hack is to unset $_GET['destination'].

I've modified the patch and attached it below.

lektum’s picture

Having the same problem on Drupal 7.4 with Panels 7.x-3.0-alpha3.

Is this problem solved on the dev current version ? If yes, is it "risky" to run under the dev version or is it ok ? Some good experiences for that ?

Thanks.

Letharion’s picture

Component: User interface » Panel nodes
Status: Needs review » Needs work

Sounds like the status here is really needs work. The "Panel nodes" module is going to be deprecated, and the Panelizer module is going to take over, so that's probably the way to go for everyone. #1353542: Upgrade path from Panel Nodes to Panelizer has an upgrade path.

I'll leave the issue open for a while, but Panel Nodes patches are no longer very likely to get in.

s.daniel’s picture

Does the Panelizer Module provide translation support? I can't find any information on this.

To summaries the only way to use panels on international sites with translated content currently is to embedd a view displaying nodes in a panel where the view handles the language handling. (At least that's what I read) Is that correct?

marcopeters’s picture

@#11 Using the selection rules for each variant of a panel, you can detect the language. Just create a panel with 1 variant, add all content, clone that variant and add the selection rule. This way you only need the panel with multiple variants to have it as a multilingual panel.

Letharion’s picture

Status: Needs work » Closed (won't fix)

Panelizer has now been out for a while, and even seen it's second release. I'm closing this old Panel Nodes issue as I doubt anyone is interested in working on them anymore.

sdelbosc’s picture

What follows might be of interest for those who face this issue. It uses an implementation of hook_language_switch_links_alter() to append the layout of the source node to the add translation link. This way panels_node does not redirect to choose-layout when accessing to nod/add/panel_node_type.

/**
 * Implements hook_language_switch_links_alter().
 * Perform alterations on language switcher links.
 */
function my_module_language_switch_links_alter(array &$links, $type, $path) {
  // Make sure that 'add translation' links on translate tab of panel nodes
  // includes the layout name to avoid being redirected to choose-layout page
  // and lose translation context.
  if ($type == 'language' && $path == 'node/add/my_panel_node_type') {
    // Retrieve the layout of the source node.
    $current_panel_node = menu_get_object();
    $current_display = panels_load_display($current_panel_node->panels_node['did']);

    // Update the links.
    foreach ($links as $lang => $link) {
      $links[$lang]['href'] .= '/' . $current_display->layout;
    }
  }
}