Steps to reproduce:

  1. Set up a new Drupal 8 site with the Standard installation profile
  2. Go to Configuration > Account settings > Manage fields, click Add Field, and create a field of type Text (plain)
  3. Run drush audit-content
Drupal\Core\Entity\Query\QueryException: '' not found in core/lib/Drupal/Core/Entity/Query/Sql/Tables.php:316                                                                                    [error]
Stack trace:
#0 core/lib/Drupal/Core/Entity/Query/Sql/Tables.php(237): Drupal\Core\Entity\Query\Sql\Tables->ensureEntityTable('', '', 'INNER', NULL, 'base_table', 'uid', Array)
#1 core/lib/Drupal/Core/Entity/Query/Sql/Condition.php(44): Drupal\Core\Entity\Query\Sql\Tables->addField('', 'INNER', NULL)
#2 core/lib/Drupal/Core/Entity/Query/Sql/Query.php(155): Drupal\Core\Entity\Query\Sql\Condition->compile(Object(Drupal\Core\Database\Driver\mysql\Select))
#3 core/lib/Drupal/Core/Entity/Query/Sql/Query.php(74): Drupal\Core\Entity\Query\Sql\Query->compile()
#4 site_audit/Check/Content/FieldInstances.php(111): Drupal\Core\Entity\Query\Sql\Query->execute()
#5 site_audit/Check/Abstract.php(254): SiteAuditCheckContentFieldInstances->calculateScore()
CommentFileSizeAuthor
#2 site_audit-userfieldinstance-2892004.patch877 bytessmokris
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

smokris created an issue. See original summary.

smokris’s picture

Status: Active » Needs review
FileSize
877 bytes

The attached patch enables the check to complete successfully.

hussainweb’s picture

Version: 8.x-2.x-dev » 8.x-3.x-dev
Status: Needs review » Reviewed & tested by the community

The patch worked for me. Also, this error also occurs in 8.x-3.x and considering that that might be the latest development branch, I am shifting the issue there.

hussainweb’s picture

Version: 8.x-3.x-dev » 8.x-2.x-dev

Sorry, this is for 8.x-2.x. I download 3.x which got placed in another directory and I thought it worked. Fixing the version now.

dpagini’s picture

I ran into this same error and used this patch to resolve it. Worked successfully for me.

  • smokris authored 7fac03a on 8.x-2.x
    Issue #2892004 by smokris, hussainweb, dpagini: Fixed error "...
socketwench’s picture

Status: Reviewed & tested by the community » Fixed

Looks good to me. Committed!

Status: Fixed » Closed (fixed)

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