Skip to content

LogRecord::contextIsEmpty() returns true when the context is not empty #84

Closed

Description

@njoubert-cleverage

Description

LogRecord::contextIsEmpty() returns true when the context is not empty ([] !== $this->context). The "Has context info ?" column of the logs CRUD, which uses it, is displayed correctly, but the method name says the opposite.

Tested on main (9032210, v3.0.1) in process-bundle-demo, PHP 8.5, Symfony 7.4, EasyAdmin 5.

Proposed fix

Add LogRecord::hasContext(), use it in LogRecordCrudController, and deprecate contextIsEmpty() (kept as is, for compatibility).

Requirements

  • Documentation updates
    • Reference
    • Changelog
  • Unit tests

Breaking changes

None: contextIsEmpty() is deprecated, its behaviour is unchanged.

Activity

  1. added 2 commits that reference this issue on Oct 2, 2026
  2. njoubert-cleverage commented on Oct 2, 2026

    @njoubert-cleverage
    MemberAuthor

    Regression of the merged fix: hasContext() is used by the PropertyAccessor to read the context property (empty context on the log detail page). Fixed by renaming it hasContextInfo(), see the linked PR.

  3. added a commit that references this issue on Oct 2, 2026
    949a763
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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions