Project:File (Field) Paths
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Hi,

I think it would be nice to allow the user to finetune the Retroactive option :
I would like to move more than 5000 files to a proper destination, using the Retroactive function.
However, the PHP function (filefield_paths_retroactive) times out (300 seconds) or causes memory errors (1800 seconds timeout, 96Mb limit).
I can rerun the function as many times as I want, it won't go past a certain node count.

So I think there should be an option to pass a node ID (nid) range to the function.
What do you think of that ?

For example, one could run the Retroactive function only for the nodes 0 to 250, and so on.

Comments

#1

Category:feature request» bug report

Hi,

I'm actually surprised that it took this long before I got this issue. I was always worried that this would be the case with a large number of nodes, hence the warning for use.

I do have a few ideas on improving the functionality, and will start looking into them ASAP.
The biggest issue is testing the functionality, it will require a fair amount of time to setup a couple thousand nodes all with attached files.

Will keep you posted.

Cheers,
Deciphered.

#2

Category:bug report» feature request

Hi,

Thanks for your answer.

Actually I managed to move all my images :
In the module file, at line 271, I changed the query line to look like this :
$result = db_query("SELECT nid FROM {node} WHERE type = '%s' AND nid>1500 AND nid<2000", $form_state['values']['retroactive_type']);

I'm just thinking of some way to do it properly (even though I'm not a Drupal developer, alas), maybe it's a good idea, who knows :
1. Add a hook or something, to call the function everytime a cron is run.
2. The function uses a counter, stored in the settings table, to know what nid is the starting point.
3. And let the user choose how many node he wants to fix each time cron is run.

#3

Category:feature request» bug report

Hi again,

My idea is to implement a proper batch process, similar to the update.php batch, which should allow for all files to be done at the same time without timing out.

Marked this back to bug report.

Cheers,
Deciphered.

#4

Status:active» fixed

Batch process has been implemented and committed to DRUPAL-6--1.
Hasn't been tested with 1000s of nodes yet, but the concept is sound and should work. Will confirm later on my other test environment.

Patch available at: http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/filefield_p...

Drupal 5 version has not got the batch process as it wasn't introduce into the Drupal API until Drupal 6.
Current process has been improved and may possibly get an alternative batch system implemented at a later date.

Cheers,
Deciphered.

#5

Status:fixed» closed (fixed)

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

nobody click here