Bug #23608 Duplicate

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

Version: 4.2.1 Reporter: creativearc

Seems very similar to bug #23606, https://expressionengine.com/support/bugs/23606/fluid-variables-do-not-output-if-inside-a-subfield-using-a-content-content-tag-pair

(Applying the solution to #23606 does not fix the issue).

Using the {fluid_field:count} in my template seems to produce output only if that particular field uses a single {content} tag. All fields with {content}{/content} pair produce no count output.

{fluid_field}
    {fluid_field:text_input}
     A count is: {fluid_field:count}
     {content}
    {/fluid_field:text_input}

    {fluid_field:grid_field}
     B count is: {fluid_field:count}
     {content}
      {content:headline} Hi EllisLabs!
      {content:caption}
     {/content}
    {/fluid_field:grid_field}
{/fluid_field}

In the above example, if I add multiple instances of ‘A’ (a text input field within a grid), they count properly. But grid field ‘B’, with it’s {content} tag pair, does not output a count value.

  • Duplicate of #23606.

    Derek Jones
    16th May, 2018 at 12:05pm
  • I can’t replicate after applying that patch. Make sure your patch is applied correctly, and that you have cleared any PHP opcache so it’s actually compiling at runtime with the patch in place.

    Derek Jones
    16th May, 2018 at 12:06pm
  • From the video you sent in Slack it looks like you left the first line of code in the parsePairs() method:

    $tagdata = $this->getTagdata();

    Per the instructions in the solution tab, you need to remove that line as well as change the method signature. Make sense?

    Derek Jones
    16th May, 2018 at 12:28pm
  • Ah! I see what you mean; that was subtle and I didn’t follow it upon first review. That does seem to fix the {count} output. Thanks!

    creativearc
    16th May, 2018 at 12:35pm

You must be signed in to comment on a bug report.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases