Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix default positioning for thumbnailDefinition in Classic UI #425

Closed
wants to merge 1 commit into from

Conversation

rliebi
Copy link

@rliebi rliebi commented Feb 15, 2024

This commit addresses an issue in the Pimcore Admin UI Classic Bundle related to the thumbnail configuration process. Specifically, it fixes a problem where the positioning parameter of the thumbnailDefinition could be left undefined or empty in the generated YAML file. This situation arises in the frontend component responsible for generating this configuration, leading to potential misconfigurations and unexpected behaviors in thumbnail rendering.

The fix is applied directly to the frontend JavaScript responsible for assembling the thumbnail definition data, at line 676 of public/js/pimcore/settings/thumbnail/item.js. The introduced code snippet ensures that if the positioning data is either undefined or an empty string, it defaults to "center". This guarantees that every thumbnailDefinition has a valid positioning value, thus preventing errors and ensuring consistent rendering behavior across the board.

if (typeof data.positioning == "undefined" || data.positioning == "") {
    data.positioning = "center";
}

This proactive correction streamlines the thumbnail setup process, ensuring that administrators and users benefit from a more reliable and error-free experience when configuring thumbnails in the Pimcore Admin UI. It emphasizes our commitment to quality and user satisfaction by addressing potential issues at their root, enhancing the overall stability and usability of the Pimcore platform.

Copy link

sonarcloud bot commented Feb 15, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@robertSt7
Copy link
Contributor

@rliebi Could you please rebase the PR to 1.4? Thanks

This commit addresses a critical issue in the Pimcore Admin UI Classic Bundle related to the thumbnail configuration process. Specifically, it fixes a problem where the `positioning` parameter of the `thumbnailDefinition` could be left undefined or empty in the generated YAML file. This situation arises in the frontend component responsible for generating this configuration, leading to potential misconfigurations and unexpected behaviors in thumbnail rendering.

The fix is applied directly to the frontend JavaScript responsible for assembling the thumbnail definition data, at line 676 of `public/js/pimcore/settings/thumbnail/item.js`. The introduced code snippet ensures that if the `positioning` data is either undefined or an empty string, it defaults to "center". This guarantees that every thumbnailDefinition has a valid `positioning` value, thus preventing errors and ensuring consistent rendering behavior across the board.

```javascript
if (typeof data.positioning == "undefined" || data.positioning == "") {
    data.positioning = "center";
}
```

This proactive correction streamlines the thumbnail setup process, ensuring that administrators and users benefit from a more reliable and error-free experience when configuring thumbnails in the Pimcore Admin UI. It emphasizes our commitment to quality and user satisfaction by addressing potential issues at their root, enhancing the overall stability and usability of the Pimcore platform.
@rliebi rliebi changed the base branch from 1.x to 1.4 March 22, 2024 12:46
Copy link

sonarcloud bot commented Mar 22, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@robertSt7 robertSt7 self-assigned this Mar 29, 2024
@robertSt7
Copy link
Contributor

Hi @rliebi I found some lines above your code a similar logic. Doesn't this fix your problem?
https://github.com/pimcore/admin-ui-classic-bundle/pull/425/files#diff-636406f32c778b5ad878b3aa4281a6517e500d41b3bd9fe3aaac17c5e3fb0638R674-R676

@rliebi
Copy link
Author

rliebi commented Mar 29, 2024

Interesting, would have to check, maybe I am on an older version and it got fixed in the meantime. Will check next week.

@robertSt7
Copy link
Contributor

@rliebi Are there any news on that?

@rliebi
Copy link
Author

rliebi commented May 17, 2024

It seems as #449 was addressed faster than this.
So this can be closed.

@rliebi rliebi closed this May 17, 2024
@github-actions github-actions bot locked and limited conversation to collaborators May 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants