Problem/Motivation

#2807785: Move global constants from *.module files into interfaces deprecated a bunch of constants but it did not actually replace their usage. We should do this. This issue handles RESPONSIVE_IMAGE_EMPTY_IMAGE and RESPONSIVE_IMAGE_ORIGINAL_IMAGE. This is a bug because we've deprecated something but we've not completed the task.

Proposed resolution

Use ResponsiveImageStyleInterface::EMPTY_IMAGE and ResponsiveImageStyleInterface::ORIGINAL_IMAGE instead.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Status: Active » Needs review
FileSize
7.29 KB

So after applying the patch the only instances found are the expected ones.

grep -R RESPONSIVE_IMAGE_ ./core                                                                          389ms  Fri 23 Nov 09:59:35 2018
./core/modules/responsive_image/tests/src/Functional/ViewsIntegrationTest.php:  const RESPONSIVE_IMAGE_STYLE_ID = 'responsive_image_style_id';
./core/modules/responsive_image/tests/src/Functional/ViewsIntegrationTest.php:      'id' => self::RESPONSIVE_IMAGE_STYLE_ID,
./core/modules/responsive_image/tests/src/Functional/ViewsIntegrationTest.php:    $this->drupalPostForm(NULL, ['options[settings][responsive_image_style]' => self::RESPONSIVE_IMAGE_STYLE_ID], 'Apply');
./core/modules/responsive_image/tests/src/Functional/ViewsIntegrationTest.php:      ->fieldValueEquals('options[settings][responsive_image_style]', self::RESPONSIVE_IMAGE_STYLE_ID);
./core/modules/responsive_image/responsive_image.module:const RESPONSIVE_IMAGE_EMPTY_IMAGE = ResponsiveImageStyleInterface::EMPTY_IMAGE;
./core/modules/responsive_image/responsive_image.module:const RESPONSIVE_IMAGE_ORIGINAL_IMAGE = ResponsiveImageStyleInterface::ORIGINAL_IMAGE;
alexpott’s picture

Argghhh... we load the module before updating the classloader so we can't use the interface constant in the main section of the .module file.

voleger’s picture

Status: Needs review » Reviewed & tested by the community

All constant calls replaced. +1 for RTBC

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed d7497b0 and pushed to 8.7.x. Thanks!

  • catch committed d7497b0 on 8.7.x
    Issue #3015708 by alexpott: Properly deprecate RESPONSIVE_IMAGE_*...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.