I installed Marina and Advanced_forum (http://drupal.org/project/advanced_forum) on a fresh Drupal install, and ran into the following issues:

- Forums no longer appear inside Containers - containers are listed as the same weight as forums
- New forum posts are not using the advanced_forum theme, only replies (comments) to posts

Anyone else experience these issues?

CommentFileSizeAuthor
#14 advanced-forum-12345-i2[1].JPG16.32 KBmindaugasd

Comments

michelle’s picture

The first one isn't theme related. The weight is handled with taxonomy. The second could be theme related. I haven't tried this theme but a conflict is possible.

Michelle

jwolf’s picture

Assigned: Unassigned » jwolf
heine’s picture

That's because phptemplate_preprocess_node() overwrites the template_files suggestions:

  // Add node template suggestions, in reverse order: last in, first tried
  if ($vars['page']) {
    $vars['template_files'] = array('node-default-page', 'node-'. $vars['node']->type .'-page', 'node-'. $vars['node']->nid .'-page');
  }
  else {
    $vars['template_files'] = array('node-'. $vars['node']->nid);
  }

I'm not sure where to put the other provided suggestions; they should probably be after node-default-page, but before node-[nid]-page (at least in the case of adv forum). Or should we recommend adv forum is modified in such a way that one needs to create node-[type].tpl.php files?

michelle’s picture

The problem is not AF. Using phptemplate_ in a theme will override any module's use of the template preprocess system. This needs to be changed to acquia_marina_.

Michelle

michelle’s picture

Er... Actually... Sure, I would go look for the Garland issue right after I post. That's slightly different because this is a preprocess function and that was directly using a theme function.

Looking at it again, the problem, I believe, is that it's changing the template files after AF changes them and changing to a specific theme function won't fix that.

Hmm... I'm not sure what the best way to handle this is, to be honest. Heine's suggestion will mess with AF's whole style system so that won't work.

Other suggestions?

Michelle

jwolf’s picture

The template files suggestion code in template.php is a problem child.
The template file suggestions are not working the way the should. We removed the code to fix other template candidate issues and plan on revisiting the code again soon.

The changes have been committed and are available w/ the most recent dev snapshot and will be in he 6.x-1.3 release soon.

I will check Adv. Forum w/ the dev snapshot and see if this resolves the issue.

jwolf’s picture

I can confirm that the dev snapshot fixes this. Time for a new release :P

oltremago’s picture

I'm trying the dev snapshot and Advanced Forum is working better but it isn't perfect!
The problem is with the Post Reply link:

On the thread post (the drupal node) the add comment link provided by the theme is showed, while the reply button from advanced form should be used.

Moreover, there is a Post Reply link (and it's broken) at the end of all comments. On others theme it is only at the top of the main post.

jwolf’s picture

Status: Active » Patch (to be ported)

Here is the correction for the template suggestion part of template.php which will fix this issue.

<?php
function phptemplate_preprocess_node(&$vars) {
  // Add node template suggestions, in reverse order: last in, first tried
  if ($vars['page']) {
   $vars['template_files'] = array('node-'. $vars['node']->type, 'node-'. $vars['node']->nid, 'node-'. $vars['node']->type .'-page', 'node-'. $vars['node']->nid .'-page');
  }
  else {
    $vars['template_files'] = array('node-'. $vars['node']->type, 'node-'. $vars['node']->nid);
  }
}
?>

I tweaked the template suggestions a bit and created what I believe is the correct template suggestion order for both teaser view and page view.

With the above tweaks the template candidates are as follows:

PAGE VIEW:
node-[nid]-page.tpl.php
node-[type]-page.tpl.php
node-[nid].tpl.php
node-[type].tpl.php
node.tpl.php

TEASER VIEW:
node-[nid].tpl.php
node-[type].tpl.php
node.tpl.php

I tested the changes and all is good - will commit changes and should be available in the most recent dev snapshot.

@oltremago - Would you be so kind as to file a separate issue for what you mentioned above? Thanks.

jwolf’s picture

Title: Acquia Marina does not play nicely with Advanced_forum module? » Acquia Marina template suggestion does not play nicely with Advanced_forum module?
Priority: Normal » Critical
oltremago’s picture

I tried the last Advanced Forum version and the problem is disappeared. So, the problem wasn't linked to the theme but to the module.
Anyway thanks for your work.

jwolf’s picture

Status: Patch (to be ported) » Fixed

The fix has is available in dev snapshot and will be in 6.x-1.3 soon

Apfel007’s picture

Hi,
certainly it step in this problem with adv. forum.
I tried today the 6.x 1.3 version of acquia marina and the latest vers. of Adv. Forum.
I had no luck - the Problem with the first topic still exists. Could that be - did someone had a solution for it?

Cheers

mindaugasd’s picture

StatusFileSize
new16.32 KB

I am using the latest advanced forum 6.x-1.0-alpha15 (Nov 27) and acquia marina 6.x-1.3. Forum topic is still not looking ok. I attached a picture.

eidolon night’s picture

Same issue. Suggestions, anyone?

jwolf’s picture

Please try the latest dev snapshot. This is fixed now.

For the record, I have completely removed the template suggestion code.
However, in the above where I posted the template suggestion "fix" (#9) - that approach was wrong; I was reseting the template suggestions. Advanced forums uses it's own template suggestion - because I was resetting the template suggestion all the suggestions set in core and by modules were lost.

I believe the correct way of doing it is to add to the array and not reset it:

<?php
function phptemplate_preprocess_node(&$vars) {
  // Add node template suggestions, in reverse order: last in, first tried
  if ($vars['page']) {
    $vars['template_files'][] = 'node-'. $vars['node']->nid;
    $vars['template_files'][] = 'node-'. $vars['node']->type .'-page';
    $vars['template_files'][] = 'node-'. $vars['node']->nid .'-page';
  }
  else {
    $vars['template_files'][] = 'node-'. $vars['node']->nid;
  }
?>

Thanks for your patience w/ this issue.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.