Skip to content

Patch 2 #256

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

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
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
17 changes: 17 additions & 0 deletions .github/workflows/keepalive.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Keepalive

on:
# At 11:55 PM UTC, on day 20 of the month
schedule:
- cron: '55 23 20 * *'
workflow_dispatch:

jobs:
keepalive:
name: Keepalive
# Only run cron on the colymba account
if: (github.event_name == 'schedule' && github.repository_owner == 'colymba') || (github.event_name != 'schedule')
runs-on: ubuntu-latest
steps:
- name: Keepalive
uses: silverstripe/gha-keepalive@v1
17 changes: 17 additions & 0 deletions .github/workflows/merge-up.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Merge-up

on:
# At 11:55 PM UTC, only on Friday
schedule:
- cron: '55 23 * * 5'
workflow_dispatch:

jobs:
merge-up:
name: Merge-up
# Only run cron on the colymba account
if: (github.event_name == 'schedule' && github.repository_owner == 'colymba') || (github.event_name != 'schedule')
runs-on: ubuntu-latest
steps:
- name: Merge-up
uses: silverstripe/gha-merge-up@v1
17 changes: 17 additions & 0 deletions .github/workflows/update-js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Update JS

on:
workflow_dispatch:
# Run on a schedule of once per quarter
schedule:
- cron: '55 23 1 */3 *'

jobs:
update-js:
name: Update JS
# Only run cron on the colymba account
if: (github.event_name == 'schedule' && github.repository_owner == 'colymba') || (github.event_name != 'schedule')
runs-on: ubuntu-latest
steps:
- name: Update JS
uses: silverstripe/gha-update-js@v1
69 changes: 0 additions & 69 deletions .scrutinizer.yml

This file was deleted.

26 changes: 6 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,22 @@
:warning: I haven't been able to give as much love as I would like to these repos as they deserve. If you have time and are interested to help maintain them, give me a shout. :rotating_light:
# GridField Bulk Editing Tools

GridField Bulk Editing Tools
============================
:warning: I haven't been able to give as much love as I would like to these repos as they deserve. If you have time and are interested to help maintain them, give me a shout. :rotating_light:

[![Latest Stable Version](https://poser.pugx.org/colymba/gridfield-bulk-editing-tools/v/stable.svg)](https://github.com/colymba/GridFieldBulkEditingTools/releases)
[![Latest Unstable Version](https://poser.pugx.org/colymba/gridfield-bulk-editing-tools/v/unstable.svg)](https://github.com/colymba/GridFieldBulkEditingTools/tree/master)
[![License](https://poser.pugx.org/colymba/gridfield-bulk-editing-tools/license.svg)](#license-and-copyright)

Set of SilverStripe 4 GridField components to facilitate bulk file upload & record editing.

Set of SilverStripe CMS GridField components to facilitate bulk file upload & record editing.

## Components:
* [Bulk Upload](#bulk-upload): Upload multiple images or files at once into DataObjects
* [Bulk Manager](#bulk-manager): Delete, Unlink, Edit (and more) multiple records at once

## Requirements
* SilverStripe 4.0 (master / 3.+)
* SilverStripe 3.1 (version 2.+ / 1.+)
* Silverstripe 3.0 (version 0.5)

## Installation
`composer require colymba/gridfield-bulk-editing-tools`

## 3.0.0 deprecations
The 3.x versions of this module require SilverStripe 4.x+, and PHP 5.5 or above:

* Namespaces are implemented, and some class names have changed (see `.upgrade.yml` for mapping)

## 2.0.0 deprecations
Major deprections in latest 2.0.0 release:
* The `GridFieldBulkImageUpload` has been renamed to `GridFieldBulkUpload`.
* `onBulkImageUpload` callback has been renamed to `onBulkUpload`
```sh
composer require colymba/gridfield-bulk-editing-tools
```

## Bulk Upload
Upload multiple images or files at once into DataObjects. Perfect for galleries and the like.
Expand Down
7 changes: 3 additions & 4 deletions src/BulkManager/BulkAction/EditHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Colymba\BulkManager\BulkAction\Handler;
use SilverStripe\Control\Controller;
use SilverStripe\Core\Convert;
use SilverStripe\Control\HTTPResponse;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\Form;
Expand Down Expand Up @@ -373,9 +372,9 @@ public function index()
Requirements::add_i18n_javascript('colymba/gridfield-bulk-editing-tools:lang');

if ($this->request->isAjax()) {
$response = new HTTPResponse(
Convert::raw2json(array('Content' => $form->forAjaxTemplate()->getValue()))
);
$response = new HTTPResponse(json_encode([
'Content' => $form->forAjaxTemplate()->getValue()
]));
$response->addHeader('X-Pjax', 'Content');
$response->addHeader('Content-Type', 'text/json');
$response->addHeader('X-Title', 'SilverStripe - Bulk ' . $this->gridField->list->dataClass . ' Editing');
Expand Down
3 changes: 1 addition & 2 deletions src/BulkUploader/BulkUploadHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use SilverStripe\Control\RequestHandler;
use SilverStripe\Control\HTTPRequest;
use SilverStripe\Control\HTTPResponse;
use SilverStripe\Core\Convert;
use SilverStripe\Versioned\RecursivePublishable;

use SilverStripe\AssetAdmin\Controller\AssetAdmin;
Expand Down Expand Up @@ -114,7 +113,7 @@ public function upload(HTTPRequest $request)

if ($uploadResponse->getStatusCode() == 200)
{
$responseData = Convert::json2array($uploadResponse->getBody());
$responseData = json_decode($uploadResponse->getBody(), true);
$responseData = array_shift($responseData);

$record = $this->createDataObject($responseData['id']);
Expand Down