Hi

If I tried to edit a taxonomy with a file field, when I click the button upload/remove, I got an error saying "An illegal choice has been detected. Please contact the site administrator.", and under the Parent terms - only global terms are allowed to be selected.

Tracing down the code at line 187, the path_is_admin(current_path()) gave a FALSE value where I believe what the problem is. As I'm clicking the upload/remove button, current_path() function gave a correct value of [ file/ajax/XXXXXX ], but is it not an admin path according to path_is_admin.

I wonder is there any potential fix on this issue, seems like it doesn't work correctly with file.module, not sure if it is something we need to fix the ajax call in file.module though.

CommentFileSizeAuthor
Relations.png46.98 KBchingmanle
Illegal choice error.png39.51 KBchingmanle

Comments

delta’s picture

Hi, This is looking bad... Do you find a solution / alternative configuration ?

Thanks to report.

drikc’s picture

Hello, I've just created another issue which is related to the path_is_admin(current_path()) condition: #2508826: Taxonomy autocomplete suggestion and the affiliate on user's domain permission

Using hook_admin_paths() could allow to change a given path to be an "admin" one, but don't know actually if there is side effects to doing so?....

bohart’s picture

Version: 7.x-1.4 » 7.x-1.x-dev
Status: Active » Closed (outdated)
Related issues: +#2508826: Taxonomy autocomplete suggestion and the affiliate on user's domain permission

D7 reached its EOL back in January 2025, and there is no active release for D7 for this module.
Neither development nor support is planned for D7.

All D7-related issues (especially those with 10+ years of inactivity) are marked as outdated in a bunch.
If/once the issue still arises in D11+ versions, please create a follow-up issue.

Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.