Skip to content

Fatal error on PHP 8: CEvent::getRecurrentEventforPeriod() called statically #530

Closed

Description

@MiklosPathy

Summary

Viewing the calendar crashes on PHP 8 as soon as a recurring event is included in the result.

CEvent::getEventsForPeriod() is static and calls self::getRecurrentEventforPeriod(), but that method isn't declared static. PHP 8 treats this as a fatal error.

Environment

  • web2project 5.0.0-rc2, upgraded from 2.3.1 (the code is unchanged in master as of 2026-10-31)
  • PHP 8.3.36, MySQL 8.4.13

Steps to reproduce

  1. Have an event with event_recurs > 0 that the event filter doesn't exclude. We saw this with an empty filter value, which uses the same query branch as the default all.
  2. Open a page that calls CEvent::getEventsForPeriod(). For us this was the first page after login, because our default view is the day view.

Actual result

HTTP 500:

PHP Fatal error: Uncaught Error: Non-static method CEvent::getRecurrentEventforPeriod() cannot be called statically in modules/events/events.class.php:294
#0 includes/cleanup_functions.php(3396): CEvent::getEventsForPeriod(Object(w2p_Utilities_Date), Object(w2p_Utilities_Date), '')

Expected result

The page renders with the recurring events included.

Suggested fix

The method doesn't use $this, so it can be declared static (modules/events/events.class.php, line 124):

public static function getRecurrentEventforPeriod(...)

The calls are at lines 283, 288 and 294. With this one-word change, the day, week and month views returned HTTP 200 with no fatal errors on our copy, including the dates of our
recurring events.

Activity

  1. caseysoftware commented on Nov 2, 2026

    @caseysoftware
    Member

    Thanks for the thorough report, and for the fix suggestion. It’s exactly right.

    This was fixed in 4b4ff99a36edc9a3736c89a1222b2a29acffc4b6 on the dev-5.0.0 branch, a few days before your report: getRecurrentEventforPeriod() is now declared public static, matching your suggested fix. The fix will reach master with the next merge from dev-5.0.0, and it will be included in the next 5.0.0 release candidate.

    Until then, you can either apply the one-word change from your report or cherry-pick 4b4ff99 onto rc2.

    I’ll close this once it lands in master. If you see anything else on PHP 8.3, please open another issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions