BuzzingPixel

Ansel for Craft

Ansel for EE

Treasury

Construct

Category Construct

Dashboard (open an issue here)

All Issues

My Issues

News Contact
Log in

Logged in as

Licenses Purchases Profile Change Password Billing Portal Admin
Log Out
Software
Ansel for Craft Ansel for EE Treasury Construct Category Construct
Support
Dashboard (open an issue here) All Issues My Issues
News Contact
Log in
Logged in as:
Licenses Purchases Profile Change Password Billing Portal Log Out
Dashboard All Issues My Issues
Support Dashboard
  1. Home
  2. Home
  3. Support Dashboard
  4. View Issue

Depreciation Error When Adding Images

#223 opened by Colt Cox

Subscribe

Details

New

Public Issue

Visibility: Public
2 replies
Last reply by Colt Cox
Created 3/3/2023 8:06 AM
Updated 3/6/2023 8:22 AM
Ansel for ExpressionEngine 2.3.2
CMS Version: 6.4.4
PHP Version: 8.1.9

Description

Our hosting company recently forced an upgrade to PHP 8.1 and now when we upload a new image or choose an existing image a Deprecated error is displayed and "<div class=" is added to the Alt Text field.

Screenshot of error: https://i.postimg.cc/bwnv9jFC/Screenshot-2023-03-03-at-7-59-22-AM.png

Replies

  • ometiclan

    Replied 3/6/2023 3:58 AM, Edited 3/6/2023 4:09 AM

    Can confirm this on EE7 with 2.3.2 and PHP 8.1.

    https://php.watch/versions/8.1/internal-func-non-nullable-null-deprecation

    It's a simple PHP 8.1+ issue that should be easily fixed by passing an empty string instead of null (e.g. via null coalescing operator).

    To quick fix and remove the deprecated warning when uploading images and using title/caption inputs, edit the file user/addons/ansel/View/Field/Row.php on line 104 and 117 and change

    value="<?=htmlentities($row->title)?>" to value="<?=htmlentities($row->title ?? '')?>"

    and

    value="<?=htmlentities($row->caption)?>" to value="<?=htmlentities($row->caption ?? '')?>"

    And replace with updated version of the Add-On once it has been released. :-)

  • Colt Cox

    Replied 3/6/2023 8:22 AM

    Thanks for your reply. This is EE6.4.4 on PHP 8.1. Your fix has corrected the issue and allows us to upload images again. Thanks!

Use Markdown for formatting

Details

New

Public Issue

Visibility: Public
2 replies
Last reply by Colt Cox
Created 3/3/2023 8:06 AM
Updated 3/6/2023 8:22 AM
Ansel for ExpressionEngine 2.3.2
CMS Version: 6.4.4
PHP Version: 8.1.9
Cookie Policy
Privacy Policy
Terms of Service

© 2023 BuzzingPixel, LLC. All rights reserved.