Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Provide a way to duplicate buttons for form edit, something like open atrium does
Comment | File | Size | Author |
---|---|---|---|
#8 | rel-duplication-1309896-8.patch | 518 bytes | altrugon |
Comments
Comment #1
swentel CreditAttribution: swentel commentedhehe, 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 ?
Comment #2
attiks CreditAttribution: attiks commentedI'm happy with any solution, it was just an idea, but great if you can add it ;-)
Comment #3
swentel CreditAttribution: swentel commentedAdded - 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.
Comment #5
altrugon CreditAttribution: altrugon commentedIt 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.
Comment #6
altrugon CreditAttribution: altrugon commentedI'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:
My modification:
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.Comment #7
altrugon CreditAttribution: altrugon commentedComment #8
altrugon CreditAttribution: altrugon commentedSo far nobody has given another solution so here goes my patch.