Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Warning: count(): Parameter must be an array or an object that implements Countable in ...xataface/Dataface/SkinTool.php on line 877 #99

Open
matrasas opened this issue Mar 27, 2018 · 1 comment

Comments

@matrasas
Copy link

matrasas commented Mar 27, 2018

PHP Warning: count(): Parameter must be an array or an object that implements Countable in .../xataface/Dataface/SkinTool.php on line 877

PHP version: 7.2.2

@m4745
Copy link

m4745 commented Apr 10, 2018

added is_array check for $stack variable and error is gone, dunno if there will be any consequences..

	function define_slot($params, $content,  &$smarty, &$repeat){
		if ( isset($content) ) {
			if ( $repeat) echo "We are repeating $params[name]";
			if ( @$this->app->_conf['debug'] ) $content = '<!-- Begin Slot '.$params['name'].' -->'.$content.'<!-- End Slot '.$params['name'].' -->';
			return $content;
		}

		// From this point on we can assume we're in the first iteration
		$stack =& $smarty->get_template_vars('__macro_stack__');
		if (is_array($stack)){
		$local_vars =& $stack[count($stack)-1];
		foreach ( array_reverse(array_keys($stack) ) as $macroIndex) {
			$local_vars =& $stack[$macroIndex];
			if ( isset( $local_vars['__slots__'][$params['name']]) ){
				// we found a slot to display here.
				// tell smarty not to execute the inside of this
				$repeat=false;	//
				echo $local_vars['__slots__'][$params['name']];
				//display the slot and return
				return;
			}
			unset($local_vars);
		}
	}
		if ( isset($params['table']) ) $tname = $params['table'];
		else $tname = $this->ENV['table'];

		$table =& Dataface_Table::loadTable($tname);
		$out = $table->getBlockContent($params['name']);
		if ( isset($out) ) {
			// We found a block to display here.
			$repeat = false;	// tell smarty not to execute inside of tag

			// Display the block and return
			echo $out;
			return;
		}
	}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants