I use features to start my custom modules and sometimes I create separated files to group some functions as example some_files_functions.inc.php and I include them by include_once(). I notice that when I autocreate feature FDS delete this file.

Comments

perelman.yuval’s picture

Assigned: Unassigned » perelman.yuval

hi @ShadowMonster.
first i'm glad you work with our module, and thank you for the report.
for now the module delete all the files from the feature directory before recreating, because if you remove elements from the feature, like all the views you need to also delete the file.

what we can do is
A. add backup option so you can get your files back.
B. delete only the orginal feature files.
the problem with second solution is that we need to detect somehow whice files was in the orignal feature and whice file was created manually.
we could use somthing like delete all the files only if they start with the feature name.

meanwhile you could put your code in the feature.module and they will not be deleted.

ShadowMonster’s picture

For me is not problem to deal with this problem cause I'm using git so it always is say me with files was deleted and I can easy restore that files.

As you mention and in my opinion also, it will work for my case if FDS will delete only files which names started with module/feature name and rest leave not touched. You could make administration option for it to turn on/off.

I never create manually files started as module name cause drupal or some other modules can scan them and try use. Using totally different name or even put them to separated folders are always more safe.

perelman.yuval’s picture

Category: bug » feature
Priority: Critical » Major
ShadowMonster’s picture

I realize today that some files as ex. my_module.admin.inc also shouldn't be deleted. FDS should probably also have some list of standard files names to do not be deleted where admin can include more of them.

eigentor’s picture

I can confirm this problem.
IMHO the solution to delete only the original feature files makes sense. The features module surely keeps track of what files it generated, all other files present in the directory are not created by features. So it should be easy to detect the files that should not be deleted.