Error if mapping name is undefined at the time __get is called

Created on 4 September 2023, about 1 year ago
Updated 13 March 2024, 8 months ago

Found a bug where an error is generated if the picture mapping name is undefined for a new mapping. Will throw an error to the screen for the __get($name) function in PictureMapping.php.

See the attached patch that returns empty if the value is not set at the time __get is called.

πŸ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States ron_s

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Open on Drupal.org β†’
    Core: 7.x + Environment: PHP 5.3 & MySQL 5.5
    last update about 1 year ago
    Waiting for branch to pass
  • Issue created by @ron_s
  • πŸ‡©πŸ‡ͺGermany 4kant

    Had these errors after updating to PHP 8.2:

    Deprecated function: Creation of dynamic property PictureMapping::$id is deprecated in PictureMapping->__set() (line 377 of /sites/all/modules/picture/includes/PictureMapping.php).
    Deprecated function: Creation of dynamic property PictureMapping::$table is deprecated in PictureMapping->__set() (line 377 of /sites/all/modules/picture/includes/PictureMapping.php).
    Deprecated function: Creation of dynamic property PictureMapping::$type is deprecated in PictureMapping->__set() (line 377 of /sites/all/modules/picture/includes/PictureMapping.php).
    Deprecated function: Creation of dynamic property PictureMapping::$export_type is deprecated in PictureMapping->__set() (line 377 of /sites/all/modules/picture/includes/PictureMapping.php).

    Pasted your lines there (too) and the errors were gone.

    Thanks

Production build 0.71.5 2024