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.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | panopoly_widgets-support-title-module-2314059-11.patch | 893 bytes | dsnopek |
Comments
Comment #1
Andrew Edwards commentedPatch that checks to make sure the title module isn't active on the field before doing the unset
Comment #2
Andrew Edwards commentedComment #3
martin_qThis 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/imageand then click onedit, then on thetranslatetab. 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.Comment #4
martin_qMy 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!
Comment #5
Andrew Edwards commentedGreat! 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
Comment #6
Andrew Edwards commentedAgreed 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
Comment #7
HaiNguyen007 commentedIf 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
Comment #8
dsnopekThe 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.
Comment #9
nlambert commented#1 is working for me.
#7 is not
Comment #10
nlambert commentedMaybe I should RTBC this?
Comment #11
dsnopekI tested the patch in #1 and it works great!
Here is a new patch that cleans up the comment and switches from
!empty()toisset()(sinceempty()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
Comment #13
dsnopekTests passed! Committing. :-)