Last week I installed the sections module and I have been using it with loads of pleasure! This afternoon it "suddenly" stopped working. The theme sticks to the default theme, and won't change anymore.

I have searched the forum, and there's a similar support request. In this request it has been suggested that the problem occurs when Drupal is installed in a subdirectory. In my environment, this is not the case.

Some things I have checked:

  • The sections module is enabled
  • All the used themes are enebled
  • The section data is correct (in db as well)

In the title of the different page templates, I hard coded the name of the theme so that I can see immediately which page template must have been used. For every page of my site, the page template of the default theme is being used. The only way to change the used template is by changing the default theme.

So where did it go wrong? Hard to say. What did I change today?

At least I installed the nodewords (key) module. But, that module doesn't change any kind structure in the database - as far as can see in the sql file.

Other changes? Well, this one is hard to explain. Till yesterday, I used a hard coded part in the head of my page template: one, to skip the standard drupal css, and two, to make use of one shared css in a custom css directory. This worked pretty well (better performance in IE), especially in combination with the sections module. However, as I installed the nodewords (keys) module, I had to drawback this change - since this module uses the functionality of a part in the head. No worries, my head part is in its original state again and I hard coded an additional line to use my shared css as well.

Last thing I did today (last night |:o ) was deleting all the themes I don't want to use, and do not use anywhere. This means, I deleted all the "standard" themes like bluemarine, pushbutton, et cetera, by using a FTP program.

I think this is pretty much all I did. While trying to reproduce the state of yesterday's site, I hope someone can help me thinking...

Anyone an idea where I did go wrong?

Thanks!
Marc

Comments

Marc Bijl’s picture

Title: Sections module "suddenly" stopped working » Sections module and nodewords module bite...

Hi,

After changing lots of things in the code of my page templates, as well as in my Drupal configuration, I tried to disable the nodewords module. That proved to be the cause of a not properly working sections module.

For me, as a non programmer, it's hard to say where the modules bite... So don't know either which module needs some code change to make them work properly together.

Anyway, just wanted to let know as may be others experience the same kind of problem.

Cheers
Marc

Robrecht Jacques’s picture

The problem is that sections.module sets the global $custom_theme from within hook_menu(). nodewords.module uses a theme(...) function inside hook_menu() too. Because nodewords_menu() is called before sections_menu(), the theme is already initialised by nodewords and the override from sections.module does not have any effect anymore.

Not sure of the solution, maybe:
- set $custom_theme in hook_init() - may cause the disabling of caching;
- call init_theme() after a change of $custom_theme - this would mean that the theme_nodewords_*() can't be themed;
- nodewords shouldn't use theme().

Will have to look into this.

Bèr Kessels’s picture

* sections must set its custom theme in hook_menu because of performance. hook_init is not an option.
* sections uses the core (standard) way to set the;mes, So this bug report most likely needs to go to the nodewords. Sections is not the only module setting a custom theme.

mikegull’s picture

We're having the same problem with a conflict between events and sections modules:

Events likes making calls to theme() throughout, which is understandable. However, this means that any events module-specific page is going to call events.module code, that then calls theme(), which initializes the theme before sections_menu can do it's magic to set $custom_theme.

There needs to be a way for sections.module to get higher priority, before module-specific code runs, to set $custom_theme before theme() is called. _init() is currently the only way I see of doing that.

rout’s picture

Component: User interface » Code

Has anyone managed to resolve the conflict between events.module and sections.module in 4.6.x? It does appear that enabling both modules causes the sections.module not to work.

rout’s picture

Bèr Kessels’s picture

Status: Active » Closed (works as designed)

This is a known bug. Please report it to nodewords. they are calling theme functions too early.
Also in CVS the weighting of modules can fix this.