PHPackages                             dhensby/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. dhensby/silverstripe-copybutton

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

dhensby/silverstripe-copybutton
===============================

Adds copy button to the GridField.

v2.0.0(2y ago)17.7k↓33.3%52BSD-3-ClausePHP

Since Nov 14Pushed 2y ago1 watchersCompare

[ Source](https://github.com/dhensby/silverstripe-copybutton)[ Packagist](https://packagist.org/packages/dhensby/silverstripe-copybutton)[ RSS](/packages/dhensby-silverstripe-copybutton/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (8)Used By (2)

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

[](#silverstripe-copybutton)

Adds copy button to the GridField

Maintainer Contact
------------------

[](#maintainer-contact)

Elvinas Liutkevičius

&lt;elvinas (at) unisolutions (dot) eu&gt;

Requirements
------------

[](#requirements)

SilverStripe 4

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 GridFieldCopyButton(), 'GridFieldEditButton') // or just ->addComponent(new GridFieldCopyButton())
	;

	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

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor2

2 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 ~527 days

Recently: every ~776 days

Total

7

Last Release

1040d ago

Major Versions

v0.8.0 → v1.0.02015-01-14

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

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/563596?v=4)[Daniel Hensby](/maintainers/dhensby)[@dhensby](https://github.com/dhensby)

---

Top Contributors

[![elvinas-liut](https://avatars.githubusercontent.com/u/2812754?v=4)](https://github.com/elvinas-liut "elvinas-liut (15 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)")[![micschk](https://avatars.githubusercontent.com/u/1005986?v=4)](https://github.com/micschk "micschk (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)")[![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/dhensby-silverstripe-copybutton/health.svg)

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

###  Alternatives

[unisolutions/silverstripe-copybutton

Adds copy button to the GridField.

1736.4k](/packages/unisolutions-silverstripe-copybutton)[silverstripe/multi-domain

Allows multiple domains to access one CMS instance, mapping them to different sections of the hierarchy

141.6k](/packages/silverstripe-multi-domain)

PHPackages © 2026

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