Using tabs i.e. as a paragraph type, unique tabs group identifiers can only be generated if the style setting field "tabs group identifier" supports token replacement.

Else it will only work for the first tab paragraph, all following tab paragraphs will not work.

CommentFileSizeAuthor
#7 token_substitution_not-2864766-7.patch4.24 KBplopesc
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Rudi Teschner created an issue. See original summary.

plopesc’s picture

Hello Rudi
Could you please provide the exact steps to reproduce the issue?

Thanks

Rudi Teschner’s picture

Sure, I'll try to. Thanks for the fast reply. =)

1) Download clean D7 with this module and its dependencies.

2) Download libraries api (which should be added to the info as dependency), the easy-responsive-tabs library along with paragraphs, panelizer and entity.

3) Enable the modules including entity_token

4) Create any paragraph bundle and enable panelizer. Set 'panelize', 'default' and 'provide initial display named Default' for the paragraph bundle.

5) On panelizer settings of paragraph add rendered parapraphs item and use one of the substitutions (i.e. %paragraphs_item:item-id) as value for tab groups identifier

6) add field of type paragraps to article with unlimited values

Great ... after following these steps on a fresh installation it works, but not on my existing project. :)
Looks like one of the other modules I use there is at fault, I'll try to narrow it down next week.

plopesc’s picture

Status: Active » Postponed (maintainer needs more info)

Thanks Rudi for your input.

Postponing the issue for now, but feel free to re-activate it in case you find the way to reproduce it :)

Rudi Teschner’s picture

You answer too quick. xD

Question ... I dont know why it works. When I debug the $settings variable in panels_responsive_tabs.inc at row 50, the tabidentify string is not replaced either, and looks the same for all three tab areas.

array(1) { 
  'panels_responsive_tabs' => array(1) { 
    [0] => array(10) { 
      'identifier' => string(13) "tabs-0-center" 
      'type' => string(7) "default"
      'width' => string(4) "auto" 
      'fit' => string(1) "1" 
      'closed' => string(1) "0" 
      'activetab_bg' => string(7) "#B5AC5F" 
      'inactive_bg' => string(7) "#E0D78C" 
      'active_border_color' => string(7) "#9C905C" 
      'active_content_border_color' => string(7) "#9C905C" 
      'tabidentify' => string(24) "%paragraphs_item:item-id" 
    } 
  } 
}

Shouldnt it be replaced at that point already? Since its in function theme_panels_responsive_tabs_style_render_region?

plopesc’s picture

Status: Postponed (maintainer needs more info) » Active

Yes, it should.

I know where to start from :)

Please, let me know if you find anything else.

plopesc’s picture

Status: Active » Needs review
FileSize
4.24 KB

Hello Rudi

Could you test this patch and confirm if works?

Thanks

Rudi Teschner’s picture

Awesome reply speed. :D

The first gets processed, the second not. I assume thats because both divs have the same html id:

markup of first tabs area
<div id="tabs-0-center" class="panels-responsive-tabs-processed" style="display: block; width: 100%; margin: 0px;">

markup of second tabs area
<div id="tabs-0-center">

After changing
$tab_id = 'tabs-' . $owner_id . '-' . $region_id;
to
$tab_id = 'tabs-' . panels_responsive_tabs_pane_tabidentifiers($display->did, $region_id);

in panels_responsive_tabs.inc in line 28 in addition to your patch it works. =)

plopesc’s picture

The purpose of tab_id and tabidentifiers is not exactly the same.
Also, given that tabidentifier field is optional, you'll proposal won't work.

Could you try this code in line 28?

$tab_id = drupal_html_id('tabs-' . $owner_id . '-' . $region_id);

This will be better, I think :)

Rudi Teschner’s picture

Ok. I've tested it with 5 different tab area paragraphs on one page and everything is looking fine. :)

  • plopesc committed 7016c6f on 7.x-1.x
    Issue #2864766 by plopesc: Token substitution not working in style...
plopesc’s picture

Status: Needs review » Fixed

Patch pushed!

Please use the -dev version. I'll probably roll the new stable version soon.

Thanks for reporting.

Status: Fixed » Closed (fixed)

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

Rudi Teschner’s picture

I'm sorry that I have to reopen this issue.

I'm running into an empty AJAX 500 error that I didn't notice during the tests in my dev environment when I try to change the panel settings. Since reverting to the unpatched 1.0 release of this module is enough to prevent the 500, I assume its directly related to the patch.

I wonder why the problem hasn't appeared during my earlier tests, because I can assure you that I have modified values after applying the patch.

plopesc’s picture

Hi Rudi,
Are you sure that these errors are coming from this module?

Could you please check Drupal/Apache logs to determine the actual error message?

In case that error is related to this module, could you please provide steps to reproduce it?

Thank you