When i edit my view in Format > Show: (Semantic Views:Fields) Settings it first takes a very long time to come up (atleast 10 seconds), and i then i get this error:

Warning: array_merge(): Argument #1 is not an array in array_merge() (line 4194 of /home/dev/drupal-7.x/includes/form.inc). =>

otherwise everything seems to work.

for convenience, here is the relevant part from includes/form.inc >

/**
 * Sets a form element's class attribute.
 *
 * Adds 'required' and 'error' classes as needed.
 *
 * @param $element
 *   The form element.
 * @param $name
 *   Array of new class names to be added.
 */
function _form_set_class(&$element, $class = array()) {
  if (!empty($class)) {
    if (!isset($element['#attributes']['class'])) {
      $element['#attributes']['class'] = array();
    }
/**LINE 4194**/    $element['#attributes']['class'] = array_merge($element['#attributes']['class'], $class);
  }

Comments

petergus’s picture

Issue summary: View changes

changed explaination

olie480’s picture

I was having the same issue, so I was looking through the code and changed all of the class code from string to an array. It was just 2 files:

'#attributes' => array(
        'class' => 'clear-block',
),

Should be

'#attributes' => array(
        'class' => array('clear-block'),
),

Just add array() around 'clear-block'

I changed these in semanticviews_plugin_row_fields.inc and semanticviews_plugin_style_default.inc

I would make a patch, but don't know how to at this moment...

Hope this helps! It helped me!

ghazlewood’s picture

StatusFileSize
new1.2 KB

Here's a patch!

phiscock’s picture

Thank you. That patch worked perfectly for me.

phiscock’s picture

Issue summary: View changes

spelling

bryancasler’s picture

Applied #2 to all occurrences of 'class' => 'clear-block', and it worked.

Scyther’s picture

Issue summary: View changes
Status: Active » Reviewed & tested by the community

Works!

Scyther’s picture

Status: Reviewed & tested by the community » Closed (duplicate)
Related issues: +#1888258: Row Class Attribute Field is not shown because of CSS bug