Hi

I have installed SimpleMenu (under Drupal 6.16) and it just appears as a vertical menu (not as a horizontal one as supposed).

tried it is various standard themes, but no success. Played around with all the possible settings of SimpleMenu, but no change.

Help is every much appreciated.

Rolf

Comments

rolf’s picture

StatusFileSize
new27.08 KB

Here a screen shot how it looks with the rubik theme. Same with Garland.

AlexisWilke’s picture

rolf,

If you suspect that the vertical is really causing this problem, you could delete that theme (simplemenu/themes/vertical) and see whether it fixes the problem.

My bet would be that it won't fix anything, but I do not know for sure.

Let me know.

Thank you.
Alexis

richardathome’s picture

Just had this happen to me after updating to the latest version (6.x-1.10).

The fix for me was to go to the module config page (www.example.com/admin/settings/simplemenu), and under Advanced settings change the SuperFish Version to 1.4.8 (was 1.4.1)

Hope this helps :-)

AlexisWilke’s picture

richardathome,

Thank you for the info. I suppose I should switch the default to 1.4.8 now...

There could be another problem too which is too many CSS files. That happens on Internet Explorer only. The system performance can be used to turn on the CSS compression which fixes the problem. D7 uses @import instead which has no count limit.

Thank you.
Alexis

amateescu’s picture

Version: 6.x-1.9 » 6.x-1.10
Priority: Major » Critical

Actually, changing superfish to 1.4.8 doesn't solve anything :)

Every time you empty your cache, simplemenu resets to a vertical menu. I thinks it's some css file that doesn't get included but i'll have to dig deeper into this.

Andrei

AlexisWilke’s picture

Title: SimpleMenu appears as a vertical menu after saving the admin/build/modules page » SimpleMenu appears as a vertical menu
Version: 6.x-1.12 » 6.x-1.10
Status: Reviewed & tested by the community » Active
StatusFileSize
new1.35 KB

Andrei,

You may want to check out this page for complimentary information:

http://www.m2osw.com/doc_simplemenu_known_issues

Today I ran into a problem with the glossyblue theme (which I do not recommend). They had some ul/li definitions that would overwrite the Simplemenu definitions.

Also, I just noticed that the main <div> would not be properly themed. The correct name is #simplemenu-block and not #simplemenu (which is the first <ul> tag.)

Thank you.
Alexis

P.S. The patch provided here uses #simplemenu-block when the top <div> is actually using a class: .simplemenu-block. Yet trying to use that instead of #simplemenu does not work too well. The problem was something else anyway.

amateescu’s picture

Title: SimpleMenu just appears as a vertical menu » SimpleMenu appears as a vertical menu

Hey Alexis,

Thanks for your quick reply. This is not the problem described here (or at least not the one that I encountered using any theme).

The actual problem is this: when you empty your cache, everything in 'sites/default/files/css' gets deleted. The 'simplemenu_css_filename' system variable is still set and contains the old css filename.

So, the condition in simplemenu.module at line 134:

$output_filename = variable_get('simplemenu_css_filename', '');
if (!$output_filename) {

returns true but that file doesn't exist anymore.

A quick fix would be someting like:

$output_filename = variable_get('simplemenu_css_filename', '');
if (!$output_filename || ($output_filename && !file_exists($output_filename))) {

Andrei

AlexisWilke’s picture

StatusFileSize
new608 bytes

Andrei,

Weird I did not get the problem. I wonder why I never saw that with the current setup.

Please, try with the attached patch which clears the variable whenever the cache gets cleared.

Thank you.
Alexis Wilke

amateescu’s picture

Status: Active » Reviewed & tested by the community

Hey,

That's a way better solution than mine :) With a small fix: boost_flush_caches() should be simplemenu_flush_caches().

Btw, earlier I raised this to critical because i think that many users who will upgrade to 1.10 or start using it directly will be hit by this issue. It would be great if a quick 1.11 release is possible :)

Thanks,
Andrei

amateescu’s picture

Also, I think the function should return an empty array.

Andrei

AlexisWilke’s picture

Andrei,

If you return nothing (i.e. NULL) then the invoke does nothing with the result and the final result will be array().

function module_invoke_all() {
  $args = func_get_args();
  $hook = $args[0];
  unset($args[0]);
  $return = array();
  foreach (module_implements($hook) as $module) {
    $function = $module .'_'. $hook;
    $result = call_user_func_array($function, $args);
    if (isset($result) && is_array($result)) {
      $return = array_merge_recursive($return, $result);
    }
    else if (isset($result)) {
      $return[] = $result;
    }
  }

  return $return;
}

I'll wait a few days to see whether anyone complains about this change and then create version 1.11 if no one complains.

Thank you.
Alexis

ccshannon’s picture

I just installed 6x-1.10 and everything unexpectedly went vertical. Emptying cache had no effect.

I disabled/uninstalled simplemenu 6x-1.10 completely and re-installed 6x-1.9 and everything is good again.

I will upgrade when 6x-1.11 is out, rather than 6x-1.10 and patch. Thanks.

felipe’s picture

Same issue/description here...

AlexisWilke’s picture

Okay, I created 1.12. At least, that fixes this issue that at first I had no idea what it could be.

I think that the problem is I use Boost and that keeps files in its own boost cache... so I did not see this side effect.

Thank you for your reports and patience!
Alexis

AlexisWilke’s picture

Go a duplicate here: #895676: Weird problems when rebuilding CSS/JS cache

Now I'm wondering whether an update could generate a problem by clearing the cache and not properly calling the simplemenu_flush_caches().

If you have any problem after an upgrade, don't hesitate to post here.

Thank you.
Alexis Wilke

echoz’s picture

Title: SimpleMenu appears as a vertical menu » SimpleMenu appears as a vertical menu after saving the admin/build/modules page
Version: 6.x-1.10 » 6.x-1.12

Using 6.x-1.12, set to use superfish 1.4.8.js, on D6.19, block caching disabled, I get the vertical simplemenu *only after saving the admin/build/modules page*. Consistently reproducible, and never happens in any other circumstance.

I get this on a few different sites. I had never had the issue before. Upon downgrading back to 1.9, I started getting the vertical menu more often, so I'm back at 1.12. Wanted to report the specific with the modules page in case it is a clue, and that it is not entirely fixed. Not really critical for us since clients don't save the modules page.

echoz’s picture

Status: Reviewed & tested by the community » Needs work
AlexisWilke’s picture

StatusFileSize
new488 bytes

Right now you can fix the issue by undoing #891114: simplemenu always changes css and js query strings resulting in huge bandwidth overhead

You can do so with the attached patch.

I'll have to get a website where I can reproduce the problem each time!? I have saved and never seen the problem, but I'll try with your settings sample to see whether that has an effect.

Thank you.
Alexis

AlexisWilke’s picture

StatusFileSize
new712 bytes

There is another patch that would force the regeneration of the file as proposed before (#7).

You may try this patch or don't bother and use #18.

I cannot reproduce the problem without manually going on the server and deleting files/css/simplemenu-*.css

Also, I noticed that this meant you did not have the CSS caching turned on. Otherwise the content of the CSS would be in the compressed version and thus stay available as required.

And I tried without Boost since Boost can cache CSS files and thus pages continue to work for a long time!

Note that Simplemenu is not a block so caching blocks or not should have no effect on Simplemenu...

Please, let me know whether this patch (#19) works for you. #18 is like 6.x-1.9 so I'm sure that will work. 8-)

Thank you.
Alexis

echoz’s picture

#19 worked, I can no longer cause it to break with the vertical menu issue, thanks! I choose this rather than #18 since I wanted the benefit of the previous update.

amateescu’s picture

Status: Needs work » Reviewed & tested by the community

Alexis,

After some digging into the cache system (and cache related issues from other modules), this is what I found:

system_modules_submit() and system_themes_form_submit() calls drupal_clear_css_cache(). So, on every module and theme form submit, the css cache is cleared but hook_flush_caches() is not invoked. This is what you were wondering about in #15, but is not only related to this module's updates.

I think my proposal from #7 (your patch in #19) is the way to go :)

Andrei

AlexisWilke’s picture

Andrei,

Okay, got it! I have the Drupal core patch as defined here:

http://drupal.org/node/721400#comment-2950544

That prevents the deletion of CSS files for a few days (in the original version, it's 30 days.) That explains why I could not reproduce the problem and indeed the lack of callbacks shows clearly that we've got to test whether the file is there which sucks...

Thank you.
Alexis

Status: Active » Reviewed & tested by the community