On installing File Aliases with File Paths 7.x-1.x-dev (16/06/2011), I get a fatal error on activating the module:

PDOException: SQLSTATE[01000]: Warning: 1265 Data truncated for column 'filealias' at row 1: ALTER TABLE {filefield_paths} CHANGE `filealias` `filealias` MEDIUMTEXT NOT NULL; Array ( ) in db_add_field() (line 2768 of /*my_drupal_path*/includes/database/database.inc).

Comments

silkogelman’s picture

StatusFileSize
new29.08 KB

confirmed, got the same error with
- Drupal 7.7
- file_aliases 7.x-1.x-dev (2011-Feb-25)
- filefield_paths 7.x-1.x-dev (2011-Jul-26)

protools’s picture

sub

Errornix’s picture

Same issue.
-Drupal 7.8
-File Aliases 7.x-1.x-dev
-FileField Paths 7.x-1.0-alpha1

Salif’s picture

I have this issue.
Using Drupal 7.9
when attempting to save change in image field configuration.
Even if I disable the filealiases module

PDOException: SQLSTATE[HY000]: General error: 1364 Field 'filealias' doesn't have a default value: INSERT INTO {filefield_paths} (type, field, filename, filepath, active_updating) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4); Array ( [:db_insert_placeholder_0] => node::stickers [:db_insert_placeholder_1] => uc_product_image [:db_insert_placeholder_2] => a:4:{s:5:"value";s:59:"[file:ffp-name-only-original].[file:ffp-extension-original]";s:7:"tolower";i:0;s:8:"pathauto";i:0;s:13:"transliterate";i:0;} [:db_insert_placeholder_3] => a:4:{s:5:"value";s:31:"images/[node:content-type:name]";s:7:"tolower";i:0;s:8:"pathauto";i:0;s:13:"transliterate";i:0;} [:db_insert_placeholder_4] => 0 ) in drupal_write_record() (line 6884 of /Users/.../includes/common.inc).

Please help

Thank you

PazZze’s picture

I got:
PDOException: SQLSTATE[01000]: Warning: 1265 Data truncated for column 'filealias' at row 1: ALTER TABLE {filefield_paths} CHANGE `filealias` `filealias` MEDIUMTEXT NOT NULL; Array ( ) i db_add_field() (rad 2808 av /*path_to_drupal*/includes/database/database.inc).

Drupal core 7.10
file_aliases 7.x-1.0-beta1
FileField Paths 7.x-1.0-beta1

Ahyari’s picture

I had the same issue when I uninstalled the File Aliases module.
I solved it by deleting the 'filealias' column from 'filefield_paths' table.

jonhattan’s picture

The error I get is:

DatabaseSchemaObjectDoesNotExistException: Cannot add field <em class="placeholder">filefield_paths</em>.<em class="placeholder">filealias</em>: table doesn't exist. in DatabaseSchema_mysql->addField() (line 320 of /var/www/venexma.xsto.info/htdocs-dev/includes/database/mysql/schema.inc).

reviewing the .install file it seems to me that 6.x version was translated from d6 but not adapted to new filefield_paths.

ar-jan’s picture

I can confirm the same error as #7, upon enabling the module.

dercheffe’s picture

Subscribe. I'm using Drupal 7.12

Ankabout’s picture

Just FYI, you might want to see this development on D.O: http://drupal.org/node/1306444

This means it's no longer necessary to post a message to subscribe...

svenaas’s picture

I can also confirm #7 using Drupal 7.12 and filefield_paths 7.x-1.0-beta3.

Renee S’s picture

Title: Install broken: still using d6 table schema » Activation Error: PDOException

I did an experiment and updated the install script to use the {file_managed} table instead, and updated the system schema to match.

Now, when trying to use the module, I'm getting a database error through the ajax uploader. filefield_paths attempts to insert a record into the {file_managed} table without the {filealias} column, which is set to be NOT NULL, so it fails.

It seems something in one of the the filefield_path hooks isn't working either.

Renee S’s picture

Title: Activation Error: PDOException » Install broken: still using d6 table schema

Making title more descriptive for mods...

kingfisher64’s picture

Title: Activation Error: PDOException » Install broken: still using d6 table schema

Has any progress been made on this issue? I'd really like to use this mod in all my projects.

kerberos’s picture

Same issue here. :(

-Daniel
Dragonvale Breeding Guide

yannickoo’s picture

I think you can just ignore the message because the filealias table is generated... I got same error like in comment #12 :(

UPDATE: The error is:

Notice: Undefined index: host in _filefield_paths_replace_path() (line 292 of /sites/all/modules/contrib/filefield_paths/filefield_paths.module).

UPDATE: The _filefield_paths_replace_path function uses PHP's parse_url() function but the filefield paths module gets only the file uri. I played with file_create_url() and the errors notices were away (btw there is an issue #1475732: Notice: Undefined index: host in _filefield_paths_replace_path() (row 285 and 287 in filefield_paths.module)) but it still doesn't work – sorry.

And this module has a stable release? They should remove the stable release as long as this issue isn't solved.

mrfelton’s picture

mrfelton’s picture

Status: Active » Needs review
StatusFileSize
new1.54 KB

Patch attached.

mrfelton’s picture

Status: Active » Needs review
StatusFileSize
new2.79 KB

Updated patch removes the not null specification, since serialized text columns can not have a default value, and we don't always hav a value.

kingfisher64’s picture

Can we have a proper new release? The mod doesn't work without the patch. It's needed.

yannickoo’s picture

kingfisher64, did you test the patch? Please mark this issue as RTBC then.

neRok’s picture

I have made a patch to fix a bunch of issues with File Aliases module, including this issue, in the following issue.
#1896326: Combined patch for all known issues in D7 branch

deanflory’s picture

I too am getting this error when attempting to enable the module:

DatabaseSchemaObjectDoesNotExistException: Cannot add field filefield_paths.filealias: table doesn't exist. in DatabaseSchema_mysql->addField() (line 325 of /.../includes/database/mysql/schema.inc

Renee S’s picture

Status: Needs review » Closed (duplicate)

This issue is considered in the linked thread in #22. Please post issues against it there.

deciphered’s picture

Status: Closed (duplicate) » Fixed

Committed. thanks for the hard work.

Status: Fixed » Closed (fixed)

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