Problem/Motivation

Creating or updating a feature module from the UI involves downloading a tarball, decompressing it, and transferring it to the server where it will be used—in the case of updating an existing feature, that means first deleting the old files lest legacy components creep back into the feature. This is highly tedious and error-prone for a process that is apt to be performed repeatedly.

Proposed resolution

Add the ability to save feature modules directly to the file system. (Features Tools currently provides this functionality, but the module is not well-known and is little contributed to compared to Features itself.) It is proposed to implement such "save in place" functionality in a separately-enabled sub-module with its own permissions to ease security risks involved in allowing users to save executable code to the server.

User interface changes

Add a button to the create and update feature forms to save the new module directly on the filesystem and update the existing module, respectively.

Comments

Anonymous’s picture

Title: Function of created featrue module in source installation » Automatic save of feature-module in source installation?
Grayside’s picture

This would need to leverage the installer described in http://drupal.org/documentation/install/modules-themes/modules-7.

Personally, I use the command-line tools to build features. I got started doing that in part to avoid the annoyance of moving around and decompressing tarballs.

traviscarden’s picture

Title: Automatic save of feature-module in source installation? » Add option to save new feature modules directly to file system instead of downloading
Component: User interface » Code

If I interpret your request correctly, you're asking for the ability when creating a new feature module, instead of downloading a tarball, to save it right to the host file system (e.g. in sites/all/modules/features) where it can be immediately installed. I think that's a great idea. It corresponds to #1416890: Add ability to update existing feature modules via UI.

Grayside’s picture

Per #1416890: Add ability to update existing feature modules via UI, there is also a desire for features recreate to update features in place.

I think Features has zero scope for actually handling saving files to the modules directory. That functionality needs to be in a specialized, security-minded module or core enhancement. Once that functionality exists though, an optional dependency could empower this issue.

traviscarden’s picture

Title: Add option to save new feature modules directly to file system instead of downloading » Add option to save feature modules directly to file system instead of downloading

@Grayside, I don't understand what you mean by "Features has zero scope for [this]".

There is a separate module available for this: Features Tools. I think people just don't know about it, by and large. (Hence its install base of 156.) Part of the reason I hoped to see this functionality in Features core is that very reason, that it's such a common need but so few people seem to be aware of a solution. And because it's so little known, it's not as highly scrutinized or thoroughly developed.

Suppose, nevertheless, that it was made an optional dependency. How would that look from a user's perspective? Would you alert them to its absence like Views alerts you if you don't have Advanced Help installed?

Grayside’s picture

I firmly believe that the functionality around putting executable code into the file system needs to be handled by specialized core functionality or a dedicated contrib module.

I firmly hope Features (core) absorbs most of Features Tools, it doesn't do much that *shouldn't* be part of Features. Except the direct saving to the file system.

traviscarden’s picture

@Grayside: By "specialized core functionality" do you mean a sub-module bundled with Features but enabled separately? Because I think that would be a wondeful solution—"Features Save in Place" or something.

Grayside’s picture

@Travis I mean a module or part of core that focuses on saving modules to the file system, and provides API functionality so Features and other modules could leverage it for use.

goron’s picture

perelman.yuval’s picture

I also think the direct save should be part of features module, but i dont think it is right to direct save to production sites.
If the server is setup right the www-data user cannot write to the sites/all/modules dir and that it is good.
The flew to create/update features is to make the change on the dev site and then push the change with git.
So i dont think there is a real security issue, or that somthing bad can happen if features will add the direct save option (if the www-data user can make change to the modules dir we in a danger situation allready)

but the must importent functionlity that features dont have is the unlink of features elements.
I think it should add be the modules, something like a new hook that handle the unlink procecss from the feature file that every module that export data to feature file should add.
I am soory if it is not right to point it on this issue.

mpotter’s picture

Status: Active » Closed (duplicate)

Dup of #1294272: Features Generate to file system where there is a patch I'll be testing. Even though this is in Features Tools, I'd like to add it to core as well.

mpotter’s picture

Issue summary: View changes

Updated issue summary.