Skip to content

Deprecated Dynamic Property Access in CleanUrl Module on PHP 8.3.2 and Omeka S 4.0.4 #19

@nakamura196

Description

@nakamura196

Environment

  • PHP Version: 8.3.2
  • Omeka S Version: 4.0.4
  • Clean Url Version: 3.17.7

Issue Description

When running Omeka S with the Clean Url module version 3.17.7 on PHP 8.3.2, the following deprecation warning is logged:

User Deprecated: Creation of dynamic property CleanUrl\Router\Http\CleanRoute::$priority is deprecated in /var/www/html/vendor/laminas/laminas-router/src/SimpleRouteStack.php on line 285

This warning suggests that dynamic property creation is deprecated and potentially harmful for future PHP versions, impacting the module's compatibility and stability.

Steps to Reproduce

  1. Install Omeka S version 4.0.4 with PHP 8.3.2.
  2. Install and activate Clean Url module version 3.17.7.
  3. Access a feature or page that triggers routing processes in the Clean Url module.
  4. Check the PHP error log or Omeka S log for the deprecation warning.

Expected Behavior

The Clean Url module should not rely on deprecated features such as dynamic property creation, ensuring compatibility with current and future PHP versions without generating deprecation warnings.

Actual Behavior

A deprecation warning is logged due to the use of a dynamic property, indicating potential compatibility issues with future PHP versions.

Suggested Solution

A potential solution could be to explicitly declare the $priority property within the CleanRoute class or refactor the code to avoid relying on dynamic properties. This change would help ensure compatibility with PHP 8.3.2 and beyond, addressing the deprecation warning.

class CleanRoute implements RouteInterface {
    protected $priority; // Explicitly declare the property
    // The rest of the class implementation
}

Additional Context

This issue was identified during routine maintenance and testing of Omeka S with the latest PHP version. Addressing it would help maintain the stability and compatibility of the Clean Url module.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions