We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2611
    • 394 Posts
    Create this snippet:
    <?php
    
    $sourceArray = array(
    	array(
    		'waarde' => 'Waarde 1',
    		'andere' => 'Andere waarde',
    		'config' => array(
    			'thumb' => '1.jpg',
    			'keyVuller' => 'test'
    		)
    	),
    	array(
    		'waarde' => 'Waarde 2',
    		'andere' => 'Nog andere waarde',
    		'config' => array(
    			'keyVuller' => 'test'
    		)
    	),
    	array(
    		'andere' => 'Andere waarde',
    		'waarde' => 'Waarde 3',
    		'config' => array(
    			'keyVuller' => 'test'
    		)
    	)
    );
    
    $output = '';
    foreach($sourceArray as $item) {
    	$output .= $modx->getChunk('getRowsTpl', $item);
    }
    
    return $output;


    And try this chunk: (call it "getRowsTpl")
    Waarde: [[+waarde]], thumb: [[+config.thumb]]<br />


    I’m sure we all agree, that after one loop...the config.thumb should be empty?
    Well it isn’t! All other values ARE...why is this so? Is it a feature...or a bug?

    It doesn’t help to call the placeholder uncached.

    Thanks in advance,
    b03tz.
      Follow me on twitter: @b03tz
      Follow SCHERP Ontwikkeling on twitter: @scherpontwikkel
      CodeMaster
      • 28215
      • 4,149 Posts
      This has been fixed in 2.0.5 (was actually the first fix):

      - [#2552] Fix scope issues when passing nested arrays in Chunk properties
      - http://github.com/modxcms/revolution/commit/3dea257d6ef4b046c94d8db942bfd1dc07f5813a
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 2611
        • 394 Posts
        Thanks alot! I searched for it...but couldn’t find it. Sorry! rolleyes
          Follow me on twitter: @b03tz
          Follow SCHERP Ontwikkeling on twitter: @scherpontwikkel
          CodeMaster
          • 28215
          • 4,149 Posts
          No worries. It’s kind of a hard to find fix because of the nature of what was fixed.
            shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
            • 2611
            • 394 Posts
            Good good...i can’t WAIT for the 2.0.5 release! (I know i have to anyway...hehehehe)

            All hard work!
              Follow me on twitter: @b03tz
              Follow SCHERP Ontwikkeling on twitter: @scherpontwikkel
              CodeMaster