Hi there,
I have a D7 site installed with a prefix to the drupal tables. When I want to add a custom table got an error like this:
PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'default.PREFIX_' doesn't exist: DESCRIBE { TABLE_NAME }; Array ( ) in function view_custom_table_add_custom_table_column_relationship_form() (line 106 in file /var/www/web/sites/all/modules/contrib/view_custom_table/view_custom_table.admin.inc).
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | view_custom_table-describe_error-3069124-2-D7.patch | 1.75 KB | tibezh |
Comments
Comment #2
tibezh commentedA patch with a solution attached.
Comment #3
apparatchik commentedThis is also an issue in the 8.x branch, manually replacing { @table_name } with {@table_name} in the corresponding files fixes it.
Comment #4
darkodev commentedUpgraded to Drupal core 7.78 today and got a new error like the one below, which this patch solves for us by removing the spaces. Since we are not using table prefixes, I don't think prefix is pertinent to this issue ie. it will happen all the time on latest Drupal core since 7.76, I believe, when changes were made in handling table names in preparation for MySQL 8.
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name ' table_name_here ': DESCRIBE { table_name_here }; Array ( ) in view_custom_table_views_data() (line 174 of /path/to/view_custom_table.module).
Comment #5
geoffray commentedHad the same error than darkodev after a Drupal core update, seems effectively related to the Drupal 7.76 release where some changes were made at the table name quoting level. Patch #2 succesfully fixes the issue and should be merged urgently to a new Views Custom Table 7.x release because currently it breaks down any up-to-date Drupal 7 website.
Comment #6
oldspot commentedI've just had this issue again on a site and found this issue here then realised that I've created the exact same solution on this duplicate issue here and forgot about it :))
https://www.drupal.org/project/view_custom_table/issues/3186756
The patches are exactly the same and in both cases have been reviewed by several users so should probably be committed to the module as people seem to keep facing this issue.
Comment #7
joseph.olstadComment #9
joseph.olstadThanks for the fix, I'll cut a new 7.x release shortly.
Comment #10
joseph.olstadNew release for Drupal 7 , version 7.x-1.0
download version 7.x-1.0
Comment #11
rajeshreeputraComment #12
rajeshreeputra