Provide a way to duplicate buttons for form edit, something like open atrium does

CommentFileSizeAuthor
#8 rel-duplication-1309896-8.patch518 bytesaltrugon
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

swentel’s picture

hehe, I knew that one was coming :)

So the initial idea I have right now is a fieldset/vertical tab at the bottom of Fields UI, where you can simply select an existing one from a select list and simply duplicate the selected. Removing will be handled in that fieldset as well as at this point adding 'remove' links on the row itself would be too much overhead for something that won't happen *that* a lot ? Can live with that option ?

attiks’s picture

I'm happy with any solution, it was just an idea, but great if you can add it ;-)

swentel’s picture

Status: Active » Fixed

Added - note, the schema has changed (new column, either reinstall or add the 'duplicte' column to your existing database - needs clear cache as well because the cache is stored differently as well.

Status: Fixed » Closed (fixed)

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

altrugon’s picture

Version: 7.x-1.x-dev » 7.x-1.0-alpha1

It is not working for me with 7.x-1.0-alpha1 version.

I'm selecting the "Save" field and then submitting the form by clicking "Save" but nothing happen.

Here is a screen-shot just in case.

altrugon’s picture

I've been doing some debugging an found a solution by modifying function rel_duplicate_buttons_submit($form, &$form_state) line #424 on rel.module file:

Original:

    // Save the record.
    drupal_write_record('rel_builds', $rel_build, array('build_id'));

My modification:

    // Save the record.
    drupal_write_record('rel_builds', $rel_build);

According to drupal_write_record($table, &$record, $primary_keys = array()) documentation, $primary_keys argument must be not specified if you are adding a new record.

altrugon’s picture

Category: feature » bug
altrugon’s picture

So far nobody has given another solution so here goes my patch.