Home » Topics » General Support » Undefined variable: acfw

Undefined variable: acfw

ACF Widgets Support General Support Undefined variable: acfw

This topic contains 2 replies, has 2 voices, and was last updated by  Neil 2 years ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #103580

    Neil
    Participant

    Hi,

    Just purchased a license for single site installation. I’m adding a repeater to a widget and am receiving the following PHP error:

    Notice: Undefined variable: acfw in widget-sponsors.php on line 3

    ACF Pro version 5.5.14
    Wordpress version 4.8

    Here is the source:

    		<?php
    		// check if the flexible content field has rows of data
    			if( have_rows('sponsor_list', $acfw) ):
    			// loop through the rows of data
    			while ( have_rows('sponsor_list', $acfw) ) : the_row();
    			// check current row layout
    			$logo = get_sub_field('sponsor_logo', $acfw);
    		?>
    				<ul>
    					<li class="slide"><img src="<?php echo $logo['image'];  ?>" alt="<?php echo $logo['alt'] ;?>" /></li>
    				</ul>
    		<?php
    			endwhile;
    			else :
    			// no layouts found
    			endif;
    		?>			
    

    Assistance would be greatly appreciated. Thank you

    #103581

    Daron Spence
    Keymaster

    Neil,

    I’m not sure what the problem is here. Can you experiment with a single field type? Maybe something has changed under the hood in ACF that I need to fix regarding repeaters.

    I don’t know if you have this online somewhere, but if you do, you can post a private reply here in the forum (only I can see it) with login credentials, and I can try to take a look more directly.

    Cheers

    #103584

    Neil
    Participant

    Hey Daron,
    I migrated from a development server to a staging server and the error resolved. Must be something with the dev config.

    Thank you for your response

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Undefined variable: acfw’ is closed to new replies.