Problem/Motivation

We have custom entity types created with the external_entities module. These entities are not stored in the SQL database.
When I run security_review, it crashes with this error:

In ExceptionHandler.php line 53:
                                                                                                                      
  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'national.offre__field_body' doesn't exist: SELECT "t".*  
  FROM                                                                                                                
  "offre__field_body" "t"; Array                                                                                      
  (                                                                                                                   
  )                                                                                                                   
                                                                                                                      

In StatementWrapper.php line 145:
                                                                                                        
  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'national.offre__field_body' doesn't exist  
                                                                                                        

There might be some other use cases where entities are not stored in the database.

Steps to reproduce

  1. Install security_review and external_entities.
  2. Configure an external entity type and add at least one field.
  3. Run security_review.

Proposed resolution

It should only run this check on fields stored in the SQL database.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

prudloff created an issue. See original summary.

prudloff’s picture

Status: Active » Needs review
himanshu_jhaloya’s picture

Assigned: Unassigned » himanshu_jhaloya

Reviewed the merge request code base looks fine

himanshu_jhaloya’s picture

Assigned: himanshu_jhaloya » Unassigned
smustgrave’s picture

Version: 8.x-1.x-dev » 2.0.x-dev
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

@himanshu_jhaloya thank you but when reviewing please provide meaningful testing steps followed. See https://www.drupal.org/community/contributor-guide/task/review-a-patch-o... for guidance.

I changed this for the 2.0.x branch as that will be the more active branch going forward.
Tested to make sure this didn't break anything existing by adding "dangerous" code to the body field on a content type.
Ran the security review and it flagged everything correctly.

I don't have an external source to setup external_entities but as long as nothing existing broke I'm good.

  • e1f84a4 committed on 2.0.x
    Issue #3325599: Compatibility with external_entities
    
smustgrave’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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