Whenever I view pages that are event enabled, things are messed up. This seems to be caused by differences in how the css files are referenced. Normally, my theme css files are listed last but with event enabled pages, they are listed first and thus some things are being overridden in ways that don't work well with my theme.
How is event module affecting the order of the css files?
Here is the css files for an event enabled content type
<link type="text/css" rel="stylesheet" media="screen,projector" href="/sites/all/themes/ubiquity/style.css?4" />
<link type="text/css" rel="stylesheet" media="screen,projector" href="/sites/all/themes/womensfooty/womensfooty.css?4" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/event/event.css?4" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/book/book.css?4" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/node/node.css?4" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/system/defaults.css?4" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/system/system.css?4" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/system/system-menus.css?4" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/user/user.css?4" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/cck/theme/content-module.css?4" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/date/date.css?4" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/fckeditor/fckeditor.css?4" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/lightbox2/css/lightbox_alt.css?4" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/migrate/migrate.css?4" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/og/theme/og.css?4" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/ubercart/shipping/uc_quote/uc_quote.css?4" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/ubercart/uc_order/uc_order.css?4" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/ubercart/uc_product/uc_product.css?4" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/ubercart/uc_store/uc_store.css?4" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/forum/forum.css?4" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/cck/modules/fieldgroup/fieldgroup.css?4" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/acidfree/acidfree.css?4" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/comment/comment.css?4" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/ubercart/uc_cart/uc_cart_block.css?4" />
This is the css list for a non-event enabled page
<link type="text/css" rel="stylesheet" media="all" href="/modules/book/book.css?x" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/node/node.css?x" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/system/defaults.css?x" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/system/system.css?x" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/system/system-menus.css?x" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/user/user.css?x" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/cck/theme/content-module.css?x" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/date/date.css?x" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/fckeditor/fckeditor.css?x" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/lightbox2/css/lightbox_alt.css?x" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/migrate/migrate.css?x" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/og/theme/og.css?x" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/ubercart/shipping/uc_quote/uc_quote.css?x" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/ubercart/uc_order/uc_order.css?x" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/ubercart/uc_product/uc_product.css?x" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/ubercart/uc_store/uc_store.css?x" />
<link type="text/css" rel="stylesheet" media="all" href="/modules/forum/forum.css?x" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/cck/modules/fieldgroup/fieldgroup.css?x" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/acidfree/acidfree.css?x" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/event/event.css?x" />
<link type="text/css" rel="stylesheet" media="all" href="/sites/all/modules/ubercart/uc_cart/uc_cart_block.css?x" />
<link type="text/css" rel="stylesheet" media="screen,projector" href="/sites/all/themes/ubiquity/style.css?x" />
<link type="text/css" rel="stylesheet" media="screen,projector" href="/sites/all/themes/womensfooty/womensfooty.css?x" />
Comments
Comment #1
bkat commentedI figured out what is causing this problem. In event.module the function, event_include_files() sets up some includes and calls drupal_add_css(). In the case where we are calling an event enabled page, event_nodeapi gets called *very* early. This causes the event.css to be added first. Additionnally, my theme uses media 'screen, projector' and not 'all'. Depending on when the event css is added, the order of these in the css array gets switched around which affects how they are rendered into css include statements.
To work around this, I added a parameter to event_include_files() to indicate whether we need the css files loaded or not. It defaults to true and I call it with false in all the places that aren't dealing with UI stuff.
I've included my changes as a patch. Hopefully it can be applied to CVS or a better method of cleaning this up devised.
Comment #2
mcrittenden commentedComment #3
japerryEvent for Drupal 8 is unrelated to older versions. If an issue similar to this one exists, please open a new issue with the 8.x branch.