The rule against leaving a place available on its own is enforced twice, and the two enforcements read different pictures of the same row. The policy refuses a place somebody named, under the slot lock, and reads the whole available house: no grade filter, and a place another allotment holds counted as available. A seating strategy weighs the same rule while it chooses, and reads the party's own candidates: the grades one tariff prices, minus every place held away for another allotment. PlaceOrphans reads absence from the row it is handed as the end of a run, so one take is judged in two different rows, and can be accepted by one enforcement and refused by the other.
Measured on one session of a 1400-place hall, in one row of one section, with 213 places on the session held by the resource's allotment and a tariff pricing one grade: the policy sees 16 available places in that row and taking the last of them orphans none, so a place clicked on the plan is accepted. The strategy sees the two places the tariff prices and taking either of them orphans one, so the same take asked for with the quantity stepper is refused.
Neither picture is the right one.
A place held for an allotment is occupied. No booker outside that allotment may have it, so it ends a run exactly as a booking does. Counting it as available lets the policy accept a take that really does strand a place, and it is why a click succeeds where the stepper fails.
A place priced for another grade is not occupied. Another booker may take it at another tariff, so it belongs to the run. Counting it as the end of one invents stretches the hall does not have, and in a hall with an allotment the strategy invents them everywhere: it refuses takes for holes that do not exist, and it also passes over legal seats and seats parties further apart than the hall requires.
One reading, for both: the places in play on the session, which is the hall minus what the session has booked, minus what an allotment holds for anybody else, at every grade. One function answers it, both enforcements call that function, and the strategy keeps its narrower list for deciding what it may GIVE a party rather than for judging what a take leaves behind.
Remaining tasks
- One reader for the places a take is judged against, called by the policy and by the placement provider.
- The judging rows travel on the seating request, so every rung of a strategy weighs the rule in the same row.
- Kernel tests seen to fail first: a place held for an allotment ends a run, a place priced for another grade does not, and both enforcements answer one take the same way.
- A query count test. The reader subtracts in PHP from two reads a request already shares, so the second reading must cost no query at all.
A follow-up will be filed for what this exposes: where the only legal take of an area is its whole remaining run, a booker still has to be able to ask for it. The quantity control has to offer the takeable quantities rather than every quantity up to what is left, and the plan has to hand over the run on one click.
AI-Generated: Yes (analysis, issue text and code by Claude Opus, reviewed and run by the maintainer)
Issue fork yoyaku-3616584
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
mably commentedComment #4
mably commentedComment #6
mably commented