Apologies, maybe this is just me, but I'm still seeing the update messages after a crop has been changed, despite the fact I disabled them in the admin menu.
I can confirm this is entered into the module config correctly:
settings:
[...]
notify_apply: false
notify_update: false
Yet, I'm getting notification the message: The crop My Crop Type were successfully updated for image My File.
I had a quick look at the code. Is it possible somebody forgot to check the settings variable prior to printing the message?
In function updateCrop
in file src/ImageWidgetCropManager.php
:
/** @var \Drupal\crop\Entity\Crop $crop */
foreach ($crops as $crop) {
if (!$this->cropHasChanged($crop_properties, array_merge($crop->position(), $crop->size()))) {
return;
}
$this->updateCropProperties($crop, $crop_properties);
$this->messenger()->addMessage($this->t('The crop "@cropType" were successfully updated for image "@filename".', ['@cropType' => $crop_type->label(), '@filename' => $this->fileStorage->load($field_value['file-id'])->getFilename()]));
}
Is this intentional or am I missing something?
And while we're at it... is it correct that the if statement above on line 121 should return;
rather than continue;
? It looks to me as if some crops might not get saved in case the previous one has not been changed.