Hi all,

One of our modules uses CSS classes assigned to links and buttons to add custom logic. From this module we receive multiple warnings that:

Warning: in_array() expects parameter 2 to be array, string given in func()...

According to Drupal 7.x documentation attribute 'class' should be an array: https://api.drupal.org/api/drupal/developer%21topics%21forms_api_referen...
One of the places where we identified the problem is line where implode function is executed:

'class' => implode(' ', $menu_classes),

which can be changed to simply:

'class' => $menu_classes,

Comments

veret created an issue. See original summary.

veret’s picture

Attaching file with patch which removes implode() function.

cameron tod’s picture

Title: Attribute 'class' value should be an array » Attribute 'class' value passed to l() function should be an array

  • Cameron Tod committed 90c405a on 7.x-1.x authored by veret
    Issue #3065537 by veret: Attribute 'class' value passed to l() function...
cameron tod’s picture

Version: 7.x-1.20 » 7.x-1.x-dev
Status: Patch (to be ported) » Fixed

Commited with attribution. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.