Closed (fixed)
Project:
Ray Enterprise Translation
Version:
7.x-7.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
5 Oct 2016 at 22:23 UTC
Updated:
19 Dec 2016 at 17:02 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jtsnow commentedThis 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()`.
Comment #3
jbhovik commentedComment #4
jbhovik commentedjtsnow,
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.
Comment #5
jtsnow commentedChanging 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.
Comment #6
jbhovik commentedjtsnow,
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.
Comment #8
jbhovik commentedHi jtsnow,
Thanks for contributing your code, and sorry for the confusion. I've attributed you in the commit. We really do appreciate your efforts.
Comment #9
jbhovik commentedComment #10
jbhovik commented