3 namespace Drupal\image\Plugin\migrate\process\d6;
5 use Drupal\migrate\MigrateExecutableInterface;
6 use Drupal\migrate\ProcessPluginBase;
7 use Drupal\migrate\Row;
10 * @MigrateProcessPlugin(
11 * id = "d6_imagecache_actions"
14 class ImageCacheActions extends ProcessPluginBase {
19 public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
22 foreach ($row->getSourceProperty('actions') as $action) {
23 $id = preg_replace('/^imagecache/', 'image', $action['action']);
25 if ($id === 'image_crop') {
26 $action['data']['anchor'] = $action['data']['xoffset'] . '-' . $action['data']['yoffset'];
28 if (!preg_match('/^[a-z]*\-[a-z]*/', $action['data']['anchor'])) {
29 $migrate_executable->message->display(
30 'The Drupal 8 image crop effect does not support numeric values for x and y offsets. Use keywords to set crop effect offsets instead.',
35 unset($action['data']['xoffset']);
36 unset($action['data']['yoffset']);
41 'weight' => $action['weight'],
42 'data' => $action['data'],