Closed (fixed)
Project:
Menu Icons
Version:
6.x-2.0
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
23 Jun 2009 at 07:34 UTC
Updated:
7 Sep 2010 at 00:18 UTC
Jump to comment: Most recent file
Basically what the Title says, after every entry in the Tracker, there's another entry for "Menu Icons CSS" that points to menu_icons/css, and it's extremely annoying. Find a way to prevent it posting a link in the tracker, or don't use a regular Drupal page for the CSS.
| Comment | File | Size | Author |
|---|---|---|---|
| #23 | menu_icons.create_css_file.1.patch | 5.06 KB | skilip |
| #17 | ico_crealavoro.png | 490 bytes | toninbardhi |
| #15 | css_break.png | 53.46 KB | SpikeX |
Comments
Comment #1
SpikeX commentedSmall update: It appears on my web tracker as the MOST VISITED page on my site, as well.
However you're accessing this CSS sheet, you need to change it, because it triggeres a "page view" HTML-wise, and you need to change it to just be a stylesheet include, using an HTML <link> tag.
Comment #2
skilip commentedI'm not abled to reproduce this. Could you please give me more details about on which page the messages are displayed, and which module is responsible for displaying the messages?
Comment #3
SpikeX commentedWell, obviously it's the Menu Icons module, first off.
It appears in the page tracking in Drupal User > Track > Page Visits (/user/1/track/navigation), as well as in my third party statistics software for the entire site (this isn't even connected to Drupal).
Whatever system is in place to "access" the custom CSS, it can't register as a page hit (as it's doing right now).
I'll provide screenshots if you still can't reproduce this.
Comment #4
grendzy commented/user/1/track/navigation
Just FYI, that looks like the core statistics module.
Are you using the "popular content" block, or is this only on the admin & user pages?
Comment #5
SpikeX commentedThis is only on tracking on user pages. But, like I said, the statistics module isn't the problem, since my third party software that has nothing to do with Drupal, reports that /menu_icons/css is the most viewed page on my website by about 75%, and that's just not correct.
Comment #6
sethcohn commentedCurrent usage IS a link, so I think that's the issue here, not the reverse, and perhaps it should instead be a style @import as the others...
Comment #7
grendzy commentedI'm not so sure... The CSS file is a menu callback, so I think it would register in the statistics module's {accesslog} either way.
Regarding the third party stats... I'm guessing the poster is using something like awstats? In that case, changing the path to
menu_icons/style.cssmight cause most log analyzers to ignore it.Comment #8
SpikeX commentedI think two things are at work here (possibly, I'm kind of taking a guess here).
First, the fact that the stylesheet call doesn't end in .css. That's the first problem.
Second, menu_icons/css... does that acknowledge itself as a Drupal page? I mean, when it's called, does it run code that would make Drupal think its its own page? If so, you should rethink that code.
You know what you could do... is have the module write its own .css file, and rewrite it whenever a menu is updated, or on cron runs (if it detects that it needs to be changed).
Comment #9
skilip commented@SpikeX It's not desirable to write it to an actual file, since you'd have to have write permissions for the menu_icons directory. (though it is possible to put the file in the files directory)
Have installed all statistics / tracker modules shipped with core, but still can't reproduce the issue you're experiencing. What 3th party module are you using, that might cause your problems?
Comment #10
SpikeX commentedNothing, as far as I can tell? I'm just using Drupal's page tracker that's installed by default (where you can view the most recent pages that someone has viewed in a list). Every other entry is a Menu Icons entry.
I really can't begin to think of what other module would produce this kind of effect... I mean, I have all the basic modules installed like Views, CCK, that sort of thing, but none of that should interfere?
Comment #11
SpikeX commentedI found a workaround that seems to be working.
In the module file, on Line 127, replace the function with:
It's crude, but it works. No longer are you using the Drupal system to include the CSS file, and since you aren't linking to it (without the .css extension), Awstats shouldn't pick it up anymore (we'll see next month when the stats rollover).
I'm postponing the bug since I fixed mine and you couldn't reproduce it on your end.
Still, I highly recommend that you change the way your module accesses the CSS file. The current method is not up to standards.
Comment #12
skilip commentedSpikeX, then what's the awstats thingy? Is that a module?
I'm moving the status back to active. You must understand we're trying to find a constructive solution here. This is an issue, not a (support-) forum topic.
Comment #13
sethcohn commentedActually, it is very desirable to have it written to a file, since otherwise it has to calculate this repeatedly, and it never changes unless a menu change is made (which is when you regenerate it).
I dislike the above workaround (which still isn't going to change your stats issue, just shift it)
Put the file into the files directory, that's why it's there. Then load it as normal css, like any other module does for module based css, and that way, it can be aggregated, cached, etc.
Comment #14
SpikeX commentedAwstats is completely unrelated to Drupal, like I've already said in this issue.
http://awstats.sourceforge.net/
All it does is track web traffic, and the fact that it was showing an extremely large amount of hits on /menu_icons/css tells me that it wasn't being accessed properly like a regular stylesheet.
How hard would it be to just add ".css" to the dynamic CSS page, making it /menu_icons/menu_stylesheet.css or something along those lines? That might solve a few of the problems here.
Comment #15
SpikeX commentedOkay, so my previous fix ended up not working... the PHP file_get_contents() will actually hang the script.
I tried changing the extension of the page to .css (make it something like menu_icons/icons.css), but that doesn't help the problem.
What you're doing is registering the page with Drupal, as a page. When you do a hook_menu() and do this:
$items['menu_icons/css'] = array(You're telling Drupal that's a PAGE, and whenever it's called, the user "hits" it and it gets tracked.
See the attached screenshot for the problem.
Essentially, you cannot make Drupal think this is a page at all. It has to be an actual .css file.
Comment #16
skilip commentedThat means that AJAX (or AHAH) callbacks are also tracked. That's IMO a bug of the tracking mechanism. However I'll create a fix fir this anyway. It'll be easy to write a css file into the files dir.
Comment #17
toninbardhi commentedComment #18
SpikeX commented... What is this?
Comment #19
skilip commented@SpikeX: I had a little bright moment; did you try to aggregate your CSS files? (admin/settings/performance)
Comment #20
sethcohn commentedThat won't work unless it's done as part of the normal Drupal css methods. Another reason to change this to do it 'properly'.
Comment #21
SpikeX commentedSome module (may be this one) doesn't like the CSS aggregation method that Drupal implies, whenever I turn it on my site breaks. I just leave it off.
Good idea though.
Comment #22
skilip commentedThis patch fixes this.
Comment #23
skilip commentedForgot the patch...
Comment #24
grendzy commentedNice! I would consider using an md5 sum for the filename, instead of menu_icons.css. Drupal sets ExpiresDefault to 2 weeks for files, so the browser cache could contain a quite old version of the file.
Also, I think
drupal_clear_css_cache()wherecache_clear_all()was removed would update the styles for those using CSS aggregation.Thanks!
Comment #25
skilip commentedHey Grendzy,
Unless you tell Drupal to aggregate and compress your CSS files @ 'admin/settings/performance', the files are added to your xhtml head with a random query argument in teheir paths. e.g.: /sites/default/files/menu_icons.css?Q. This already avoids client side caching of the CSS files. drupal_clear_css_cache() is only useful when aggregating is turned on, while it will only create a new compressed file. So there's no need to do anything with caches in menu_icons ;)
Comment #26
grendzy commentedGood point about the query string.
I'm still not sure I understand what will happen to aggregated CSS files. Won't e.g. 68b329da9893e34099c7d8ad5cb9c940.css become stale when menu_icons.css changes? And if so, shouldn't the aggregated files be rebuilt whenever an icon updated?
Or, there's
drupal_add_css(... $preprocess = FALSE)Am I missing something else?
Comment #27
SpikeX commentedArg, patch files! What is this community's obsession with patch files. I don't understand them, I can't use them (I'm on Windows, what am I supposed to do?), and I've already modified my menu icons module file pretty heavily, so wouldn't that ruin the patch anyway?
Maybe I just need a better explanation of what they are, I dunno.
Comment #28
skilip commented@SpikeX: http://drupal.org/patch. In IRC #drupal there are dozens of guys willing to help you with it (including me).
Comment #29
grendzy commentedApply patches on Windows:
http://drupal.org/node/60179
Comment #30
mshepherd commentedAny news on this? Does the patch on #23 work OK? When it will it committed to the release? I too have an aversion to patches. While I can use them, I'd prefer to run a proper version of the module, rather than a patched one.
Comment #31
mshepherd commentedI think this is also causing a problem with the devel module:
http://drupal.org/node/596238
Comment #32
binford2k commentedThis just indicates that you don't know what a patch is. A patch simply contains the differences between two versions of a file. A patched version of a file is identical to what you call a "proper" version.
Our "obsession" with patches is that they are more efficient. They are much smaller, and contain *only* the differences. That means that if I want to see what changed, the patch will show me.
It also means that you can apply the patches by hand. Open the file it refers to, delete all the lines shown with a - in the patch and replace them with the lines with a +.
The only drawback to patches is that sometimes the developers forget to apply them to the released version of the module. hint, hint.
Comment #33
skilip commentedRelease 6.x-2.1 fixes this. A physical file is created and placed in the files directory you specify in the Menu icons settings.
Comment #34
SpikeX commentedI was having some issues where the second page call to the CSS file created overhead, since Drupal would re-load everything essentially twice (once for the page, once for the pseudo-CSS call). I had to remove this module because it was slowing down my site so much (I used Devel to track down the culprit and it ended up being this module, unfortunately).
But now that you've created an actual .css file and are including it instead of calling a Drupal page, I'll definitely give 2.1 a try. Thanks for the update! :)
Comment #36
Pushkar Gaikwad commentedSo what was the solution ? I am not using menu icon module but still tracker is filled with this menu icon css log entries, can someone tell me what to do to stop it ?
Comment #37
SpikeX commentedIf you aren't even using this module, why did you post here? Obviously some other module you have installed is creating these entries. You should find out what it is, and disable it, or submit a bug request to that module.