Bug #23606 Bug Fixed

Fluid variables do not output if inside a subfield using a {content}{/content} tag pair

Version: 4.2.1 Reporter: Rick Lecoat

I am seeing different behaviour regarding the output of fluid field variables when used inside a sub-field, depending upon whether that sub-field has a single ‘content’ tag or whether it uses a tag pair. Eg, in the following:

{my_fluid_field}
    {my_fluid_field:sub_field}
      {my_fluid_field:current_field_name}
     {content}
    {/my_fluid_field:sub_field}
{/my_fluid_field}

The current_field_name variable correctly outputs the name of the subfield that it is in. But in this:

{my_fluid_field}
    {my_fluid_field:sub_field}
      {my_fluid_field:current_field_name}
     {content}{/content}
    {/my_fluid_field:sub_field}
{/my_fluid_field}

It does not.

Is this a bug? I guess I might be using the variable tags in the wrong way — to be honest the docs are bit thin in this area and knowing quite how to structure the syntax is not entirely obvious — but the above issue does seem like it might be a bug. (If it’s not, though, could somebody maybe bulk-up the documentation to make it a little clearer how those variables should be used? I received various pieces of helpful of advice on that from the Slack channel, but it often contradicted other people’s advice or the docs themselves, and nobody seemed to be 100% certain).

  • On line 140 of system/ee/EllisLab/Addons/fluid_field/Service/Tag.php change:

    $tagdata = $this->parsePairs($field);

    to:

    $tagdata = $this->parsePairs($field, $tagdata);

    On line 152 update the parsePairs method signature and remove the first line of code:

    protected function parsePairs(FieldFacade $field)
    {
        $tagdata = $this->getTagdata();

    like so:

    protected function parsePairs(FieldFacade $field, $tagdata)
    {
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases