Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

History insertBefore function fix #31

Merged
merged 4 commits into from
May 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions src/SeederHistory/SeederAdmin.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**/

namespace Werkbot\Seeder;
/**/

use SilverStripe\Admin\ModelAdmin;
use SilverStripe\Core\Environment;
use SilverStripe\Forms\GridField\GridFieldButtonRow;
Expand All @@ -14,25 +14,26 @@
use SilverStripe\Forms\GridField\GridFieldSortableHeader;
use SilverStripe\Forms\GridField\GridField_ActionMenu;
use SilverStripe\Forms\HeaderField;
/**/

class SeederAdmin extends ModelAdmin
{
private static $managed_models = [
SeedObject::class => [
'title' => 'Seeder History'
],
];
/**/

private static $url_segment = 'seeder';
private static $menu_title = 'Seeder';
private static $menu_icon_class = 'font-icon-back-in-time';
/**/
public function getEditForm($id = null, $fields = null) {

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

$form->fields()->insertBefore(
HeaderField::create('Remove generated data by deleting the associated seed.'),
$this->sanitiseClassName($this->modelClass)
$this->sanitiseClassName($this->modelClass),
HeaderField::create('Remove generated data by deleting the associated seed.')
);

$gridField = $form->fields()->fieldByName($this->sanitiseClassName($this->modelClass));
Expand All @@ -51,7 +52,7 @@ public function getEditForm($id = null, $fields = null) {

return $form;
}
/**/

public function canView($member = null)
{
$canView = parent::canView($member = null);
Expand Down
Loading