Fatal error: Cannot redeclare theme_taxonomy_term_page() (previously declared in /sites/all/modules/i18n/i18ntaxonomy/i18ntaxonomy.pages.inc:96) in /modules/taxonomy/taxonomy.pages.inc on line 109

Got this fatal error when accessing taxonomy/term/# through admin/content/taxonomy/#

Cheers
dafreak

Comments

carlogen’s picture

Hi,
I am getting the same error,
but if I comment the code in /sites/all/modules/i18n/i18ntaxonomy/i18ntaxonomy.pages.inc
from line 96 to line 122 it works again.

function theme_taxonomy_term_page($tids, $result) {
  drupal_add_css(drupal_get_path('module', 'taxonomy') .'/taxonomy.css');

  $output = '';

  // Only display the description if we have a single term, to avoid clutter and confusion.
  if (count($tids) == 1) {
    $term = taxonomy_get_term($tids[0]);
    if (i18ntaxonomy_vocabulary($term->vid) == I18N_TAXONOMY_LOCALIZE) {
      $description = tt('taxonomy:term:'. $term->tid .':description', $term->description);
    }
    else {
      $description = $term->description;
    }

    // Check that a description is set.
    if (!empty($description)) {
      $output .= '<div class="taxonomy-term-description">';
      $output .= filter_xss_admin($description);
      $output .= '</div>';
    }
  }

  $output .= taxonomy_render_nodes($result);

  return $output;
}
jensD’s picture

I have the same problem.
it can not be the solution to comment out the function in the i18ntaxonomy.pages.inc. The problem is that the function is called twice in theme_taxonomy_term_page in i18ntaxonomy.pages.inc and in the taxonomy.pages.inc.
Has anyone an idea how to solve the problem?

robertoguzman’s picture

hi Guys, i have the same issue, any solution ?

rhache’s picture

Same issue occurred to me as well.

I commented the lines like carlogen mentioned and that temporarily fixed it.

Rene

YK85’s picture

subscribing

robertoguzman’s picture

Any solution to this issue ?

klavs’s picture

In my case it was caused by a module named tvi (taxonomy views integration) - I uninstalled it (hadden gotten around to using it yet) and then it worked again.

pomliane’s picture

subscribing

ak’s picture

I can confirm that turning of tvi module selved the problem for me as well.

sinasalek’s picture

I also confirm that it's cause by tvi module

jose reyero’s picture

Category: bug » support
Priority: Critical » Normal

Well, it's not caused by tvi module, let's say it's a compatibility issue between modules.

We are actually using a duplicated function name for that theme function so maybe that should be changed (At the expense of requiring themers to implement a new theme function for i18n taxonomy pages).

Thinking about it...

sinasalek’s picture

Status: Active » Needs review

Why not just make it compatible with i18n module?
Patch (tvi.module) :

function tvi_render_view(...) {
  ...
  if (module_exists('i18ntaxonomy')) {
    return i18ntaxonomy_term_page($str_tids, $depth, $op);
  } else {
    module_load_include('inc', 'taxonomy', 'taxonomy.pages');
    return taxonomy_term_page($str_tids, $depth, $op);
  }
}
sinasalek’s picture

Project: Internationalization » Taxonomy Views Integrator
Version: 6.x-1.2 » 6.x-1.1
derekwebb1’s picture

Sounds good, I think patching TVI would be best. Not sure how i18n gets away with re-defining the term theme function - as it does then it must be ok... That's quite odd to me. But the fix seems like a snap.

I also have a fix for Postgres.

The patch at #752852 worked but without an upgrade path I am hesitant to release it as doing so will require people to reset their view override assignments...

I suppose I ought to write the upgrade path. I hesitate though as, historically speaking, I am just a front end guy... But I could use to learn the way to write an upgrade path.

I would like to say that I will roll this out for you soon, however it really depends on how much time I allocate to TVI / vs the paid stuff and the difficulty in creating the upgrade path.

Cheers, Derek

sinasalek’s picture

Assigned: Unassigned » derekwebb1
Status: Needs review » Active

Since this issue is critical (it prevents the site from working) can't you release a minor version for this issue alone?

derekwebb1’s picture

I have not been able to re-produce this error. I have i18n running, and I can go to the term and vocab edit pages, edit, save, and leave without any errors. Also, the error is not evident on any of the term displays (which is where I would expect to see it if the issue was in the tvi_render_view(...))

Any other details that I may be missing

Edit: I noticed sinasalek, that I did not have the actual i18ntaxonomy module on during my initial tests. I have since enabled i18ntaxonomy and it still produces no error(s).

derekwebb1’s picture

Thanks for your input everyone. Please let me know what configurations I may need to make to duplicate this issue and I will give it a go.

sinasalek’s picture

You're right @deeporange1, i once managed to get rid of the issue on dev without applying any patches. But i couldn't do it again!. I'll test again on a fresh installation. It seems to me that there are other hidden conflicts.

yark’s picture

So is this fixed already?

duaelfr’s picture

Status: Active » Closed (fixed)

Closing old issues. If not fixed, please reopen.

diego.paroni’s picture

Issue summary: View changes

Patch in #12 for Drupal 7:

function tvi_render_view(...) {
...
if (module_exists('i18n_taxonomy')) {
  return i18n_taxonomy_term_page($term);
} else {
  module_load_include('inc', 'taxonomy', 'taxonomy.pages');
  return taxonomy_term_page($term);
}
duaelfr’s picture

Could you open a separate issue to explain what you try to do with this patch ?