Skip to content

Bug: BufferItem::Id() causes infinite recursion #1008

@JohnVillalovos

Description

@JohnVillalovos

BufferItem::Id() in lib/Application/Schedule/ReservationListItem.php calls itself recursively, resulting in a stack overflow:

public function Id()
{
    return $this->Id() . 'buffer_' . $this->location;
}

This method calls $this->Id() instead of delegating to the wrapped reservation item. Any code path that calls Id() on a BufferItem will crash with a fatal error.

This appears to have been a latent bug that was masked because BufferItem::Id() is rarely (or never) called in practice.


Suggested Fix

In lib/Application/Schedule/ReservationListItem.php line 382, change:

public function Id()
{
    return $this->Id() . 'buffer_' . $this->location;
}

to:

public function Id()
{
    return $this->reservationItem->Id() . 'buffer_' . $this->location;
}

Metadata

Metadata

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