I am using a content type with a viewfield on it with the inline entity field node reference on a separate content type. ie Content Type 1 has one field, the viewfield. Content Type 2 has many field including an entity reference that can reference Content Type 1 which uses the inline entity form widget.

Because the form is returned via ajax, the amount of data returned is too large and takes about 2 minutes to load. I narrowed the issue down to the token help table. I have already created a patch, I just need the node id of this issue to name it properly.

This is for a very specific use case, but it's still useful for those out there who may need it.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kurtfoster’s picture

Status: Active » Needs review
FileSize
2.25 KB

OK, here's my first go at the patch, I need it to run in drush so I'll test it out now.

kurtfoster’s picture

It works pretty well, I just made a mistake on the config form which I've fixed up in this update.

kurtfoster’s picture

Just a little more explanation here. The issue is just the total quantity of text passed back as json, it is just too much to be efficient. I have added a config form for view field under config ._ content authoring. You can uncheck the show token help checkbox and save. This will stop displaying the token help. This is obviously a bit of a usability issue as the user can no longer see the token help. But this is a quick fix I've created in order for my project to work.

Any suggestions on how to do this better are most welcome.

elstudio’s picture

I've attached patch 3, which takes a simpler approach.

Token module now supports loading the token browser in a modal via javascript, which means it only loads when you want to use it.

See https://drupal.org/node/1684984 and https://drupal.org/comment/6461334#comment-6461334.

This patch applies that technique to view field, which solves the problem for me.

If your site uses lots of tokens the modal browser will still take a while to load, so you might also want to look into https://drupal.org/project/token_tweaks. This module lets you limit the depth of tokens, significantly saving page load time.

Hope this helps!

Anybody’s picture

I can confirm this problem. The patch works great.

justindodge’s picture

Status: Needs review » Reviewed & tested by the community

I've had this issue on a couple sites and used the patch in #4 with great success.

I think it's a safe, simple, no-brainer solution for what can be a very serious performance issue under the right conditions. Using the token browser is probably a better practice in any case.

Let's get it committed!

keithm’s picture

Version: 7.x-2.0 » 7.x-2.x-dev
Status: Reviewed & tested by the community » Needs work

Is this still a problem with the 7.x-2.x dev release? Patch #4 does not apply against this branch.

justindodge’s picture

Status: Needs work » Fixed

@keithm - I checked it out and it looks like the latest 7.x-2.x dev IS already leveraging the token browser and this problem is resolved there.

This patch might still be useful for anyone looking to apply against the latest official release (7.x-2.0 as of this writing), but it looks like future releases will have resolved this issue.

Thanks!

Status: Fixed » Closed (fixed)

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