Hello all,

I currently have entity translation and taxonomy tools setup on my site.

It seems when I have the taxonomy publisher is enabled, it automatically unpublishes the taxonomy term when it is saved in non-source language. See attached image.

I will see if I can find a solution, but any help would be appreciated.

Cheers.

CommentFileSizeAuthor
taxonomyunpublish.png15.81 KBfarse
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

balintcsaba’s picture

Assigned: Unassigned » martins.bertins
Priority: Normal » Major
farse’s picture

Assigned: martins.bertins » Unassigned
Priority: Major » Normal
Status: Active » Fixed

I just updated to the dev version and the problem seems to be fixed.

nice!

Status: Fixed » Closed (fixed)

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

farse’s picture

Version: 7.x-1.2 » 7.x-1.x-dev
Status: Closed (fixed) » Active

Hi all,

Actually the dev version didn't fix it, it seems it only worked fine after one save and then unpublished again...

I have looked into it from my perspective and have created a custom hook to alter the hook_taxonomy_term_presave() in the module

don't think the code is up to scratch for a patch, or if its going to work in other cases, but here is my code to see where i'm getting at with it.. basically I check to see if the language being edited is different from the source language (and not language neutral). If so, then set the taxonomy status to stay as it was previous to being edited. it works for me.


function mymodule_taxonomy_term_presave($term) {
  if (in_array($term->vocabulary_machine_name, array_filter(variable_get('taxonomy_tools_publisher_config', array())))) {
    // Show term status message.
    if (isset($term->field_taxonomy_term_status)) {
      if ($term->field_taxonomy_term_status[LANGUAGE_NONE][0]['value'] == TERM_PUBLISHED) {
       //keep term published if editing from another language
       if ($language->language != $term->language && $term->language != 'und') {
         $term->field_taxonomy_term_publish_on[LANGUAGE_NONE]='';
         $term->field_taxonomy_term_unpublish_on[LANGUAGE_NONE]='';

         $term->field_taxonomy_term_status['und'][0]['value'] = 1;
       }
      }
      else  {
        global $language;

        $term_presave = taxonomy_term_load($term->tid);
        //Check to see if the original language of the term matches the current language being edited, and also make sure that the language isn't language neutral
        //Set field_taxonomy_term_status to value presave, since you can't change it in the translation form
        if ($language->language != $term->language && $term->language != 'und') {
          if ($term_presave->field_taxonomy_term_status['und'][0]['value'] == 1) {
            $term->field_taxonomy_term_status[LANGUAGE_NONE][0]['value'] = TERM_PUBLISHED;
            $term->field_taxonomy_term_status = $term_presave->field_taxonomy_term_status;
          }
        }
      }
    }
  }
}

Cheers

martins.bertins’s picture

Issue summary: View changes
Status: Active » Closed (cannot reproduce)

Couldn't reproduce.
Drupal 7.26
Entity translation 7.x-1.0-beta3