hi,

i update my drupal 6 to drupal 7 site. when i install filefield paths and then run update.php WITHOUT activated token module, i get this error (i lost the complete error, so this is just a snippet):

Fatal error: Call to undefined function _filefield_paths_get_field_types()
filefield_paths.install on line 159

when i activate token the error is gone

i suggest you add a little message in the update.php window like (Before you update filefield paths, ACTIVATE token module.

Comments

deciphered’s picture

Status: Active » Postponed (maintainer needs more info)

Hi,

Token is a requirement of File (Field) Paths in both Drupal 6 and 7, therefore it shouldn't even allow you to run the File (Field) Paths updates without Token enabled. If you could give me some way to attempt to reproduce the issue so I can see it in action I might be able to resolve it.

Cheers,
Deciphered.

Gfuber’s picture

I did this:

update a drupal 6 site (which uses file field paths) to drupal 7
then i copied the new drupal 7 modules like filefieldpaths and token to the website, WITHOUT activating them
i activated filefieldpaths and run update.php
then the error occures

deciphered’s picture

Title: Add message in update.php: activated token module is required » Issue with D6->D7 upgrade path.

Again, as I said, Token is a requirement of File (Field) Paths, so Token would be automatically enabled when you enabled File (Field) Paths... which is why I'm confused.

However I suspect that the issue has nothing to do with Token anyway, I'll try to reproduce the issue shortly and see what I can come up with.

13rac1’s picture

Status: Postponed (maintainer needs more info) » Active

To reproduce:

  1. Upgrade a Drupal site from 6->7 following the UPGRADE.txt directions
  2. Download updates for all contrib modules
  3. Run update.php or drush updb (Don't enable the modules)

Result:

Drush command terminated abnormally due to an unrecoverable error.                                                        [error]
Error: Call to undefined function _filefield_paths_get_field_types() in
/home/user/public_html/sites/all/modules/filefield_paths/filefield_paths.install, line 159
Output from failed command :                                                                                              [error]
 
Fatal error: Call to undefined function _filefield_paths_get_field_types() in
/home/user/public_html/sites/all/modules/filefield_paths/filefield_paths.install on line 159

Temporary workaround is to delete File Field Paths, run update.php for all other new modules, download File Field Paths, and run update.php for File Field Paths.

markwk’s picture

Ran into the same error.

xtfer’s picture

Component: Documentation » Code
Status: Active » Needs review

Drupal will run the upgrades whether the modules are actually enabled or not, so this really needs to be fixed in Filefield Paths.

Adding a drupal_load() to the start of filefield_paths_update_7107() should be sufficient to fix the issue:

/**
 * Removed filefield_paths table/schema.
 */
function filefield_paths_update_7107() {
  drupal_load('module', 'filefield_paths');

  // Remove filefield_paths table/schema.
  ...
KhaledBlah’s picture

I can confirm this error as well. This is a blocker IMO.

denes.szabo’s picture

The code at #6 seems work.

q0rban’s picture

Ran into this myself. As xtfer says, "Drupal will run the upgrades whether the modules are actually enabled or not." Enabling Token didn't fix it for me, but actually enabling Filefield Paths did. Attached patch throws an exception if either modules are disabled.

deciphered’s picture

Status: Needs review » Needs work

I'm inclined to go with a combination of #6 and #9, something that forces the required dependent files to be included and throws an exception if the required files aren't present.

Patches welcome.

deciphered’s picture

Status: Needs work » Fixed

Test and confirmed the error and fix, opted to go with just #6 as it just works, Token module doesn't need to be present for the upgrade so no need to warn if it isn't.

Committed.

xtfer’s picture

Thanks.

Status: Fixed » Closed (fixed)

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

off’s picture

Thank you! Its worked!

Just Need to turn on the module