Skip to content

Commit

Permalink
Changed column type from varchar to text for historical field values
Browse files Browse the repository at this point in the history
  • Loading branch information
Mosnar committed Nov 17, 2018
1 parent 7876003 commit c7f1c72
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 32 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Bulk Edit Changelog

## 1.0.3 - 2018-11-17
### Fixed
- Potential error from field values that are too long to store in history
### Changed
- Set element saving scenario to SCENARIO_ESSENTIALS
## 1.0.2 - 2018-10-08
### Fixed
- Added scrollbar to modal to allow for larger field layouts
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "venveo/craft-bulkedit",
"description": "Bulk edit entries",
"type": "craft-plugin",
"version": "1.0.2",
"version": "1.0.3",
"keywords": [
"craft",
"cms",
Expand Down
31 changes: 1 addition & 30 deletions src/BulkEdit.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class BulkEdit extends Plugin
*
* @var string
*/
public $schemaVersion = '1.0.0';
public $schemaVersion = '1.0.1';

// Public Methods
// =========================================================================
Expand All @@ -57,40 +57,11 @@ public function init()
parent::init();
self::$plugin = $this;

// Register CP routes
Event::on(UrlManager::class, UrlManager::EVENT_REGISTER_CP_URL_RULES, [$this, 'registerCpUrlRules']);

// Register element action to assets for clearing transforms
Event::on(Entry::class, Element::EVENT_REGISTER_ACTIONS,
function(RegisterElementActionsEvent $event) {
$event->actions[] = BulkEditElementAction::class;
}
);
}

public function registerCpUrlRules(RegisterUrlRulesEvent $event)
{
$rules = [
];

$event->rules = array_merge($event->rules, $rules);
}

/**
* Performs actions before the plugin’s settings are saved.
*
* @return bool Whether the plugin’s settings should be saved.
*/
public function beforeSaveSettings(): bool
{
// TODO: Implement beforeSaveSettings() method.
}

/**
* Performs actions after the plugin’s settings are saved.
*/
public function afterSaveSettings()
{
// TODO: Implement afterSaveSettings() method.
}
}
31 changes: 31 additions & 0 deletions src/migrations/m181117_192854_increase_data_column_size.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

namespace venveo\bulkedit\migrations;

use Craft;
use craft\db\Migration;

/**
* m181117_192854_increase_data_column_size migration.
*/
class m181117_192854_increase_data_column_size extends Migration
{
/**
* @inheritdoc
*/
public function safeUp()
{
// Place migration code here...
$this->alterColumn('{{%bulkedit_history}}', 'originalValue', $this->text());
$this->alterColumn('{{%bulkedit_history}}', 'newValue', $this->text());
}

/**
* @inheritdoc
*/
public function safeDown()
{
echo "m181117_192854_increase_data_column_size cannot be reverted.\n";
return false;
}
}

0 comments on commit c7f1c72

Please sign in to comment.