PHPackages                             restruct/silverstripe-copybutton - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. restruct/silverstripe-copybutton

ActiveSilverstripe-vendormodule[Utility &amp; Helpers](/categories/utility)

restruct/silverstripe-copybutton
================================

Adds copy/duplicate button to the GridField.

2.0.1(8mo ago)02.6k↓21.3%1BSD-3-ClausePHP

Since Nov 14Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/restruct/silverstripe-copybutton)[ Packagist](https://packagist.org/packages/restruct/silverstripe-copybutton)[ RSS](/packages/restruct-silverstripe-copybutton/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (1)Versions (9)Used By (0)

silverstripe-copybutton
=======================

[](#silverstripe-copybutton)

Adds a copy/duplicate button to GridFields

Original author
---------------

[](#original-author)

Elvinas Liutkevičius &lt;elvinas (at) unisolutions (dot) eu&gt; (Forked from dhensby's SS4-updated fork for quick maintenance &amp; updates/tags)

Documentation
-------------

[](#documentation)

Simply install the module using the standard method.

To add the button to the GridField you need to extend ModelAdmin and override getEditForm() method like this:

```
function getEditForm($id = null, $fields = null) {
	$form = parent::getEditForm();

	$form
		->Fields()
		->fieldByName($this->sanitiseClassName($this->modelClass))
		->getConfig()
		->addComponent(new CopyButton(), 'GridFieldEditButton') // or just ->addComponent(new CopyButton())
	;

	return $form;
}

```

This action will make exact copy of the record (with all relations and etc.). Note: you have to set configs for cascading duplications in your DataObjects to duplicate relations See: [https://docs.silverstripe.org/en/4/developer\_guides/model/relations/#cascading-duplications](https://docs.silverstripe.org/en/4/developer_guides/model/relations/#cascading-duplications)

Sometimes you will need to do some actions just after copy operation (i.e. you'll need to remove some relations). It is easily achieved by extending DataObject and writing all the actions in the onAfterDuplicate() method.

```
class SomeObjectExtension extends DataExtension {

	public function onAfterDuplicate() {
		DB::query("delete from Member_SomeObject where SomeObjectID = ".$this->owner->ID);
	}

}

```

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance60

Regular maintenance activity

Popularity22

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor3

3 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~571 days

Recently: every ~696 days

Total

8

Last Release

253d ago

Major Versions

v0.8.0 → v1.0.02015-01-14

1.x-dev → 2.0.0-alpha.12018-03-09

### Community

Maintainers

![](https://www.gravatar.com/avatar/4d3680d6353e5f171543435b89965ba2588186ad7ec0ec97cbf572704fec2a4f?d=identicon)[micschk](/maintainers/micschk)

---

Top Contributors

[![elvinas-liut](https://avatars.githubusercontent.com/u/2812754?v=4)](https://github.com/elvinas-liut "elvinas-liut (15 commits)")[![micschk](https://avatars.githubusercontent.com/u/1005986?v=4)](https://github.com/micschk "micschk (10 commits)")[![dhensby](https://avatars.githubusercontent.com/u/563596?v=4)](https://github.com/dhensby "dhensby (9 commits)")[![uniun](https://avatars.githubusercontent.com/u/92462659?v=4)](https://github.com/uniun "uniun (7 commits)")[![ivoba](https://avatars.githubusercontent.com/u/471254?v=4)](https://github.com/ivoba "ivoba (4 commits)")[![yusuf](https://avatars.githubusercontent.com/u/90121?v=4)](https://github.com/yusuf "yusuf (2 commits)")[![sheadawson](https://avatars.githubusercontent.com/u/1166136?v=4)](https://github.com/sheadawson "sheadawson (2 commits)")[![purplespider](https://avatars.githubusercontent.com/u/329880?v=4)](https://github.com/purplespider "purplespider (1 commits)")[![hubertusanton](https://avatars.githubusercontent.com/u/582188?v=4)](https://github.com/hubertusanton "hubertusanton (1 commits)")[![adiwidjaja](https://avatars.githubusercontent.com/u/280394?v=4)](https://github.com/adiwidjaja "adiwidjaja (1 commits)")[![Taitava](https://avatars.githubusercontent.com/u/13002142?v=4)](https://github.com/Taitava "Taitava (1 commits)")[![thomasbnielsen](https://avatars.githubusercontent.com/u/2331955?v=4)](https://github.com/thomasbnielsen "thomasbnielsen (1 commits)")

---

Tags

silverstripecopybutton

### Embed Badge

![Health badge](/badges/restruct-silverstripe-copybutton/health.svg)

```
[![Health](https://phpackages.com/badges/restruct-silverstripe-copybutton/health.svg)](https://phpackages.com/packages/restruct-silverstripe-copybutton)
```

###  Alternatives

[silverstripe/userforms

UserForms enables CMS users to create dynamic forms via a drag and drop interface and without getting involved in any PHP code

1371.1M85](/packages/silverstripe-userforms)[symbiote/silverstripe-gridfieldextensions

A collection of useful grid field components

951.9M271](/packages/symbiote-silverstripe-gridfieldextensions)[symbiote/silverstripe-advancedworkflow

Adds configurable workflow support to the CMS, with a GUI for creating custom workflow definitions.

46302.4k9](/packages/symbiote-silverstripe-advancedworkflow)[unisolutions/silverstripe-copybutton

Adds copy button to the GridField.

1736.5k](/packages/unisolutions-silverstripe-copybutton)[silverstripe/tagfield

Tag field for SilverStripe

561.3M50](/packages/silverstripe-tagfield)[jonom/silverstripe-betternavigator

Front-end utility menu for Silverstripe websites featuring administration and development tools

60435.1k13](/packages/jonom-silverstripe-betternavigator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
