taxonomy_update_7003() removes the 'relations' column from the taxonomy_vocabulary table but this column is still defined in taxonomy_schema().

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

scor’s picture

Status: Active » Needs review
FileSize
718 bytes

patch

scor’s picture

seems forum.install is also using 'relations':

    $edit = array(
      'name' => t('Forums'),
      'machine_name' => 'forums',
      'description' => t('Forum navigation vocabulary'),
      'hierarchy' => 1,
      'relations' => 0,
      'module' => 'forum',
      'weight' => -10,
    );
    $vocabulary = (object) $edit;
    taxonomy_vocabulary_save($vocabulary);

Am I missing something or was taxonomy 'relations' removed from D7? I can't find any other reference to it in D7.

Dries’s picture

Status: Needs review » Needs work

Status: Needs work » Needs review

Re-test of 662322_rm_relations.patch from comment #1 was requested by andypost.

andypost’s picture

Priority: Normal » Critical
Status: Needs review » Reviewed & tested by the community

Should be fixed, because admin/structure/taxonomy is not working

Dries’s picture

Status: Reviewed & tested by the community » Needs work

It seems forum module is still using relations in forum.install. Plus, I don't understand your comment in #5 -- care to elaborate?

andypost’s picture

Status: Needs work » Needs review
FileSize
1.45 KB

Searching through whole core I found no more usage of 'relations'.
It seems like it was forgotten.

@Dries comment #5 caused by working on #563106: Cannot upgrade from Drupal 6 to Drupal 7 - meta issue - if "relations" field left in schema then after update.php visiting admin/structure/taxonomy brings mysql error: "field base.relations is not found"

This all because taxonomy_get_vocabularies() uses entity_load() which use schema to query DB, but this field is dropped in taxonomy_update_7003()

scor’s picture

removes 'relations' from forum.install (#2).

andypost’s picture

Waiting for a bot... very strange that there's no error after normal install only after update or clearing cache[schema]

Notice: Undefined index: severity_level in _drupal_log_error() (line 1195 of /var/www/d7/includes/common.inc).
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'base.relations' in 'field list': SELECT base.vid AS vid, base.name AS name, base.machine_name AS machine_name, base.description AS description, base.relations AS relations, base.hierarchy AS hierarchy, base.module AS module, base.weight AS weight FROM {taxonomy_vocabulary} base ORDER BY base.weight ASC, base.name ASC; Array ( ) in DrupalDefaultEntityController->load() (line 126 of /var/www/d7/includes/entity.inc).
andypost’s picture

Status: Needs review » Reviewed & tested by the community

Patches are the same, RTBC again

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks!

Status: Fixed » Closed (fixed)

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