Dynamic Content Looper Provider - Provider Output "Is Not Empty" Condition causing problems for repeater field

Hi. I believe this is probably related to a previous support/forum post I submitted recently.

I have an ACF Repeater and I’m using it as a looper provider. In order to conditionally display the elements I have assigned the condition Looper Provider Output Is Not Empty.

Here is my layout:

The “Photo Credits” is the looper provider: {{dc:acf:post_field field="photo_credits"}}
And the “Value > Headline” is the looper consumer.

I have attempted to apply the “Looper Provider Output” (Is Not Empty) condition to the Looper Provider “Photo Credits” div, but this has created the following PHP warning:

And has also caused noticeable strain on the browser (when editing in Cornerstone) and decreased loading times on the front-end page.

Here is the full Warning and stack trace:

Warning: count(): Parameter must be an array or an object that implements Countable in /Users/colinsafranek/Local Sites/pinnacle-dev/app/public/wp-content/themes/pro/cornerstone/includes/integration/acf.php on line 350

#   Time    Memory  Function    Location
1   0.0007  409672  {main}( )   .../index.php:0
2   0.0007  409944  require( '/Users/colinsafranek/Local Sites/pinnacle-dev/app/public/wp-blog-header.php' )    .../index.php:17
3   0.6149  16713280    require_once( '/Users/colinsafranek/Local Sites/pinnacle-dev/app/public/wp-includes/template-loader.php' )  .../wp-blog-header.php:19
4   0.6976  19274504    include( '/Users/colinsafranek/Local Sites/pinnacle-dev/app/public/wp-content/themes/pro/cornerstone/includes/views/theming/layout-single.php' )    .../template-loader.php:106
5   0.8224  20618792    do_action( )    .../layout-single.php:8
6   0.8224  20619168    WP_Hook->do_action( )   .../plugin.php:470
7   0.8224  20619168    WP_Hook->apply_filters( )   .../class-wp-hook.php:327
8   0.8224  20620296    CS_Action_Defer->cs_layout_10( )    .../class-wp-hook.php:303
9   0.8224  20620672    CS_Action_Defer->__call( )  .../class-wp-hook.php:303
10  0.8224  20620672    Themeco\Cornerstone\Elements\Renderer->renderRegion( )  .../helpers.php:1091
11  0.8224  20637184    Themeco\Cornerstone\Elements\Renderer->renderElements( )    .../Renderer.php:24
12  1.2109  21221136    Themeco\Cornerstone\Elements\Renderer->renderElement( ) .../Renderer.php:73
13  1.2109  21221136    Cornerstone_Element_Definition->render( )   .../Renderer.php:64
14  1.2109  21221136    Cornerstone_Element_Definition->render_one( )   .../class-element-definition.php:482
15  1.2110  21250872    x_element_render_section( ) .../class-element-definition.php:500
16  1.2110  21252000    cs_render_child_elements( ) .../section.php:183
17  1.2110  21268512    do_action( )    .../helpers.php:48
18  1.2110  21268888    WP_Hook->do_action( )   .../plugin.php:470
19  1.2110  21268888    WP_Hook->apply_filters( )   .../class-wp-hook.php:327
20  1.2110  21269264    Themeco\Cornerstone\Elements\Renderer->renderElements( )    .../class-wp-hook.php:303
21  1.2111  21269264    Themeco\Cornerstone\Elements\Renderer->renderElement( ) .../Renderer.php:73
22  1.2111  21269264    Cornerstone_Element_Definition->render( )   .../Renderer.php:64
23  1.2111  21269264    Cornerstone_Element_Definition->render_one( )   .../class-element-definition.php:482
24  1.2112  21299000    x_element_render_layout_row( )  .../class-element-definition.php:500
25  1.2112  21300504    cs_render_child_elements( ) .../layout-row.php:161
26  1.2112  21317016    do_action( )    .../helpers.php:48
27  1.2112  21317392    WP_Hook->do_action( )   .../plugin.php:470
28  1.2112  21317392    WP_Hook->apply_filters( )   .../class-wp-hook.php:327
29  1.2112  21317768    Themeco\Cornerstone\Elements\Renderer->renderElements( )    .../class-wp-hook.php:303
30  1.2112  21317768    Themeco\Cornerstone\Elements\Renderer->renderElement( ) .../Renderer.php:73
31  1.2112  21317768    Cornerstone_Element_Definition->render( )   .../Renderer.php:64
32  1.2112  21317768    Cornerstone_Element_Definition->render_one( )   .../class-element-definition.php:482
33  1.2113  21347536    x_element_render_layout_column( )   .../class-element-definition.php:500
34  1.2113  21348664    cs_render_child_elements( ) .../layout-column.php:157
35  1.2113  21365176    do_action( )    .../helpers.php:48
36  1.2113  21365552    WP_Hook->do_action( )   .../plugin.php:470
37  1.2113  21365552    WP_Hook->apply_filters( )   .../class-wp-hook.php:327
38  1.2113  21365928    Themeco\Cornerstone\Elements\Renderer->renderElements( )    .../class-wp-hook.php:303
39  1.2280  21377960    Themeco\Cornerstone\Elements\Renderer->renderElement( ) .../Renderer.php:73
40  1.2281  21377960    Cornerstone_Element_Definition->render( )   .../Renderer.php:64
41  1.2327  21403032    Cornerstone_Element_Definition->should_hide( )  .../class-element-definition.php:474
42  1.2327  21403032    Cornerstone_Condition_Matcher->match_rule_set( )    .../class-element-definition.php:535
43  1.2327  21404160    Cornerstone_Condition_Matcher->match_rule_group( )  .../class-condition-matcher.php:72
44  1.2327  21404160    Cornerstone_Condition_Matcher->evaluate_rule( ) .../class-condition-matcher.php:57
45  1.2327  21405408    Cornerstone_Condition_Rules::looper_empty( )    .../class-condition-matcher.php:48
46  1.2327  21405408    Cornerstone_Looper_Manager->get_size( ) .../class-condition-rules.php:355
47  1.2327  21405408    Cornerstone_Looper_Provider_ACF_Repeater->get_size( )   .../class-looper-manager.php:141

If you could please check this out and see what can be done. This is the second time I’ve had issues using the Provider Output condition with the ACF integration in Cornerstone. Please let me know if this is something that can be fixed, or if I need to figure out a workaround.

Staging site credentials below in secure note.

Hi @adaptifyDesigns,

Thanks for reaching out.

It seems that the Looper Provider is not returning the array to be count for Is Not Empty condition. I would also suggest you check the following article and videos which may help you on this.




Unfortunately, the given WordPress admin credentials are not working. Can you please check and send it once again.

Thanks

I don’t know why the credentials aren’t working. I got an email saying that someone had updated the password for that username, and it was not me, so I’m thinking someone else on your team did that. But since I don’t know who, or what the new password is, I’ve updated it again. See secure note below:

Also, please note that I have updated the Work - Single layout template and used a true/false checkbox ACF field as the condition to display/hide the Photo Credits repeater field. I used this as a workaround because I don’t want the Looper Provider Output condition causing problems with my build, and I need to move on and continue developing, I do not have time to wait.

Please feel free to use the staging site to experiment with the Repeater Looper Provider Output conditions and try to identify the bug. As mentioned before this is not the first problem I’ve had with ACF multi-dimensional fields as looper providers in cornerstone. There are definitely problems with that feature, for both repeater fields, as well as Post Object fields.

Please look into this and see if y’all can get a fix. Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.