Hello.
I’m experiencing a problem with the form of better exposed filter options on the edit view page. Every time the form is loaded, the tree of tokens in loaded along with it. But I have about 200 content types in my system, so my token tree is really heavy. The process of loading the form takes a long time. In fact, I’ve never been able to even see it fully loaded. Once I comment out the use of token tree, everything is normal.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

djecka created an issue. See original summary.

brtamas’s picture

Berdir’s picture

Status: Needs review » Reviewed & tested by the community

Confirmed, had the same problem, this fixes it.

Wasn't just slow but broke the submission for us, because ajax is sending thousands of HTML ID's breaking the input variable limit.

jkopel’s picture

Status: Reviewed & tested by the community » Needs work

While I do believe this could be a problem, I am not able to repro the exact behavior without a sufficiently complex test site.
Additionally this introduces a UI issue where the token tree dialog scrolls with the background and becomes almost unusable.
Given the small number of sites this will help versus the large number of sites it will negatively effect I am not going to commit the patch as written. A patch that addresses the UI issue would be appreciated, prehaps by injecting the returned dialog into the ctools modal in a more integrated fashion.

Thanks!

Berdir’s picture

Status: Needs work » Needs review

The dialog is a standard token module functionality, I don't see how anyone will spend time on improving this, token 7.x is not really maintained and I had no success in getting anyone to work on that in 8.x either. You're welcome to open an issue in token to suggest a variant that loads the browser inline instead of a dialog for a use case like this, but the changes of it happening are prety low unless you do it yourself :)

I understand that this isn't perfect, but it affects more sites than you might think. Dozens of people have been reporting similar issues in token itself and related modules, any non-trivial site with a bunch of node types and fields has this issue. It might not completely break on most of them, but even several seconds of load time is a problem and it's quite easy to get to that point.

jkopel’s picture

Status: Needs review » Needs work

I understand what you are saying, and I recognize that this can be frustrating.
However, I am not going to change the UI in this way for every user of BEF.
If the token tree dialog is displayed on top of an ordinary form page it works quite well, but if you are showing it inside a ctools modal it is difficult to use.

Perhaps an acceptable compromise would be to update this patch to include an admin setting for BEF that allows an admin to choose what type of rendering they want for their site. If someone is willing to add that I would be open to committing the change.
Thanks!

Uv516’s picture

#2 really helped me. Very fine.
Why isn't it implemented in BEF in new updates?

rlhawk’s picture

@Uv516 - See previous comments in this issue for the reason.

crutch’s picture

#2 fixed it thank you. This should be part of the formal release. Token tree is a common problem (PITA) with large sites and various modules that try to use it, including BEF. So we again have to disable it for another module so we can do work.

The alternative without patching and using the formal BEF release, is to allow it to try to load, click "Wait" when browser complains (it may be multiple times), then close the dialog box, then refresh the View you are working on, and then the Save/Cancel buttons will show up. It will then successfully save the BEF settings that you changed. Big pain and takes a lot of time but it works for immediate situations or if you can't apply patch.