By default, the Lingotek module requires the "Advanced handling of taxonomy terms" setting to be enabled in order to translate any terms that belong to vocabularies/bundles that have any fields defined. This requires converting the name and description property to fields and also seems to require the Entity Translation module to access the translations.

This approach is problematic for us because:

  • We don't need any of the extra fields on our vocabulary to be translated, so the basic handling of taxonomy terms works just fine.
  • We share code with a non-multilingual site and migrating to the advanced handling makes this difficult.

Instead of requiring the advanced handling for any vocabularies that have fields, I'm proposing an option to allow developers to determine which vocabularies require advanced handling.

Comments

jtsnow created an issue. See original summary.

jtsnow’s picture

StatusFileSize
new4.09 KB

This patch introduces a single function for retrieving a list of taxonomies that require advanced handling: lingotek_get_advanced_vocabularies(). This was previously split into two different database queries in different parts of the code. The patch also provides a way for developers to modify the list of taxonomies that require advanced handling using `drupal_alter()`.

jbhovik’s picture

Assigned: Unassigned » jbhovik
jbhovik’s picture

StatusFileSize
new2.84 KB

jtsnow,

Thanks for reporting! The patch you supplied works well, but we found a case where it caused a database error. If no advanced taxonomy terms are present, the query will select from nothing, causing the error. I've changed the lingotek_get_advanced_vocabularies() function to return a query, but also make the drupal_alter call on the list of advanced taxonomies. With this new query, we want to wrap it a condition that will check a preferences checkbox to allow it.

I took out the join as we recently deleted a similar join and we didn't want reintroduce one. Also, we'd like to move the lingotek_get_advanced_vocabularies() function into the lingotek.util.inc file. I've manipulated the code to reflect these changes. Here's the patch; see if it meets your needs. We'd like to include your code in an upcoming release once we change the preferences UI to include the checkbox.

jtsnow’s picture

StatusFileSize
new4.09 KB

Changing the `lingotek_get_advanced_vocabularies()` function to return a query actually makes it impossible to alter the list of advanced taxonomies using `drupal_alter()`.

Here is a new patch that avoids the database error in the case that no advanced taxonomy vocabularies are present, but also keeps the ability to alter the list of advanced vocabularies in-tact.

jbhovik’s picture

StatusFileSize
new4.38 KB

jtsnow,

My apologies for the belated reply. Your latest patch caused a database error when trying to view the Manage > Config page. It was caused by the $union_part_desc if statements, since the first statement queries the term_name and the second queries the term_description.

When I viewed the Manage > Taxonomy Term page, there was also another database error if the $taxonomy_bundles_with_custom_fields array was empty.

I've addressed these two issues and uploaded a patch. Let me know if this would meet your needs, and thanks for your contribution.

  • jbhovik committed b8076d8 on 7.x-7.x authored by jtsnow
    Issue #2812699 by jtsnow, jbhovik: Add ability to override Lingotek's...
jbhovik’s picture

Hi jtsnow,

Thanks for contributing your code, and sorry for the confusion. I've attributed you in the commit. We really do appreciate your efforts.

jbhovik’s picture

Status: Active » Fixed
jbhovik’s picture

Status: Fixed » Closed (fixed)