The title says it all.

CSS row classes are rendered fine in 7.x.3.1 and they are gone in 7.x.3.2. and the current 7.x.3.x-dev, ceteris paribus.

I checked it multiple times in different apps, including a fresh install (drush core-quick-drupal, with only views and devel_generate, and dependencies).

This is my first bug report here, so I don't know if this is major or not, but it breaks most of my sites; at minimum I use it to implement CSS grid systems, I imagine I'm not alone.

I don't have time to research this further atm, as in do a proper diff, but I'm hoping someone has an eureka moment.

Regards,
Rutger

Comments

dawehner’s picture

I really don't see how this can happen, maybe you could try to show us an export of your view.

rdeknijf’s picture

I will, later, gotta run, but for now: it's not occurring in a single view. It happens with all views (block and pages tested), in any drupal installation. Even in a new one. As soon as I drop in 7.x.3.1 it's working again.
I haven't tested it in a different environment though. I'll do that later.

rabihs’s picture

I'm facing the same problem, since the update, views row classes aren't taken into consideration.
Any idea on what to do?
Thx

Pasqualle’s picture

yes, I can confirm this too. multiple classes are concatenated with hyphens..

with 3.1: views-row clearfix main-contact
with 3.2: views-row clearfix-main-contact

Pasqualle’s picture

the problem is with views_plugin_style.inc get_row_class()

my case: row class: clearfix[tl_main_contact]

current

function get_row_class($row_index) {
..
  if ($values = explode(' ', $this->options['row_class'])){
..
    if ($class = strip_tags($this->tokenize_value($value, $row_index))) {
}

problem: the explode() does not create 2 class values, the tokenize_value() must be called first to have a space between the classes..

Pasqualle’s picture

Pasqualle’s picture

that issue added many many hyphens, where people used to have spaces.

dawehner’s picture

@Pasqualle

What should i say, you are awesome! Just reverted this patch

davidwhthomas’s picture

Forgive me if I'm wrong but isn't a translation of

clearfix[tl_main_contact]

to clearfix-main-contact

correct behaviour?

Perhaps Pasqualle needed to try

clearfix [tl_main_contact]

(note the space between the multiple row classes)

instead?

Sorry to hear you had issues with the patch.

DT

P.S If others are having a similar issue, please post the row class textfield content you are using in the view.

rdeknijf’s picture

I see that the problem has already been detected, but since I promised:

Here's an export:

$view = new view;
$view->name = 'nodequeue_2';
$view->description = 'Display a list of all nodes in queue \'Prime Triple Strip Queue\'';
$view->tag = 'nodequeue';
$view->base_table = 'node';
$view->human_name = 'Prime Triple Strip Block';
$view->core = 0;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Defaults */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->display->display_options['title'] = 'Queue \'Prime Triple Strip Queue\'';
$handler->display->display_options['css_class'] = 'skel-prime-block';
$handler->display->display_options['use_more'] = TRUE;
$handler->display->display_options['access']['type'] = 'none';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['query']['options']['query_comment'] = FALSE;
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'none';
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['style_options']['row_class'] = 'grid-4';
$handler->display->display_options['row_plugin'] = 'node';
$handler->display->display_options['row_options']['links'] = 1;
$handler->display->display_options['row_options']['comments'] = 0;
/* Relationship: Nodequeue: Queue */
$handler->display->display_options['relationships']['nodequeue_rel']['id'] = 'nodequeue_rel';
$handler->display->display_options['relationships']['nodequeue_rel']['table'] = 'node';
$handler->display->display_options['relationships']['nodequeue_rel']['field'] = 'nodequeue_rel';
$handler->display->display_options['relationships']['nodequeue_rel']['required'] = 1;
$handler->display->display_options['relationships']['nodequeue_rel']['limit'] = TRUE;
$handler->display->display_options['relationships']['nodequeue_rel']['names'] = array(
  'prime_triple_strip_queue' => 'prime_triple_strip_queue',
);
/* Field: Content: Title */
$handler->display->display_options['fields']['title']['id'] = 'title';
$handler->display->display_options['fields']['title']['table'] = 'node';
$handler->display->display_options['fields']['title']['field'] = 'title';
$handler->display->display_options['fields']['title']['label'] = '';
$handler->display->display_options['fields']['title']['link_to_node'] = 1;
/* Sort criterion: Nodequeue: Position */
$handler->display->display_options['sorts']['position']['id'] = 'position';
$handler->display->display_options['sorts']['position']['table'] = 'nodequeue_nodes';
$handler->display->display_options['sorts']['position']['field'] = 'position';
$handler->display->display_options['sorts']['position']['relationship'] = 'nodequeue_rel';
/* Filter criterion: Content: Published or admin */
$handler->display->display_options['filters']['status_extra']['id'] = 'status_extra';
$handler->display->display_options['filters']['status_extra']['table'] = 'node';
$handler->display->display_options['filters']['status_extra']['field'] = 'status_extra';
$handler->display->display_options['filters']['status_extra']['group'] = 0;
$handler->display->display_options['filters']['status_extra']['expose']['operator'] = FALSE;

/* Display: Block */
$handler = $view->new_display('block', 'Block', 'block');
$handler->display->display_options['block_description'] = 'Queue \'Prime Triple Strip Queue\'';
$translatables['nodequeue_2'] = array(
  t('Defaults'),
  t('Queue \'Prime Triple Strip Queue\''),
  t('more'),
  t('Apply'),
  t('Reset'),
  t('Sort by'),
  t('Asc'),
  t('Desc'),
  t('queue'),
  t('Block'),
);

And as expected, it happens quite the same on a LAMP install with different versions of everything.

Pasqualle’s picture

yes, I can fix my views as described in #9. I used that form only because I did not want an extra space at the end when [tl_main_contact] is empty.

but generally substituting a token with a css class is not always the desired behavior. Adding an extra hyphen where there wasn't a hyphen before (and lower casing the string) may easily break the current css style.

I do not see why the above export has problems as it does not use tokens (or any other plugin which could have problems with the row class change).
@rdeknijf can you describe what is your actual row class with views 7.x-3.2 for this view?

SophieG’s picture

Hi, is there a solution ? Is installing the dev version the solution ?

grozozo’s picture

I confirm this issue, the row class of my views are all gones since the update to 7.3.2

rdeknijf’s picture

Status: Active » Closed (fixed)

I see that it's been fixed for now (through a revert of #1360186: Row class set using token should not include spaces) in 7.x.3.3. Thx Daniel!

David, good luck fixing your patch!