The Title module is often used when translating a site using Entity translation.

If the Title module is used to replace titles in fieldable panels panes then the panelizer content modal doesn't pass the title back to the page when save is clicked.

It seems that that is because Panopoly Widgets unsets the title. However, the Title module is already hiding the title field... which causes the problem.

Patch coming.

Steps to reproduce:

1) Install Entity Translation and Title modules
2) Set a content type up so that it can be translated using Entity Translation, with URL language negotiation.
3) Set up a translation of a node from the above content type so that you can test. For example have EN and ES
3) Replace Titles in one of your fieldable panels pane types
4) Using the 'customize this page' button at the bottom of your node, click + on a region to add a fieldable panels pane of the type you have chosen. Give it a title. Save to close the modal.
5) Note that when the modal closes the pane you just added doesn't show a title.

Comments

Andrew Edwards’s picture

StatusFileSize
new886 bytes

Patch that checks to make sure the title module isn't active on the field before doing the unset

Andrew Edwards’s picture

Status: Active » Needs review
martin_q’s picture

This seems to work for me, though translation of these panes is a bit convoluted - you have to go to, for example, admin/structure/fieldable-panels-panes/manage/image and then click on edit, then on the translate tab. That's not your fault, though.

Once I had done all this, I had the title of the panel displayed below the fieldable panel pane as well as at the top, where I expected to see it. Does this happen to you too? Any idea how to deactivate it? The display of the pane is nothing like the settings at admin/structure/fieldable-panels-panes/manage/image/display. Very odd.

martin_q’s picture

Status: Needs review » Reviewed & tested by the community

My bad. I'm not sufficiently used to using the UI for field display! Or I got distracted. Anyway, I was wrong. The display of the title below the image is deactivated simply by dragging "Title" down into the "hidden" section of the fields list at admin/structure/fieldable-panels-panes/manage/image/display... on the other hand I'm not clear how to prevent the display of the title above the image, should I want to. But... sorry for hijacking your thread about that!

Meanwhile, the patch definitely does its job!

Andrew Edwards’s picture

Great! Thanks for reviewing.

If you wanted to prevent the title above the image you would, I think, need to override panels-pane.tpl.php. For example, if you wanted to override all fieldable panels panes you would have a tpl.php named panels-pane--fieldable-panels-pane.tpl.php

Andrew Edwards’s picture

Agreed that the translation process is convoluted by the way! There is a module which is supposed to help, but I couldn't get it to work with Panopoly: https://www.drupal.org/project/mlpanels

HaiNguyen007’s picture

If the Title module is used to replace titles in fieldable panels panes then when add that pane through IPE's modal have notice & warning:

Notice: Undefined index: title in panopoly_widgets_form_alter() (line 191 of /path/to/modules/panopoly/panopoly_widgets/panopoly_widgets.module).
Notice: Undefined index: link in panopoly_widgets_form_alter() (line 197 of /path/to/modules/panopoly/panopoly_widgets/panopoly_widgets.module).
Warning: Invalid argument supplied for foreach() in element_children() (line 6549 of /drupal_root/includes/common.inc).
Warning: Invalid argument supplied for foreach() in element_children() (line 6549 of /drupal_root/includes/common.inc).

It seems that that is because Panopoly Widgets unsets the title & link. However, the Title module is already hiding the title & link field... which causes the problem.

Related issue: #2507123 Add support for Title module in Panopoly_widgets

dsnopek’s picture

Status: Reviewed & tested by the community » Needs review

The latest patch is different than the one that was RTBC'd, so marking this as Needs review to determine if the #7 is better or if we should roll with #1.

nlambert’s picture

#1 is working for me.
#7 is not

nlambert’s picture

Status: Needs review » Reviewed & tested by the community

Maybe I should RTBC this?

dsnopek’s picture

StatusFileSize
new893 bytes

I tested the patch in #1 and it works great!

Here is a new patch that cleans up the comment and switches from !empty() to isset() (since empty() actually evaluates if the item is TRUE/FALSE too).

Going to try this on Travis in a moment.

EDIT: Here's the Travis build: https://travis-ci.org/panopoly/panopoly/builds/73407299

  • dsnopek committed c55f3a8 on 7.x-1.x
    Update Panopoly Widgets for Issue #2314059 by Andrew Edwards, dsnopek,...
dsnopek’s picture

Status: Reviewed & tested by the community » Fixed

Tests passed! Committing. :-)

  • dsnopek committed c55f3a8 on 8.x-1.x
    Update Panopoly Widgets for Issue #2314059 by Andrew Edwards, dsnopek,...

  • dsnopek committed c55f3a8 on 8.x-2.x
    Update Panopoly Widgets for Issue #2314059 by Andrew Edwards, dsnopek,...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.