If the machine-readable name of a feature is too long, the files exported in the tarball have truncated names, which causes the features module to not find the files when loading the feature.
For example, I created a feature based on a content type that had an auto-generated machine-readable name of 'project_business_requirements_questionnaire'. When I loaded the feature to another instance of Drupal, the content type was created, but none of the fields or field groups were in the content type. I discovered that the *.features.content.inc and *.features.fieldgroup.inc in the tarball had been truncated to 'project_business_requirements_questionnaire.features.con' and 'project_business_requirements_questionnaire.features.fie'. When the feature was loaded, the code did not find the files since they were not named according to the naming standard, and the fields and field groups did not load.
To correct this, the interface could limit the length of the machine-readable name, or the files need to be created with the full file name.
Comments
Comment #1
shawn_smiley CreditAttribution: shawn_smiley commentedI can confirm that this also happens in D7 with exporting a custom panel layout template file that I'm including in the feature (path: longmodulename/plugins/layouts/longmodulename_home/longmodulename-home-longmodulename-home.tpl.php).
I've traced the problem to the following code in features.export.inc, line 382 (Drupal 7 dev version):
In particular, the pack() command which appears to limit the length of the first attribute ($name) to 100 characters.
The important thing here is that the $name parameter is the full path from the root of the module to the file. This full path must be at most 100 characters.
I'm not familiar enough with the pack() command to know what the potential implications are of changing the maximum length. I did a quick test of changing it to 128 and it didn't seem to cause any problems.
The updated code that supports paths with up to 128 characters is:
Comment #2
czigor CreditAttribution: czigor commentedThe above hack renders the downloaded tarball corrupt for me.
Comment #3
DanielFird CreditAttribution: DanielFird commentedI have been suffering from accessing, managing and even renaming files that have more than 255 characters over a long time. I have tried various ways but failed. Then I have searched this problem in internet. Then I have found a solution. This software is very easy to use. Named Long path Tool. To use the program all you need to do is to download this program online and save all the settings to your computer. This program is compatible with Windows NT, 2000, XP, Vista and Windows 7. you can find it from longpathtool(dot)com.
Comment #4
Grayside CreditAttribution: Grayside commented255 is also a drupal database limitation, as I recall.
Comment #5
mpotter CreditAttribution: mpotter commentedAs per http://en.wikipedia.org/wiki/Tar_(file_format) the name field in a tar file is limited 100 characters. There are other file formats that get around this, but since we are using tar, we are stuck with this.
Comment #6
lpalgarvio CreditAttribution: lpalgarvio commentedsuggesting a form validation. on form submit? javascript if not i guess...
#1664298: Form validation
Comment #7
lpalgarvio CreditAttribution: lpalgarvio commentedduplicate of #1529066: Features implementation of tar truncates file-paths at 100 characters