Menu
Newbedev LogoNEWBEDEV Python Javascript Linux Cheat sheet
Newbedev LogoNEWBEDEV
  • Python 1
  • Javascript
  • Linux
  • Cheat sheet
  • Contact

Drupal - How to get nodes by custom field value using EntityFieldQuery?

The correct code is the following one.

$entities = $nodeQuery->entityCondition('entity_type', 'node')
  ->entityCondition('bundle', 'article') 
  ->fieldCondition('field_archived','value', '1', '=') 
  ->pager(10)
  ->execute();

Instead of 'field_archived_value' you need to use 'value'.

Tags:

Database

7

Related

Drupal - Must new tables be created in hook_update_N()? Drupal - How can I upload 1000s of nodes per hour to a live drupal 7 site and avoid deadlocks? Drupal - When should "'target' => 'slave'" be used in a query? Drupal - How can I quickly re-save all the nodes on my site (to trigger a rule that activates on content update)? Drupal - Get the latitude and longitude from the user ip Drupal - How can I detect if the current viewed page is administrative? Drupal - Remove subject field from comments Drupal - The PHP version is not correctly detected Drupal - Character limit of field machine name? Drupal - Clear Cache without logging in Drupal - How to remove core search index? Drupal - Unable to send e-mail via sendmail, because User is unknown

Recent Posts

Pandas how to find column contains a certain value Recommended way to install multiple Python versions on Ubuntu 20.04 Build super fast web scraper with Python x100 than BeautifulSoup How to convert a SQL query result to a Pandas DataFrame in Python How to write a Pandas DataFrame to a .csv file in Python
© 2021 newbedevPrivacy Policy