Skip to content

Changelog and upgrading

1.0.4

Changes

  • Media is a dependency again. Versions 1.0.1 to 1.0.3 left it out, so enabling the module with Media in one command failed.
  • The field instance on the Image media type is optional configuration, so the module installs on sites without that media type.
  • The ratio is recalculated only for new media, replaced files and empty values, not on every save.
  • The ratio is rounded to the field's two decimal places before it is set, so every database stores the same value.
  • The batch covers every media type with the field, not only image, and works through 50 items per request.
  • The field is deleted when the module is uninstalled.
  • Drupal 12 is supported.
  • The code moved to the aspect_ratio.calculator service, an attribute-based hook class and the AspectRatioBatch class. See Extending.

Upgrading

Run database updates after updating the code:

drush updb

The update aspect_ratio_post_update_enforce_field_dependency makes the field storage depend on the module. After it runs, uninstalling the module deletes the Aspect Ratio field and its values. Export configuration afterwards: the field storage's dependencies gain enforced: module: [aspect_ratio].

Code that calls aspect_ratio_calculate(), aspect_ratio_calculate_and_save() or aspect_ratio_calculate_and_save_by_id() keeps working and triggers a deprecation notice. See Deprecated functions.

1.0.3

  • Fixed an error when creating an image media item (#3553652).

1.0.2

  • Skipped media items whose file no longer exists.

1.0.1

  • Removed the Media dependency. Reverted in the next release.

1.0.0

  • Initial release.