attribute "class" is being outputted twice in the node.tpl.php file of wetkit_omega.
line 90:
<article id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?> clearfix"<?php print $attributes; ?>>
class is being manually added by <?php print $classes; ?> , "clearfix" being appended and then <?php print $attributes; ?>add the same class
I would suggest keeping only print attributes since it includes other attributes like role="article" and adding clearfix to the attributes class array.
Also, I noticed the same issue happening on many other .tpl files in wetkit_omega theme.
For example:
- comment.tpl.php
- comment-wrapper.tpl.php
- taxonomy-term.tpl.php
- block--views--headlines-front-page-block.tpl.php
- block--sidebar_first.tpl.php
- etc...
Any reason for this markup specific to wetkit_omega?
Comments
Comment #1
sylus commentedNope no reason just likely an issue or a screw up.
Lets fix this for v1.4.
Updating to critical as will affect accessibility.
Comment #2
sylus commentedCan you supply a patch for these issues? Would be super grateful :)
Comment #3
sylus commentedCommit: http://drupalcode.org/project/wetkit_omega.git/commit/62064fb
Did my best to address all the issues I could find. Can open individual issues for anything missed.
Comment #5
Anonymous (not verified) commentedI see a potential side effect with the commit from comment #3, the `clearfix` class have been removed from `comment.tpl.php` and `node.tpl.php` which some design might rely on.
Comment #6
Anonymous (not verified) commentedIf we look at the pattern that was replaced (printing both `$classes` and `$attributes`), it is definitely not a markup specific to wetkit_omega, it's there in 7 files from 6 core modules, and 70 files from 7 contrib modules wetkit is using. I don't think we should change all these files to please Omega. The real problem lies in `omega/template.php` function `omega_theme_registry_alter` where they copy the content of `classes_array` into `attributes_array['class']` with the following comment:
// We prefer the attributes array instead of the plain classes array used by
// many core and contrib modules. In Drupal 8, we are going to convert all
// occurrences of that into an attributes object. For now, we simply
// synchronize our attributes array with the classes array to encourage
// themers to use it.
I suggest that we rollback the commit from comment #3 and edit wetkit_omega to revert the hack Omega is doing, this will then play nice with the whole drupal ecosystem, as it will be done "the drupal (7) way".
I know this is "not playing nice" with Omega, but it's a tough decision between betraying Omega, or the whole Drupal 7 ecosystem :-) I am definitely open to hear a better solution, but meanwhile, I will use this patch for my project.
Comment #7
Anonymous (not verified) commentedComment #8
Anonymous (not verified) commentedpatch updated, as there was a weird copy/paste (or distraction) error in there
Comment #9
Anonymous (not verified) commentedand here's a patch to revert commit #62064fb
Comment #10
joseph.olstadPatches pass testing in our environment (we tested these two patches against the latest wetkit_omega module). The patched wetkit_omega no longer has the double class problem.
Please commit patches from comment #8 and #9 to the wetkit_omega project asap.
My git account is still bombed, so someone else please commit the patch
Comment #11
gdaw commentedIs the patch still needed for this?
Comment #12
joseph.olstadRequesting co-maintainer access on the 1.x branch.
Comment #13
sylus commentedCommitted and attributed!
Comment #15
sylus commentedHad to revert this commit as the hook_registry_alter is causing a lot of warnings throughout the site.
Warnings such as:
This is because of omega itself using the new class variable and it no longer be set thanks to the hook_registry_alter
I think it might be too much work as this is how Omega 4.x did this and I don't like the idea of us manually fixing all of Omega's preprocess functions ourself. Is the only thing missing from earlier commits a clearfix logic needing to be applied to comments etc? Even though how Omega does it is a departure from core it should still work based on my first set of commits above. We can leave the 2.x branch and bootstrap to call it the default way which it does.
Comment #17
joseph.olstad*EDIT* it would be nice to fix this to stabilize the 1.x branch for those that will still be using it.
I looked at the reverted commit to wetkit_omega but didn't get to test it yet. a cache clear should normally flush out tpl files which were changed. When spare cycles retest.
Comment #18
joseph.olstadComment #19
sylus commentedAfter talking with Eric this should actually be all fixed he was only concerned about the clearfix being missing since it looked like it was in the commits. Omega has separate logic to ensure the clearfix is added to the node and comment so no layouts should be affected.
Eric agreed we shouldn't try to change how Omega is handling the array so issue should be all resolved ^_^.