Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal database error trying to enable group_alert_banner #315

Open
finnlewis opened this issue Apr 22, 2024 · 1 comment
Open

Fatal database error trying to enable group_alert_banner #315

finnlewis opened this issue Apr 22, 2024 · 1 comment
Assignees

Comments

@finnlewis
Copy link
Member

finnlewis commented Apr 22, 2024


In ExceptionHandler.php line 56:
                                                                                                                                                                                                                                                                                                                
  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'gcfd.entity_id' in 'where clause': SELECT "base_table"."vid" AS "vid", "base_table"."id" AS "id", "localgov_alert_banner__type_of_alert"."type_of_alert_value" AS "type_of_alert_value", "localgov_alert_banner_field_data_2"."changed" AS "changed"  
  FROM                                                                                                                                                                                                                                                                                                          
  "localgov_alert_banner" "base_table"                                                                                                                                                                                                                                                                          
  INNER JOIN "localgov_alert_banner_field_data" "localgov_alert_banner_field_data" ON "localgov_alert_banner_field_data"."id" = "base_table"."id"                                                                                                                                                               
  LEFT JOIN "localgov_alert_banner__type_of_alert" "localgov_alert_banner__type_of_alert" ON "localgov_alert_banner__type_of_alert"."entity_id" = "base_table"."id"                                                                                                                                             
  LEFT JOIN "localgov_alert_banner_field_data" "localgov_alert_banner_field_data_2" ON "localgov_alert_banner_field_data_2"."id" = "base_table"."id"                                                                                                                                                            
  WHERE ("localgov_alert_banner_field_data"."status" = :db_condition_placeholder_0) AND (((gcfd.entity_id IS NOT NULL AND gcfd.gid = :gid) OR gcfd.entity_id IS NULL))                                                                                                                                          
  ORDER BY "localgov_alert_banner__type_of_alert"."type_of_alert_value" DESC, "localgov_alert_banner_field_data_2"."changed" DESC; Array                                                                                                                                                                        
  (                                                                                                                                                                                                                                                                                                             
      [:db_condition_placeholder_0] => 1                                                                                                                                                                                                                                                                        
      [:gid] => -1                                                                                                                                                                                                                                                                                              
  )                                                                                                                                                                                                                                                                                                             
                                                                                                                                                                                                                                                                                                                

In StatementWrapperIterator.php line 111:
                                                                                             
  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'gcfd.entity_id' in 'where clause'  
                                                                                             

Steps to reproduce:

  1. Install LocalGov Drupal Microsites 4.x
  2. Enable localgov_alert_banner
  3. Enable group_alert_banner.

Tried both through the admin UI and with drush.

Looks like this hook_query_TAG_alter() is being triggered on install:
https://github.com/localgovdrupal/localgov_alert_banner/blob/1.x/modules/group_alert_banner/group_alert_banner.module#L94-L119

And we're going to want to refactor getting the group with the deprecated domain group resolver:

https://github.com/localgovdrupal/localgov_alert_banner/blob/1.x/modules/group_alert_banner/group_alert_banner.module#L108

Not sure if that last bit is the cause or not.

@Adnan-cds
Copy link
Contributor

I can reproduce it :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants