netgen / TagsBundle

Netgen Tags Bundle is an eZ Platform bundle for taxonomy management and easier classification of content, providing more functionality for tagging content than ezkeyword field type included in eZ Platform kernel.
https://netgen.io
GNU General Public License v2.0
48 stars 44 forks source link

Tags input disappears after changing language while creating content #72

Closed konradoboza closed 3 years ago

konradoboza commented 6 years ago

Good morning!

Currently, a new issue has been observed: while creating new content, changing its language causes disappearing of tags input. I reproduced this issue on eZ Platform 1.13 and tagsbundle v3.1.4.

disappearing_tags_input

Please let me know if you could fix this.

Best regards

emodric commented 6 years ago

Hi @konradoboza

Thanks, I will look into this soon, but I don't know if I can fix this, since YUI is not my strongest suit. I would appreciate if you could take a look at it too if you know where and how to fix it :)

konradoboza commented 6 years ago

Hi @emodric,

I looked into this issue and found out, that there is a problem with rendering templates.skeleton template. After changing the language of the content it is somehow removed, but I couldn't reach the code which is responsible for that. Is it any possibility, that this is also used somewhere in the tags admin panel as this skeleton contains html code for autocomplete input? Maybe there is some wrong event which is triggered. Please take a look and give me any clues, so I'll be able to further investigate this problem.

emodric commented 6 years ago

I can say with certainty that it's not used in admin panel, only for the field input. Why it dissapears, I cannot say, but I'll try to debug it!

emodric commented 6 years ago

Hi @konradoboza

I've tried testing the input with changing the language and I'm afraid I cannot reproduce your issue.

When I switch to another language in content edit interface, everything keeps on working as before, no issues whatsoever.

When creating a new content and switching language, however, I get the following error:

image

so I can't test that usecase :/

konradoboza commented 6 years ago

I was able to reproduce it every time on a clean installation of eZ Platform v.1.13.0 with TagsBundle v3.1.4. Here are my steps to reproduce:

  1. Add new language via admin panel and add it to ezplatform.yml
  2. Clear cache and reload Platform UI.
  3. Install TagsBundle 3.1.4 using instructions from its github page.
  4. Add tags field to existing content e.g. "Article".
  5. Create a new article.
  6. Before publishing it, change the language. Result: Tags field disappears.

Please let me know if you performed some similar tests. Which browser do you use?

emodric commented 6 years ago

I reproduced the issue, and it seems that there is something missing somewhere which would reinitialize the interface on language change.

Simply calling jQuery('#eztagsXYZ').EzTags(); from the console (XYZ is the field def ID of the tags field) makes the interface reappear, which indicates that all we need is an initializer method which would execute on language change. I hope you know a place where we can stick that initialization :)

konradoboza commented 6 years ago

I tried to fix it the way you suggested, but it won't work. When I reinitialize the interface by using jQuery('#eztags123') it corrupts the popup for selecting tags from the tree. See screenshot below.

select_tag_issue

Maybe re-rendering whole Tags template and re-attach all events could be a possible workaround? If yes, please give me some clues how to do it properly and I could try to put it in a correct place.

konradoboza commented 6 years ago

@emodric do you maybe have any feedback regarding this issue?

emodric commented 6 years ago

Unfortunatelly not. I tried debugging it further, but it goes beyond by YUI/JavaScript knowledge, so if you could try and fix it by yourself, it would be very much appreciated.

emodric commented 3 years ago

Closing as obsolete.