Drupal error EntityFieldQueryException: Unknown field

Dear experts,

I´ve noticed that every time I enable Commons Trusted Contacts and private message I get this error which by the way crashes my whole site, so I have to restore my database_

EntityFieldQueryException: Unknown field: field_my_request in EntityFieldQuery->addFieldCondition() (line 765 of /Users/Me/Documents/CommonsSite/includes/entity.inc).

Any idea how could I get rid of that error?


Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hey Winter,

Hmmm....these are always fun to troubleshoot. </sarcasm> Let's start with the obvious: clear your cache, try switching to another theme to see if it fixes the problem, etc. If any of these work then you can at least narrow down the location.

Secondly, do you have a field defined named 'field_my_request?' If you look through your fieldable entities (content types, users, taxonomies, etc.) do you see that field anywhere?

The error is basically saying that while adding a condition to a SQL query (e.g. "WHERE" clause) it's referring to that field, and that field doesn't exist in the database.

The problem doesn't actually exist on line 765 of entity.inc. That's just where the unknown field is being "used" in the code. It's being referred to elsewhere.

As a side note: when you say you have to reinstall your entire database, is that a result of a white screen? If so, I'd recommend installing drush on the command line (if you are able to) and just use it to disable the problem modules after this happens:

drush -y dis <modulename>

That way you don't have to restore your db every time. That will disable the modules without having to go to the interface to do it.



Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sivagnanam chandrakanthTechnical LeadCommented:
It is because of the field collected not working as expected.. That is the field is either is  deleted or marked for deletion in field_config ,field_instances and other tables..But the same is not done in all tables..

Enabling the system_cron will solve this..system_cron will remove all the fields which are marked for deletion.
glepizaAuthor Commented:
hmm, every time I enable that commons trusted contacts module, I can´t access to any admin page, so I don´t know how to correct that error without being able to access admin.... is there a way to fix this issue on the database?
Powerful Yet Easy-to-Use Network Monitoring

Identify excessive bandwidth utilization or unexpected application traffic with SolarWinds Bandwidth Analyzer Pack.

sivagnanam chandrakanthTechnical LeadCommented:
try running applicationpath/cron.php and then enable contacts modules
glepizaAuthor Commented:
can´t access any admin page since I enabled that module :(
sivagnanam chandrakanthTechnical LeadCommented:
go to system table and change the status to "0" for that module, that will disable that module and allow you run the cron..then enable the module again from admin
glepizaAuthor Commented:

Well, I did ran cron, for some reason it gives me a blank page, but when I go to /admin/reports/dblog it says that cron was ran. the weird thing is that after running cron I enabled the module again and admin crashes and I keep getting the same error message:
dQuery->addFieldCondition() (line 765

glepizaAuthor Commented:
The only solution I found was updating Drupal Commons to it latest version which got released like last week. It is marked as red, which I think it is not a pretty stable version, but it got rid of that error. Thanks
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.