from template_preprocess_flag()

These two classes are applied whatever the state of isset($link['href'])

$variables['flag_classes_array'][] = $variables['action'] . '-action';
$variables['flag_classes_array'][] = 'flag-link-' . $flag->link_type;

This makes it difficult to style a link differently depending on if it is active or not.

Would suggest something like

if (isset($link['href'])) {
  $variables['flag_classes_array'][] = $variables['action'] . '-action';
  $variables['flag_classes_array'][] = 'flag-link-' . $flag->link_type;
}
else {
  $variables['flag_classes_array'][] = $variables['action'] . '-disabled';
}

Does this make sense?

CommentFileSizeAuthor
#4 flag-1826184.patch1.01 KBJeremyFrench

Comments

joachim’s picture

Version: 7.x-2.0-beta8 » 7.x-3.x-dev
Issue tags: +Needs change record

Seems a reasonable thing to do, though when do we get here without a link?

Will need applying to 3.x first.

JeremyFrench’s picture

Seem to get there when flag is allowed and unflagging isn't.

joachim’s picture

Aha, yes that makes sense.

Can you make a patch for your suggested change?

JeremyFrench’s picture

StatusFileSize
new1.01 KB

Sure, attached.

JeremyFrench’s picture

Status: Active » Needs review
joachim’s picture

Status: Needs review » Fixed

Thanks! Fixed.

Issue #1826184 by JeremyFrench: Added class to flag link to distinguish 'unflag denied' non-links.

I've written a change record for this: http://drupal.org/node/1828936

Could you check it please, and maybe give some examples of what the classes look like before and after?

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