Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikeker’s picture

Status: Active » Needs review
FileSize
4.74 KB
mikeker’s picture

Fixes undefined index error when adding FPPs in a non-context situation (eg: admin/structure/fieldable-panels-panes/manage/fieldable-panels-pane/add).

bjalford’s picture

Issue summary: View changes
Status: Needs review » Needs work

I can now see the checkbox but it doesn't save the value when selected. Going back into the pane and it's unchecked

mikeker’s picture

@bjalford, Did you run update.php (or drush updatedb)? This patch introduces a DB schema change to save the settings.

barraponto’s picture

I get empty contexts even though there is a context in my panel :/

Warning: Invalid argument supplied for foreach() in ctools_context_keyword_substitute() (line 639 of DRUPAL/profiles/quequere/modules/contrib/ctools/includes/context.inc).

btw, I also get issues for fields that are not text-type, I've fixed with a !empty check.

merlinofchaos’s picture

The reason for the empty contexts is that a content type only receives requested contexts unless it sets 'all contexts' => TRUE in its definition. Then it will always receive all contexts. Since FPP shouldn't be requesting contexts that I can think of, this should be fairly safe to set.

barraponto’s picture

@merlinofchaos actually, 'all contexts' => TRUE is set: http://drupalcode.org/project/fieldable_panels_panes.git/blob/refs/heads... :/

Right now I'm monkeypatching ctools to call fieldable_panels_panes_fieldable_panels_pane_content_type_content_type when needed (in ctools_content_select_context because calling it in ctools_content_select_context always led to out-of-memory errors).

barraponto’s picture

I figured the 'content type' key in plugin definition was missing (not sure if this is the proper way to declare it though). Then I found out that fieldable_panels_panes_fieldable_panels_pane_content_type_content_type and fieldable_panels_panes_load_entity would call each other in a loop, so I fixed it by taking a shortcut to _fieldable_panels_panes_load_entity.

Now the contexts are passed to the pane and everything works. I've fixed a small issue with fields that don't set the #markup property, such as link fields.

barraponto’s picture

Status: Needs work » Needs review
barraponto’s picture

Added support for title links as well.

Status: Needs review » Needs work
mikeker’s picture

Status: Needs work » Needs review
FileSize
6.36 KB

Rerolled #10 against the latest -dev.

Also made some adjustments to how title substitutions work as that code has evolved (title now shows as a child element in addition to $block->title...?).

brunodbo’s picture

Reroll of #13 against latest dev.

chandimac’s picture

Works great for text fields. Is there a way to get this to work for image fields as well? I'm using the Media module and there is no way to add a token substitution through the UI.

B-Prod’s picture

Status: Needs review » Reviewed & tested by the community

Last patch works as expected.

brunodbo’s picture

Rerolled patch in #14 against latest dev.

DamienMcKenna’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

This needs some tests to confirm it works. Also, this line needs to be rewritten to not have the word "you" and make the URL a link:

+ $description = t('If checked, context keywords will be substituted in this content. More keywords will be available if you install the Token module, see http://drupal.org/project/token.');

thePanz’s picture

Status: Needs work » Needs review
FileSize
5.09 KB

Re-rolled patch, with fixes as outlined by DamienMcKenna.

dpacassi’s picture

I have re-rolled the patch mentioned in #20 as FPP has meanwhile declared additional update hooks.

Status: Needs review » Needs work

The last submitted patch, 21: FPP_Context_substitutions-2018329-21.patch, failed testing.

dpacassi’s picture

Well, that was a hot shot, didn't expect so many changes inside FPP.
Here's the updated patch.

thePanz’s picture

Status: Needs work » Needs review

Moving to "Need review" to let DrupalBot pick this patch for testing.

B-Prod’s picture

This patch is a reroll of #23 against current DEV and takes care of the entity "path", that may need substitution.

DamienMcKenna’s picture

Status: Needs review » Needs work

Needs tests.

wizonesolutions’s picture

Hiding old files. Might try to fix this up. @DamienMcKenna, do you know what tests are needed at a glance?

czigor’s picture

Patch did not work on new FPP version, needed to rename hook_update_N().

firestonej’s picture

Fresh patch for dev / 7.x-1.13.