shopsys icon indicating copy to clipboard operation
shopsys copied to clipboard

Confusing and error-prone access to sizes in ImageEntityConfig

Open PetrHeinz opened this issue 6 years ago • 4 comments

What is happening

The usage of methods getSizeConfig(), getSizeConfigs(), getSizeConfigByType() and getSizeConfigsByType() in ImageEntityConfig is confusing and error prone.

The methods without ByType suffix get only image sizes for the default (null) type with is not obvious in code. To make things worse, getSizeConfigsByType does not work when null is provided even though getSizeConfigByType(null) works as intended.

This leads to issues such as the one fixed in #1094.

Expected result

There is only one of methods ImageEntityConfig::getSizeConfig() and ImageEntityConfig::getSizeConfigByType() which accepts string|null $type parameter.

There is only one of methods ImageEntityConfig::getSizeConfigs() and ImageEntityConfig::getSizeConfigsByType() which accepts string|null $type parameter.

(or one of them is deprecated and the deprecated method is not called from within Shopsys Framework)

PetrHeinz avatar May 30 '19 09:05 PetrHeinz

This issue has been automatically marked as stale because there was no activity within the last 4 months (and it is quite a long time). It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 07 '20 08:01 stale[bot]

This issue has been automatically marked as stale because there was no activity within the last 4 months (and it is quite a long time). It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 06 '20 21:05 stale[bot]

This issue has been automatically marked as stale because there was no activity within the last 4 months (and it is quite a long time). It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 05 '20 19:09 stale[bot]

This issue has been automatically closed because there was no acivity within the last half a year.

stale[bot] avatar Nov 08 '20 02:11 stale[bot]

Image sizes were completely removed from the backend in https://github.com/shopsys/shopsys/pull/2924 so none of the methods is there anymore :slightly_smiling_face:

vitek-rostislav avatar Feb 07 '24 22:02 vitek-rostislav