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

Warning: implode(): Invalid arguments passed in /timber-library/lib/MenuItem.php #1477

Closed
CRouss opened this issue Jul 7, 2017 · 1 comment

Comments

@CRouss
Copy link

CRouss commented Jul 7, 2017

I'm new to Timber (just inherited a site that uses it) and I just upgraded to Timber 1.3. The site was using a beta version from roughly 8 years ago.

Per the Timber Upgrade guide, I changed the Routes::map syntax which cleared up one PHP error. However, after the upgrade I'm getting a series of repeated PHP warnings in the Timber plugin MenuItem class:

"implode(): Invalid arguments passed in /wp-content/plugins/timber-library/lib/MenuItem.php on line 177."

	public function import_classes( $data ) {
		if ( is_array($data) ) {
			$data = (object) $data;
		}
		$this->classes = array_merge($this->classes, $data->classes);
		$this->classes = array_unique($this->classes);
		$this->classes = apply_filters('nav_menu_css_class', $this->classes, $this, array(), 0);
		$this->class = trim(implode(' ', $this->classes)); <-- line 177
	}

Another potential (unrelated?) detail: The install I inherited is using composer. Functions.php does not have the autoload.php statement, and when I tried to insert it at the top of the file, the site showed several errors. New to composer, but guessing the autoload.php is already being run? Without the statement in functions.php, the site still loads, but I get PHP warnings above the site.

Steps to reproduce behavior

Loading site home page

What version of WordPress, PHP and Timber are you using?

WordPress 4.7.5, PHP 5.6, Timber 1.3.3

How did you install Timber?

Downloaded from WordPress.org

@gchtr
Copy link
Member

gchtr commented May 3, 2023

We’re sorry you didn’t get an answer to this. I’m going to close this, because it’s quite an old issue.

@gchtr gchtr closed this as completed May 3, 2023
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