Taxonomy Manager is a good time-saving tool.

However, when it saves a term nested in the second, third … level, it automatically reverts back to the highest parent level of the vocabulary. It thus forces you to expand again as many times as necessary in order to get back to the previous position, where the term was entered and saved.

It'd be nice if Taxonomy Manager could remember the last position and take me back right there, rather than having to click through the sub-levels. It's kind of wasting precious data entry time.

TIA

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bleen’s picture

Title: Taxonomy Manager 6.x-2.2 » Remember the position in the tree after an action is performed

fixing title...

FireHawkX’s picture

Issue summary: View changes

I just installed this amazing module (drupal 7 version) and was wondering why such a feature was never added...

Instead of creating a new thread about it, I did a quick search and found this one.

It would be life-saving to have such a feature added... I have a huge "tree" covering thousands of terms...

Adding a dozen of terms at depth 4-5 would be really painful without any memory option for last opened tree/section.

I really hope someone coming across this would consider adding it if its not too difficult :)

FireHawkX’s picture

Version: 6.x-2.2 » 7.x-1.x-dev
man-1982’s picture

Status: Active » Needs review
FileSize
9.89 KB
35.63 KB

hi guys
i have added remember the position after CRUD. In patch used HTML5 localStorage and save state data of Taxonomy tree into local storage on client comp.
Also added 3 button:
Clear HTM5 storage - clear data from localStorage
Expand all - expand tree but only one level of tree. One click - one level.
Collapse all - collapse all tree.
new buttons

please review it.
Thanks

FireHawkX’s picture

wow this seems amazing! :)

I will be checking it up monday morning when i get to work and will let you know! :)

Thank you very much!

FireHawkX’s picture

Status: Needs review » Reviewed & tested by the community

Well I am happy to report back that the patch applied cleanly and does everything it was supposed to do (and even more!)

Expand all opens everything "1 level deep", collapse all, closes everything...

The module now remembers what you had opened even when you load other pages and come back.

Really great and I will be using it for sure! :)

Thank you again for this awesome improvement patch!

FireHawkX’s picture

@man-1982 : I actually found a tiny "bug" in the memory system you created ;)

First, if the taxonomy has many pages, and you are on page 2,3 (and you click on a term), it refresh to page 1...

The module should probably remember the page opened as well as the path...

ALSO, (this might not be related to this issue)

But I have paragraphs in my taxonomy, so 1 term can have one paragraph type associated with it, while the next term can have another paragraph type...

When I select a term in Taxonomy Manager, it updates the fields properly, but if i select a second one, it doesnt update at all... the value remains those of the first term i clicked.

This might be another bug completely unrelated I am not sure. (let me know if i should open up a new issue for this last one) ;)

Thank you for your time and have a nice day!

man-1982’s picture

FileSize
105.87 KB

@FireHawkX Hello, I have done this research and what i noticed. When we click on our term tree front-end script send all data from page also including data from previous term (i mean "paragraph" data). I attached a few picture for you.
Only local images are allowed..
if you will look on the code termData.js into Drupal.loadTermDataForm you could see that all data of form send to server using Drupal ahah. Also you could see it on taxonomy_manager.admin.inc

function taxonomy_manager_form($form, &$form_state, $voc, $tid = 0, $filter = NULL) {
.....
  $form['load-tid'] = array(
    '#type' => 'textfield',
    '#prefix' => '<div class="taxonomy-manager-term-load-helper">',
  );
  $form['load-tid-refresh-tree'] = array(
    '#type' => 'checkbox',
  );
  $form['load-tid-submit'] = array(
    '#type' => 'submit',
    '#value' => 'load term',
    '#submit' => array('taxonomy_manager_load_tid_submit'),
    '#ajax' => array(
      'callback' => 'taxonomy_manager_term_data_form_ajax_callback',
      'method' => 'replaceWith',
      'event' => 'click',
      'wrapper' => 'taxonomy-term-data-replace',
    ),
    '#suffix' => '</div>',
  );
}

I think this patch and issue for "paragraphs value" not related.
The first case in your message i can`t replicate. For first case i need more data. I would be glad to help you if you want. Thanks

FireHawkX’s picture

Alright so the patch in #2 works fine, the tree remains open wherever it was even if you reload the page.
The collapse and expand button also works fine as well as the new "clear cache" button.

The paragraph issue not updating is a separate issue which will be adressed at a later date, and the module not remembering what page it was on has been fixed in a separate RTBC issue :)

  • VladimirAus committed ef8961bc on 7.x-1.x authored by man-1982
    Issue #855002 by man-1982, FireHawkX, tsbah, VladimirAus: Remember the...
VladimirAus’s picture

Status: Reviewed & tested by the community » Fixed

Thank you. 🥂
Committed!

Status: Fixed » Closed (fixed)

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