I have more than 100 fields on the entity form and adding more fields make it slower and slower.. any idea why is it like this

Comments

tedbow’s picture

This is likely just a problem with the Field API, which is what Entityforms, node, users, terms, etc use.. I personally have never had that many fields on any entity.

To test you could add that many fields to a test content type on a test copy of your site. You could use Field Tools quickly copy the fields.

Though I pretty sure you would have the same problems.

What kind of server/resources are running Drupal on?

tedbow’s picture

Title: Form creation is damn slow » Form creation is very slow on 100+ field forms
tedbow’s picture

Status: Active » Postponed (maintainer needs more info)

Postponing this b/c we need more info

Qandeel’s picture

Priority: Normal » Critical

I have found another weird thing using entityforms, i have around 300 fields on the form, the manage field section is working fine but when i am going to edit the entity form itself, the memory_limit gets exhausted, I am currently having memory_limit = 256M

Also i even cannot create new entityforms it says memory_limit exhausted, but on the other hand it does not look like it has issues with entity model because I can still create and edit content types, taxonomy, users.

any idea where should i look in code to see whats happening when we try to edit current gigantic entity form or when we are trying to create a new one..

Qandeel’s picture

further investigating through logs it looks like token module is having issues with lots of fields

stderr: PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 60 bytes) in /dev/sites/all/modules/contrib/token/token.pages.inc on line 228, referer: http://example/entityform/1/edit

tedbow’s picture

Priority: Critical » Major
Status: Postponed (maintainer needs more info) » Active

@Qandeel sorry to say but 100 field might too fields. I am pretty sure that 300 fields is too many so this module will probably not work in that case especially if you cannot increase the memory limit.

Checkout When to Use Entityforms. It might need something on field limits.

Qandeel’s picture

@tedbow - this is actually not an issue with the number of fields, the framework supports more fields then I have used it. Only issue is the token module and it actually goes through all the fields and creates token so it might be usefull to revisit this section and move it on some other tab just like "validation rules" and "submission rules" Most of the time user does not want to add token to the body field of entity types so lets put it as suggestion to move it to separate tabs.

Further I am always working on projects where drupal and its contrib modules are pushed to the limits so this actually provides me the opportunity to look in to the optimization area of core and contrib modules... just to give you about a little background.

I would also like to know if we can associate revisions of submission ... this will actually open up another option saying, "Resubmit action", I am proposing an action that will be "Dont Allow - Create new revision of submission", I know entity model supports version of fields so lets get this in to entity forms.. I can work on it if you can show me where is this part written or available, asking just to save some time otherwise I have to dig in to your module to find where it is and we can add this as a new feature

tedbow’s picture

it might be usefull to revisit this section and move it on some other tab just like "validation rules" and "submission rules" Most of the time user does not want to add token to the body field of entity types so lets put it as suggestion to move it to separate tabs.

@Qandeel, so just to clear you suggesting moving the token browser off the entityform type edit form?

Sorry I think it is much more common for people to want to have access to all tokens than to have 100+ or 300+ field on the form. Tokens can be used in various places on the entityform type edit form.

The token browser will not work the same way if it is on another tab. You are able to click token and it shows in the last form element you were in. That would not work from another tab.

The problem with having so many tokens because of so many fields is not limited to the entityform type edit form. This will be a problem anywhere the token browser is displayed. For instance the token browser is used extensively in the Rules module.

A solution for your problem would be to implement hook_form_entityform_type_form_alter and remove the $form['tokens'] element.

As far as revisions please checkout #2021009: Add revision support to submisions.
Please keep each issue focused on 1 topic

tedbow’s picture

Also just in-case others find this issue I would not recommend using this module with 300+ field forms with this modules. Webform is a better module in that use case.

@Qandeel, this might not help in your case since obviously you have already invested a lot of time making these forms.

Qandeel’s picture

Well just to clarify, webform does not handle more than 200 fields and 89 conditions.. That was already pushed to the limits.. so thats why I moved to entity forms, yours module seems to be very close to handle forms with 300+ fields. I have a prototype working very fine.

Only issue was that the token module goes through all the fields and create token instances. you are right this can be issue anywhere if number of fields in the system are 300+. Anyway its a good module and definitely much much better than webforms.

I was assuming that its based on entity model and should have revision feature already built-in but no problem will findout some way to get the submissions through revisions. Thanks for the clarifications about tokens.

I kept this under this same topic because all these events occured due to high number of fields on form, anyway will keep you posted on revision feature.

Qandeel’s picture

I hope this is a known issue on tokens when there are so many fields https://drupal.org/node/1954464

tedbow’s picture

@Qandeel if you are not using Rules then you could upgrade to Entityform 2.x. That would allow you to disable Rules and entity_token module. I think disabling the entity_token module would reduce the number of tokens created by the token browser

tedbow’s picture

re: #1954464: Memory Issue

Looks like the Token Tweaks module might help you out.

Qandeel’s picture

@tedbow - Is the migration from 1.x to 2.x easy? I am not using rules module and does not have any thing in mind to use it in future :)

rosell.dk’s picture

I also have the issue of very slow form and memory getting exhausted at 313 fields. Memory (256 MB) gets exhausted when trying to create a new field. It didn't help to install Token Tweaks and set "Maximum depth limit for the token UI" to 1 - This is the only tweak Token Tweaks currently delivers. Any other ideas?

tedbow’s picture

@rosell.dk I don't think this module(or any other entity type) can handle that many fields. Of course more memory will increase the number of fields but I don't know what the limit will be.

For other users in the future I have created a sandbox project Field Max.

It simply allows easily creating any number of text area fields on a bundle. It could be used to test out the number fields that a system might be able to handle.

tedbow’s picture

I have added a warning and a link to this issue on the module project page.

If someone would take the time to update this issue summary so that new users could get an idea of the issue right away that would be great!

tedbow’s picture

Issue summary: View changes
Status: Active » Fixed

Status: Fixed » Closed (fixed)

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

yfarooq’s picture

I working on web based diary,

In the diary there are 21 days where every day is a Parent 'Group' with field type Vertical tab. Every day has 16 fields which are same for every day, total of 336 fields.

I am able to create successfully 17 days without any problem but after that I am not able to assign fields to any parent 'Group'.

after selecting parent and clinking save it reload the page without saving the configuration.

There is no error or any message to help identifying the problem, I am new with Drupal and don't have any idea why it is happening, I try Google and couldn't find any information that could help.

I was wondering if this is something to do with entity forms limitation on the number of fields/group.

tedbow’s picture

@yfarooq I would suggest not making the dairy the way you are suggesting I think you will run into many more problems.

tedbow’s picture

It would seem to make a lot more sense to use Entity Reference to connect a child Day entity to parent Dairy entity.

Or you could use field collection where you have 1 feild collection fieild on Dairy then limit that to 21 items.

thedut’s picture

I have more than 100 fields on the entity form and adding more fields make it slower and slower.. any idea why is it like this

For huge surveys (more than 100 fields), you can use the Limeurvey Sync module : successfully tested with 700 fields; note that it does not correspond to 700 fields in the field core module but 700 questions.

KristineC’s picture

Webform worked well for me for large data forms. I've exported 800 fields successfully for one project.

kenorb’s picture

So the info should be taken of from the Project Homepage, if this issue is fixed now.

tedbow’s picture

@kenorb the support request was fixed but I still think the warning on the home page:

Do not use Entityform for forms that will contain 150+ form elements

Is correct.

I still would not recommend Entityform if you have that many field.s