Skip to content

Store config: images[].priority is misleading – it behaves like a position, not a priority #1316

Description

@jankal

Summary

In .shopware-extension.yml, the store image field priority sorts images ascending:

Specifies the order of the image ascending the given priority.

(internal/extension/config.go, ConfigStoreImage.Priority, mirrored in config_schema.json)

So the image with the lowest value is shown first in the store gallery. That is the behavior of a position, not a priority.

Why this is confusing

Everywhere else in the Shopware/Symfony ecosystem, "priority" means "higher value wins / runs first":

  • Symfony event listener priorities (higher = earlier)
  • Service decoration priorities
  • Even within this repo: internal/markdown/markdown.go uses "Priority < 1000 makes it win over the default"

A developer reading priority: 1 vs priority: 7 can reasonably assume the image with priority 7 is shown first — and end up with their cover image at the end of the slider. The only hint to the actual behavior is one sentence in the schema description.

Suggestion

Rename the field to position (or order), which matches the ascending semantics and also matches the wording used in the Shopware admin/store context:

store:
    images:
        - file: src/Resources/store/images/en/01-cover.png
          position: 1   # shown first

To stay backwards compatible, priority could be kept as a deprecated alias for a few releases (with a deprecation notice during extension validate / account producer extension info push).

If a rename is not wanted, at minimum the schema description could be made more explicit, e.g.:

Position of the image in the store gallery. Images are sorted ascending — the lowest value is shown first.

Happy to open a PR for either variant if you let me know which direction you prefer.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions