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

EE Warning re: file dimensions with SVG #4358

Open
ttmwebdesign opened this issue Jun 12, 2024 · 3 comments · May be fixed by #4415
Open

EE Warning re: file dimensions with SVG #4358

ttmwebdesign opened this issue Jun 12, 2024 · 3 comments · May be fixed by #4415

Comments

@ttmwebdesign
Copy link

Description of the problem
EE warnings shown with either debug=1 or 2 on the config.php file, on any page with an SVG that was uploaded into the file manager. One warning per SVG on the page:

Warning
Undefined array key 1
ee/ExpressionEngine/Model/File/FileDimension.php, line 123

Severity: E_WARNING

Looking at the SVG in file manager, I believe this is due to it having its dimensions as 'x px' or nothing is present at all, and not a numerical representation. See screenshots of the two examples.

How To Reproduce
Steps to reproduce the behavior:

  1. Upload SVG.
  2. Load front end page with SVG.
  3. If logged in w/debug running, see warning, one for every SVG on the page uploaded & called by the fields from file manager.

Error Messages


Warning
Undefined array key 1
ee/ExpressionEngine/Model/File/FileDimension.php, line 123

Severity: E_WARNING

This is the extent of the warnings, even with debug=2 on config.php and debug=1 on index.php.

Screenshots / Videos / Template Code

Screenshot-1 Screenshot-2

Environment Details:

  • Version: 7.4.6
  • PHP Version 8.1 (both local/staging)
  • MariaDB Version 10.4.32 (local) // MySQL 8.x (staging)
  • OS: macOS (local) // Ubuntu 22.04 (staging)
  • Web Server: nginx (both)

Possible Solution
Since it only appears with debug on, it will of course be set to 0 for the client but it would be great to make it go away on local builds and staging when it's set to debug other than 0.

Additional context
n/a

Thanks!

@dougblackjr
Copy link
Contributor

Can also confirm this is happening.

@intoeetive
Copy link
Contributor

@ttmwebdesign @dougblackjr I wasn't able to replicate the issue, but the referenced PR should fix it. Perhaps you could check it out and add your approval if it works well

@dougblackjr
Copy link
Contributor

@intoeetive Commented on the PR! Really, really good to hear from you Yuri!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants