Cannot Upload Files

Xtrobe
Forums
Hi, We came across a problem with the file uploading of the LMS. Once uploaded, an error page is generated. According to the logs, this error came about: PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'lms1_4.field_data_tft_file' doesn't exist: SELECT f.filemime, f.filename, v.title, n.changed, n.uid FROM {node_revision} v LEFT JOIN {node} n ON n.vid = v.vid LEFT JOIN field_data_tft_file c ON c.revision_id = v.vid LEFT JOIN {file_managed} f ON c.tft_file_fid = f.fid WHERE n.nid = :nid AND n.status = 1; Array ( [:nid] => 326 ) in tft_get_content() (line 697 of /var/www/profiles/opigno_lms/modules/opigno/tft/tft.module). To add as well, I also tried to add a file field onto the slide, to compensate for this error. What happens is that if a user creates a new slide, and attaches a file onto it, the slide does not register onto the lesson. Requesting assistance on these matters. Thanks!
Profile picture for user James Aparicio
James Aparicio

Hi Xtrobe,

Hi Xtrobe, Did you delete the file field inside the content type file? If you go to structure -> content type -> file -> manage fields, do you see the field with a machine name tft_file? Best regards
Xtrobe

Hi James,

Hi James, No, I didn't. I have a feeling, though, that this was not properly installed, even if it was from a clean installation. It perhaps was ignored?
Xtrobe

If I may add, these are the

If I may add, these are the tables that I see on my database: tft_archive_restore tft_folder_content_weight tft_tid_og_nid I may be wrong on the tables, but these are the ones I immediately see that is related to tft.
admin

Hi Xtrobe,

Hi Xtrobe, If you do not see the file field in the content type file and you did not delete it, it was not properly installed. Best regards
Xtrobe

Hi Admin,

Hi Admin, My apologies for the confusion. What I meant was I didn't delete anything. When I checked the content type, I saw the tft_file within the Manage Fields.
Profile picture for user James Aparicio
James Aparicio

Hi Xtrobe,

Hi Xtrobe, The file module does not directly do any database query to the field, it is handled by Drupal, if the database table field_data_tft_file does not exist then where was a problem during installation that you did not notice. Best regards
Xtrobe

Hi James,

Hi James, I might be referring to something else that's wrong, so I ask for a little patience for this matter. Essentially, the error that I'm experiencing happens when I attempt to upload files using the Files tool of the course. Once uploaded and saved, the system generates an error. Now, when I look at my content manager, I see there that the node containing the file was successfully uploaded. All in all, the Files tool does not return the listing of the files that were uploaded using the tool. Let me know if you have any other questions regarding this. Thanks.
Profile picture for user James Aparicio
James Aparicio

Hi Xtrobe,

Hi Xtrobe, After you added the file, in the content manager when you click on the file node, you view the file? It is being uploaded?
Xtrobe

Hi James,

Hi James, The file node is present, along with its attachment. Only the file tool has a problem.
Profile picture for user James Aparicio
James Aparicio

Hi Xtrobe,

Hi Xtrobe, And what is the file field machine name inside the content type file? tft_file or field_tft_file? Best regards
Xtrobe

tft_file

tft_file
Profile picture for user James Aparicio
James Aparicio

Hi Xtrobe,

Hi Xtrobe, Can you provide me a database dump? Best regards
Xtrobe

Will do. Will send it to you

Will do. Will send it to you through your email. Thanks!
Xtrobe

Sent an email with the dump.

Sent an email with the dump. Just in case, here's the link: http://we.tl/HAQntQcypg
Profile picture for user James Aparicio
James Aparicio

Hi Xtrobe,

Hi Xtrobe, The problem is that you prefixed your db. Inside tft.module and includes/tft.pages.inc in the queries where you have `{$db_table}` change to `{".$db_table."}`. We will patch this in the new release for people that prefix their database. Best regards
Profile picture for user James Aparicio
James Aparicio

https://drupal.org/node

https://drupal.org/node/2188433
Xtrobe

Hi James,

Hi James, Confirming that this correction has worked. Thanks!