Hi,
I get an AJAX error whenever I try to edit a term in the taxonomy manager interface.
Anything that uses ajax (media, entity reference, paragraphs etc).

Proposed solution

Implement form editing functionality without using AJAX.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

kyuubi created an issue. See original summary.

jigish.addweb’s picture

Status: Active » Needs review

@kyuubi, Please review https://www.drupal.org/project/taxonomy_manager/issues/1120178 for the same, hope this will helps you.

thanks

kyuubi’s picture

Hi @jigish.addweb,
That patch seems to be for D6?

pdenooijer’s picture

Status: Needs review » Active

I see this behaviour as well, those fields post to the TaxonomyManagerForm instead of their own form. I think the solution could be that the TaxonomyManagerForm has to proxy it to the right form or the AJAX post has to be done to the right form.

ashutoshsngh’s picture

Any update on this issue?

We are also using this module and not able to update/create the referenced Media Entities.

kyuubi’s picture

StatusFileSize
new944 bytes

Hi guys,
This is not a long term solution but the fact is this current issue makes the module unusable.
I don't have the know how on Drupal's AJAX internals so I am overriding the JS in this patch to, instead of loading the term form via AJAX to redirect to the term edit screen.
Hopefully it helps someone.

ivnish’s picture

Status: Active » Needs review
bunty badgujar’s picture

StatusFileSize
new965 bytes

Thanks @kyuubi for work around.
As currently term page is open in current tab. So after save or clicking back button tree structure removed because of page load. So, I am re-rolling your patch with small update to open term page in new tab.

vladimiraus’s picture

Status: Needs review » Postponed (maintainer needs more info)

Can you verify it is still an issue in 2.0 branch?

carolpettirossi’s picture

@VladimirAus,

I tested and the issue doesn't happen on the 2.0 version.

However, when using it along with term_reference_fancytree module, the fancytree doesn't work as expected with multi level taxonomy terms. I assume this is not a taxonomy manager issue, right?

Probably need to debug the term_reference_fancytree code to find out why the bug happens.

vladimiraus’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

Good idea to create separate bug for term_reference_fancytree

alfattal’s picture

Version: 8.x-1.x-dev » 2.0.8
Status: Closed (works as designed) » Active

I'm reopening this bug ticket as I'm getting exactly the same issue on version 2.0.8

vladimiraus’s picture

Version: 2.0.8 » 2.0.x-dev
Status: Active » Postponed (maintainer needs more info)

@alfattal if you are reopening the bug, could you please provide

  • versions of your environment
  • screenshots
  • steps to reproduce
alfattal’s picture

StatusFileSize
new95.13 KB

@VladimirAus Sorry for the late response. Here is the requested information:

Version of my environment:
Drupal 9.5.2
PHP 8.0.27
Taxonomy Manager version 2.0.7 and 2.0.8

Steps to reproduce:

  1. Go to Structure > Taxonomy and edit any vocabulary.
  2. In the Manage fields tab, add general field like (Email) or (Link)
  3. In the new field setting, select Unlimited, save field settings then save settings. This will add the Add another item button
  4. Navigate to the list tab and add some terms to your vocabulary
  5. Go to Structure > Taxonomy Manager and click on that vocabulary. From the terms list block on the left, click on any term. This will open the edit panel to the right.
  6. Scroll down to the field you added and click on the Add another item. A spinning (Please wait) will show momentarily and then disappear without adding another field.

Screenshots:

Screenshot-1

Here is the AJAX error on Chrome console:

Screenshot-2

Full trace:

{
    "message": "\nAn AJAX HTTP error occurred.\nHTTP Result Code: 200\nDebugging information follows.\nPath: /admin/structure/taxonomy_manager/voc/tags?ajax_form=1&_wrapper_format=drupal_ajax\nStatusText: parsererror\nResponseText: \nTaxonomy Manager - Tags | Drush Site-Install\nSkip to main content\nToolbar items\nBack to site\nManage\nAdministration menuContentStructureAppearanceExtendConfigurationPeopleReportsHelp      \nShortcuts\nUser-defined shortcutsAdd contentAll contentEdit shortcuts      \nEdit\nTour\nadmin\nUser account actionsView profileEdit profileLog out      \nBreadcrumb\nHome\nAdministration\nStructure\nTaxonomy Manager\nTaxonomy Manager - Tags\nAdd to Default shortcuts\nToolbar\nTags\nSearch terms\nLoading…\nTags\n{\"ajaxPageState\":{\"theme\":\"claro\",\"theme_token\":\"OLKnMVjhWyiImDCxpIkb1IoTy1hcl-TecPwcGl9KVNQ\",\"libraries\":\"big_pipe\\/big_pipe,ckeditor5\\/internal.drupal.ckeditor5,ckeditor5\\/internal.drupal.ckeditor5.codeBlock,ckeditor5\\/internal.drupal.ckeditor5.emphasis,ckeditor5\\/internal.drupal.ckeditor5.htmlEngine,ckeditor5\\/internal.drupal.ckeditor5.image,claro\\/global-styling,contextual\\/drupal.contextual-links,contextual\\/drupal.contextual-toolbar,core\\/ckeditor5.basic,core\\/ckeditor5.blockquote,core\\/ckeditor5.essentials,core\\/ckeditor5.horizontalLine,core\\/ckeditor5.htmlSupport,core\\/ckeditor5.link,core\\/ckeditor5.list,core\\/ckeditor5.pasteFromOffice,core\\/ckeditor5.removeFormat,core\\/ckeditor5.sourceEditing,core\\/ckeditor5.table,core\\/drupal.active-link,core\\/drupal.autocomplete,core\\/drupal.collapse,core\\/drupal.message,core\\/drupal.states,core\\/drupal.tabledrag,core\\/drupal.tableresponsive,core\\/internal.jquery.form,core\\/normalize,filter\\/drupal.filter,shortcut\\/drupal.shortcut,system\\/admin,system\\/base,taxonomy_manager\\/form,taxonomy_manager\\/tree,toolbar\\/toolbar,toolbar\\/toolbar.escapeAdmin,tour\\/tour,user\\/drupal.user.icons\"},\"ajaxTrustedUrl\":{\"form_action_p_pvdeGsVG5zNF_XLGPTvYSKCf43t8qZYSwcfZl2uzM\":true,\"\\/admin\\/structure\\/taxonomy_manager\\/voc\\/tags?ajax_form=1\\u0026_wrapper_format=drupal_ajax\":true},\"ajax\":{\"edit-load-term-data--kxdjNpgrWLU\":{\"callback\":\"::termDataCallback\",\"event\":\"change\",\"url\":\"\\/admin\\/structure\\/taxonomy_manager\\/voc\\/tags?ajax_form=1\\u0026_wrapper_format=drupal_ajax\",\"dialogType\":\"ajax\",\"submit\":{\"_triggering_element_name\":\"load-term-data\"}},\"edit-miniexport--kxXyNbRWTjU\":{\"callback\":\"::exportListFormCallback\",\"event\":\"mousedown\",\"keypress\":true,\"prevent\":\"click\",\"url\":\"\\/admin\\/structure\\/taxonomy_manager\\/voc\\/tags?ajax_form=1\\u0026_wrapper_format=drupal_ajax\",\"dialogType\":\"ajax\",\"submit\":{\"_triggering_element_name\":\"export\",\"_triggering_element_value\":\"Export all\"}},\"edit-export--fRfwxOOYXAc\":{\"callback\":\"::exportFormCallback\",\"event\":\"mousedown\",\"keypress\":true,\"prevent\":\"click\",\"url\":\"\\/admin\\/structure\\/taxonomy_manager\\/voc\\/tags?ajax_form=1\\u0026_wrapper_format=drupal_ajax\",\"dialogType\":\"ajax\",\"submit\":{\"_triggering_element_name\":\"export\",\"_triggering_element_value\":\"Export\"}},\"edit-move--jwU73IX3erQ\":{\"callback\":\"::moveFormCallback\",\"event\":\"mousedown\",\"keypress\":true,\"prevent\":\"click\",\"url\":\"\\/admin\\/structure\\/taxonomy_manager\\/voc\\/tags?ajax_form=1\\u0026_wrapper_format=drupal_ajax\",\"dialogType\":\"ajax\",\"submit\":{\"_triggering_element_name\":\"move\",\"_triggering_element_value\":\"Move\"}},\"edit-delete--fynBIP6l8gY\":{\"callback\":\"::deleteFormCallback\",\"event\":\"mousedown\",\"keypress\":true,\"prevent\":\"click\",\"url\":\"\\/admin\\/structure\\/taxonomy_manager\\/voc\\/tags?ajax_form=1\\u0026_wrapper_format=drupal_ajax\",\"dialogType\":\"ajax\",\"submit\":{\"_triggering_element_name\":\"delete\",\"_triggering_element_value\":\"Delete\"}},\"edit-add--cqI4DM4ijJU\":{\"callback\":\"::addFormCallback\",\"event\":\"mousedown\",\"keypress\":true,\"prevent\":\"click\",\"url\":\"\\/admin\\/structure\\/taxonomy_manager\\/voc\\/tags?ajax_form=1\\u0026_wrapper_format=drupal_ajax\",\"dialogType\":\"ajax\",\"submit\":{\"_triggering_element_name\":\"add\",\"_triggering_element_value\":\"Add\"}}},\"taxonomy_manager\":{\"tree\":[{\"id\":\"edit-taxonomy-manager-tree--pwJAKCLpM04\",\"name\":\"taxonomy[manager][tree]\",\"source\":[{\"title\":\"Blue\",\"key\":\"1\"},{\"title\":\"Green\",\"key\":\"3\"},{\"title\":\"Red\",\"key\":\"2\"}]}]},\"toolbar\":{\"breakpoints\":{\"toolbar.narrow\":\"only screen and (min-width: 16.5em)\",\"toolbar.standard\":\"only screen and (min-width: 38.125em)\",\"toolbar.wide\":\"only screen and (min-width: 61em)\"},\"subtreesHash\":\"7-9vto32uNdmH-YRS0uRMvyrDqozLqY623gYlczNClc\"},\"path\":{\"baseUrl\":\"\\/\",\"pathPrefix\":\"\",\"currentPath\":\"admin\\/structure\\/taxonomy_manager\\/voc\\/tags\",\"currentPathIsAdmin\":true,\"isFront\":false,\"currentLanguage\":\"en\",\"currentQuery\":{\"_wrapper_format\":\"html\",\"ajax_form\":\"1\"}},\"pluralDelimiter\":\"\\u0003\",\"user\":{\"uid\":\"1\",\"permissionsHash\":\"ed2403a2ae29a27933ef8500c439ca84cc2c30ae5ee88c6dfc645572278c4bb4\"}}\n",
    "name": "AjaxError"
}
alfattal’s picture

Status: Postponed (maintainer needs more info) » Active
alfattal’s picture

StatusFileSize
new48.89 KB
alfattal’s picture

alfattal’s picture

@VladimirAus Did you have the chance to look into the information I provided?

delacosta456’s picture

hi all
i also confirm this issue after selecting "Entity browser" as Widget on field's form display and now going back to the edit/add term page

vladimiraus’s picture

Status: Active » Needs work

Please create MR.

luisj0_c’s picture

I also have the same scenario as @delacosta456 and have confirmed that it is happening.

dburiak’s picture

Status: Needs work » Needs review
Related issues: +#2504115: AJAX forms should submit to $form['#action'] instead of <current>
StatusFileSize
new7.23 KB

It looks like it's related to the Drupal core issue https://www.drupal.org/project/drupal/issues/2504115.

The workaround is to render the form without Ajax and send a taxonomy term ID through the URL query parameter.
The patch is attached.

I couldn't expand the tree to the given TID using the 'terms_to_expand' setting. Probably, maintainers could help with it.

vladimiraus’s picture

Status: Needs review » Needs work

Thank you for your contribution.
Can you create MR?

kolesnikoff made their first commit to this issue’s fork.

kolesnikoff’s picture

@dburiak, I pushed your patch to the branch. Please fix the issues we found while testing the latest changes.

dburiak’s picture

Issue summary: View changes
StatusFileSize
new11.08 KB

The PR is updated.
The updated patch can be found in the attachment.

dburiak’s picture

Status: Needs work » Needs review
phernand42’s picture

StatusFileSize
new10.63 KB

I had to make a small adjustment to this patch since it did not apply cleanly due to another taxonomy manager patch that I had to apply earlier. Here is an updated patch just in case there are folks out that applied patch from issue 3474919.

jannakha made their first commit to this issue’s fork.

jannakha’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new11.86 KB

created a patch from MR (it's merged with #3474919)
make sure library/jquery.fancytree contains all JS - see #3467549

vladimiraus’s picture

Status: Reviewed & tested by the community » Fixed

Thank you all! Committed! 🍻
This issue also fixes #3474919: Fix broken form element taxonomy manager tree.

torfj’s picture

Status: Fixed » Needs work
StatusFileSize
new107.87 KB
new74.65 KB

This issues causes the toolbar position to be next to the tree and only abote the term page. Before it was above both the tree and term page. See images.

Before:
before

After:
after

torfj’s picture

The search functionality is also not working with these changes..

It also seems rather radical to completely render the form without Ajax, as this is not ideal from a user experience perspective. Do the maintainers have any plans to look into a solution where Ajax will still work on the form?

klausi’s picture

Oh my, this change destroyed one of the most important features of taxonomy manager: quickly clicking and navigating between terms. Created a citical bug report at #3505219: Restore term clicking AJAX functionality, will post a fix shortly for all AJAX fans.

vladimiraus’s picture

Status: Needs work » Fixed

This issue has been committed before. Keeping it closed.
Cheers @klausi for opening #3505219: Restore term clicking AJAX functionality. Please move all future commits there.

vladimiraus’s picture

Ajax issue with media library.

One of the reasons Ajax was removed is that it stopped working with media libraries and other Ajax dependent modules a while back.

klausi’s picture

We now have a new approach for the AJAX functionality in #3505219: Restore term clicking AJAX functionality that works with multi-value fields and media libraries.

Please test the merge request there. If there are no objections I'm planning to merge it in a couple of days.

Thanks @torfj for working on it so hard!

Status: Fixed » Closed (fixed)

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