View Issue Details

IDProjectCategoryView StatusLast Update
0034106mantisbtcode cleanuppublic2024-05-12 12:34
Reporterdregad Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Target Version2.26.2Fixed in Version2.26.2 
Summary0034106: Deprecated creation of dynamic properties in BugData class
Description

Roadmap and Changelog pages throw deprecation warnings on PHP 8.2:

Creation of dynamic property BugData::$source_bug_id is deprecated' in '.../core/bug_api.php' line 380
Creation of dynamic property BugData::$parent_version is deprecated' in '.../core/bug_api.php' line 380

This happens when calling BugData::loadrow() with a row from a query containing extra columns (in this case, relationship information).

The same error was reported with a different, unknown context, see 0034436:0068913
Creation of dynamic property BugData::$due_date_sort_null is deprecated' in '..\mantis\core\bug_api.php' line 380

BugData::__set() should ignore unknown columns.

TagsPHP 8.2

Relationships

related to 0034436 acknowledged Refactor bug_relationship_api.php to stop relying on dynamic properties in BugData class 
related to 0032612 closeddregad DEPRECATED: 'Creation of dynamic property BugData::$bug_text_id 

Activities

dregad

dregad

2024-03-15 20:14

developer   ~0068667

PR https://github.com/mantisbt/mantisbt/pull/1978

dregad

dregad

2024-05-06 19:12

developer   ~0068911

MantisBT master-2.26 1cd25800 introduced a regression in the Bug Dependency graph, see attached screenshot.

image.png (109,007 bytes)   
image.png (109,007 bytes)   
dregad

dregad

2024-05-06 19:43

developer   ~0068912

To fix the regression AND the deprecation warning, we have 2 options:

  1. Easy solution: revert MantisBT master-2.26 1cd25800 and allow dynamic properties in the BugData class
  2. Refactor Bug Dependency Graph generation (in relationship_graph_api.php) to work without adding the parents, children and is_descendant custom properties.

We'll go for option 1 for now, follow-up in 0034436 for the cleaner option 2.

Related Changesets

MantisBT: master-2.26 1cd25800

2024-03-15 20:12

dregad


Details Diff
Ignore unknown properties in BugData::__set()

Avoids PHP 8.2 "Creation of dynamic property" deprecation warnings
in Roadmap and Changelog pages.

Fixes 0034106
Affected Issues
0034106
mod - core/bug_api.php Diff File

MantisBT: master-2.26 851527a2

2024-05-06 19:08

dregad


Details Diff
Revert "Ignore unknown properties in BugData::__set()"

This reverts commit 1cd258007d52f5cda5014049e2d729165102e5ee, which
introduced a regression when displaying Bug Dependency graph.

Issue 0034106
Affected Issues
0034106
mod - core/bug_api.php Diff File

MantisBT: master-2.26 5442e838

2024-05-06 19:10

dregad


Details Diff
Set AllowDynamicProperties for BugData class

Fixes 0034106
Affected Issues
0034106
mod - core/bug_api.php Diff File