Repository navigation
Expose image dimensions for theme settings - #391
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #273.
Reproduction
Install PrettyBlocks 3.2.6 and register a global theme setting of type
fileuploadwith a local PNG asdefault.url. The back-office field can display its default, but the flat$theme_settingsvalue passed to templates comes from raw storage: before the field is saved it omits the default, and after save it has no measured dimensions. The same file works in a block field.Fix
Use the existing front-office fileupload formatter for flat public theme settings of this type. It resolves local images using the same shop/path guards as blocks and supplies
size,widthandheight. Other field types and the back-office settings payload retain their current behavior. An explicitly cleared image does not restore its default.Validation
53b966012e6a73b2bc47ad23a6efafdd215102c518d91561544f817948196859) was extracted by PrestaShop’s ZIP handler on both shops;prettyblocks/, the Vite manifest and its assets were checked.Scope
This fixes the theme-setting path for images whose dimensions are supported by the existing formatter. It does not introduce SVG dimension parsing, fetch remote images, change write paths, or change the module version.