Hi, it seems this module gives WSOD if database tables are prefixed.

I have two separate drupal installations, one with tables prefixed and one without prefix. Taxonomy import works as intended (great module btw!) on the installation without prefix but gives WSOD on the one with table prefix.

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'MYMODULE_db.file_managed' doesn't exist: SELECT file_managed.uri FROM file_managed ORDER BY file_managed.fid DESC limit 1; Array ( ) in Drupal\taxonomy_import\Form\create_taxonomy() (line 87 of C:\MYMODULE\public_html\modules\contrib\taxonomy_import\src\Form\ImportForm.php).

Found a similar issue here.

CommentFileSizeAuthor
#7 3017222-7.patch703 bytesvuil
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

Bandana created an issue. See original summary.

bandana’s picture

Changing line 87 in /src/form/ImportForm.php
from this
$loc = db_query('SELECT file_managed.uri FROM file_managed ORDER BY file_managed.fid DESC limit 1', array());
to this
$loc = db_query('SELECT {file_managed.uri} FROM {file_managed} ORDER BY {file_managed.fid} DESC limit 1', array());

seems to have fixed the issue.

aswathyajish’s picture

Status: Active » Fixed

Hello,

Thanks for using this module.

Fixed the above mentioned issue and committed the change to development release.

Status: Fixed » Closed (fixed)

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

andsigno82’s picture

Hi,
error still persists in stable release.

I would suggest this edit, working for prefixed and non-prefixed db's.

SELECT {file_managed}.uri FROM {file_managed} ORDER BY {file_managed}.fid DESC limit 1

at line 85 of ImportForm.php

vuil’s picture

Version: 8.x-1.0 » 2.x-dev
Status: Closed (fixed) » Active
vuil’s picture

Priority: Normal » Critical
Status: Active » Needs review
StatusFileSize
new703 bytes

  • vuil committed 6cfa4f1 on 2.x
    Issue #3017222 by vuil: Import leads to WSOD
    
vuil’s picture

Status: Needs review » Fixed
vuil’s picture

vuil’s picture

Status: Fixed » Closed (fixed)

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

Nuuou made their first commit to this issue’s fork.

nuuou’s picture

BTW, this is not fixed, and the commit in comment #8 is also broken.

I've forked this with a new patch against the current 2.x branch, which is working for me for my current use-case.
Unfortunately I don't have permissions to re-open this issue.

vuil’s picture

Status: Closed (fixed) » Needs review
nuuou’s picture

Title: Import leads to WSOD » Missing database table prefixing
Related issues: +#3248572: Import does not allow for database table prefixes
vuil’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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