Compare commits
4 Commits
Author | SHA1 | Date |
---|---|---|
UndefinedOffset | f6ce5741ab | |
UndefinedOffset | b1febae3d8 | |
UndefinedOffset | 9e5908c4ef | |
UndefinedOffset | 09f7be61ae |
2
LICENSE
2
LICENSE
|
@ -1,4 +1,4 @@
|
|||
Copyright (c) 2023, Ed Chipman
|
||||
Copyright (c) 2024, Ed Chipman
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
|
|
|
@ -4,15 +4,14 @@ SortableGridField
|
|||
[![CI](https://github.com/UndefinedOffset/SortableGridField/actions/workflows/ci.yml/badge.svg)](https://github.com/UndefinedOffset/SortableGridField/actions/workflows/ci.yml)
|
||||
[![Latest Stable Version](https://poser.pugx.org/undefinedoffset/sortablegridfield/version.svg)](http://www.silverstripe.org/stable-download/)
|
||||
[![Latest Unstable Version](https://poser.pugx.org/undefinedoffset/sortablegridfield/v/unstable.svg)](https://packagist.org/packages/undefinedoffset/sortablegridfield)
|
||||
[![SilverStripe supported module](https://img.shields.io/badge/silverstripe-supported-0071C4.svg)](https://www.silverstripe.org/software/addons/silverstripe-commercially-supported-module-list/)
|
||||
[![Total Downloads](https://poser.pugx.org/undefinedoffset/sortablegridfield/downloads.svg)](https://packagist.org/packages/undefinedoffset/sortablegridfield)
|
||||
[![License](https://poser.pugx.org/undefinedoffset/sortablegridfield/license.svg)](https://github.com/UndefinedOffset/SortableGridField/blob/master/LICENSE)
|
||||
|
||||
Adds drag and drop functionality to SilverStripe 4's GridField
|
||||
Adds drag and drop functionality to Silverstripe's GridField
|
||||
|
||||
## Requirements
|
||||
|
||||
* SilverStripe 4.11+
|
||||
* Silverstripe 4.11+ or 5.0+
|
||||
|
||||
## Installation
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "undefinedoffset/sortablegridfield",
|
||||
"description": "Adds drag and drop functionality to SilverStripe 4.x's GridField",
|
||||
"description": "Adds drag and drop functionality to Silverstripe's GridField",
|
||||
"type": "silverstripe-vendormodule",
|
||||
"keywords": ["silverstripe", "gridfield", "sortable", "sort"],
|
||||
"license": "BSD-3-Clause",
|
||||
|
|
|
@ -253,6 +253,10 @@ class GridFieldSortableRows extends AbstractGridFieldComponent implements GridFi
|
|||
if ($many_many) {
|
||||
$schema = Injector::inst()->get(DataObjectSchema::class);
|
||||
$componentDetails = $schema->manyManyComponent(get_class($owner), (!empty($this->custom_relation_name) ? $this->custom_relation_name : $gridField->getName()));
|
||||
if (empty($componentDetails)) {
|
||||
user_error('Could not find the relationship "' . (!empty($this->custom_relation_name) ? $this->custom_relation_name : $gridField->getName()) . '" on "' . get_class($owner) . '"', E_USER_ERROR);
|
||||
}
|
||||
|
||||
$parentField = $componentDetails['parentField'];
|
||||
$componentField = $componentDetails['childField'];
|
||||
$table = $componentDetails['join'];
|
||||
|
@ -483,6 +487,10 @@ class GridFieldSortableRows extends AbstractGridFieldComponent implements GridFi
|
|||
if ($many_many) {
|
||||
$schema = Injector::inst()->get(DataObjectSchema::class);
|
||||
$componentDetails = $schema->manyManyComponent(get_class($owner), (!empty($this->custom_relation_name) ? $this->custom_relation_name : $gridField->getName()));
|
||||
if (empty($componentDetails)) {
|
||||
user_error('Could not find the relationship "' . (!empty($this->custom_relation_name) ? $this->custom_relation_name : $gridField->getName()) . '" on "' . get_class($owner) . '"', E_USER_ERROR);
|
||||
}
|
||||
|
||||
$parentField = $componentDetails['parentField'];
|
||||
$componentField = $componentDetails['childField'];
|
||||
$table = $componentDetails['join'];
|
||||
|
|
Loading…
Reference in New Issue