Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
this code in alpha theme, causes entity.tpl.php to write the classes attribute twice to wrapper div.
and breaks w3c validation.
/**
* Implements hook_preprocess().
*/
function alpha_preprocess(&$vars, $hook) {
$vars['attributes_array']['class'] = $vars['classes_array'];
alpha_invoke('preprocess', $hook, $vars);
}
so - $vars['classes_array'] should maybe - if possilbe ? - unset
probably a followup from #1835586: Preprocess ignores node #classes_array.
or is this more for the entity.module ?
when i see comments in the dev source like
// Sync that with the classes array. Remember: We don't recommend using it.
Comments
Comment #0.0
ytsurklinked issue properly
Comment #0.1
ytsurkremoved missleading information
Comment #1
gdaw CreditAttribution: gdaw commentedComment #2
joseph.olstadThere is a D7 compliant patch for a similar issue in the wetkit_omega queue. To avoid double class attributes in a tag) you'll have to undo any hack attempts to do this (example) (example) in order to use the fix .
To fix this in "omega" someone will have to adapt the "wetkit_omega" fix for the "omega" theme.
We're fixing this in the wetkit_omega theme in our next release. It would be good if this was also fixed in the "omega" base theme at some point.
Comment #3
joseph.olstadIt would be nice to see a fix for this in Omega
please see the comments here in the patch for wetkit_omega:
The lack of receptiveness in the omega queue to fix this is issue is likely one of the major reasons it has been dropped from my favourite drupal distro in future versions. Perhaps if this was fixed soon we could get back into omega and save us some work having to switch off of it.
While I did not write the sarcastic remark up above, it does make sense.
Comment #4
pkiff CreditAttribution: pkiff commentedI'm not a maintainer here, but I'm not sure this issue is set out as clearly as it might be in order resolve it.
To start with, I'm pretty sure that this issue does not apply to the 7.x-4.x version of Omega. There is no alpha theme in 4.x there, and I can't find comparable pieces of code in 4.x. I don't think this error is reproducible on Omega 4.x. That's not to say that Omega 4.x doesn't rewrite classes and attributes, but the code it uses to do this is entirely different.
It looks to me like this issue applies to Omega 7.x-3.x only, so I've changed the version back to 3.1. Omega 7.x-4.x represents a major structural change from 7.x-3.x and the code bases are maintained separately by different maintainers. However, I see that wetkit_omega says it is based on Omega 4.x. Is wetkit_omega is using a mixture of 3.x and 4.x templates and development strategies? Maybe this is clear to other developers, but I don't understand exactly where this is supposed to get fixed in Omega.
I have no opinion on whether this should be tagged as major or normal, so I have left that tag unchanged.
Followup:
Okay, so now I've found the code snippet that the wetkit_omega folks are referring to in this post:
https://www.drupal.org/node/2232467#comment-8892459
This snippet is found in the Omega 4.x-dev and 4.2 template.php file at lines 433+. But the various template files (for e.g., node.tpl.php) that this code interacts with do not contain the code snippet cited in the original post. Those snippets are from Omega 3.x versions of the template. It still leaves the issue unclear on where the fix should be in Omega, or indeed if this can even be called a "bug" in Omega if the issue is not reproducible in a standard 3.x or 4.x subtheme.
Comment #5
trinion CreditAttribution: trinion commentedIn my project outputting 'class' twice encountered in block wrappers.
I fix this trouble so:
Comment #6
Madhuri A CreditAttribution: Madhuri A commentedAbove code is not working, after adding still it showing duplicate attribute 'class' error
Comment #7
pkiff CreditAttribution: pkiff commented@madhuri123:
To keep this thread and issue clear, can you confirm that you are using the wetkit_omega theme? Or are you using your own subtheme based on Omega 3.x or Omega 4.x?
Comment #8
rohittiwari CreditAttribution: rohittiwari as a volunteer commentedAfter a lot of juggling, found that alpha the base theme for omega theme's preprocess function has the highest weight in execution order, hence overriding the use of hook_preprocess for current site theme was not working. Tried to find a way to alter the preprocess execution order. Finally I have come up with small code snippet to alter theme registry inorder subsequently unsetting the attributes_array class array . @madhuri123 I am possibly providing a workaround which would solve the double class problem.
Comment #9
pkiff CreditAttribution: pkiff commented@rohittiwari:
Thanks for posting a possible solution to this issue. To help keep this thread and issue clear, can you confirm that you are using the wetkit_omega theme? Or are you using your own subtheme based on Omega 3.x or Omega 4.x?
Comment #10
joseph.olstadsee this comment: https://www.drupal.org/node/2232467#comment-9119081
and this commit:
http://cgit.drupalcode.org/wetkit_omega/commit/?id=82a19ec43ec216bd219dd...
rather than change the way omega is doing things we ended up changing our tpl.
Comment #11
rohittiwari CreditAttribution: rohittiwari as a volunteer commentedWe are not using the wetkit_omega theme? And i am using theme based on
Comment #12
steinmb CreditAttribution: steinmb as a volunteer commented