yiisoft / yiisoft/active-record

AR::refresh() takes default condition into account

Open
#13 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status:under discussion type:bug
Dominant language
PHP
Stars
119
Forks
38
Avg merge
1h 11m
Merged PRs (30d)
1

Description

Not sure if it should be like this but if find() is overridden with a default condition, this will affect refresh() so that it will return false even if the row exists, but just does not match the condition anymore. I would expect refresh() to refresh the record regardless of any default condition.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the AR::refresh() entry point and the overridden find() behavior described in the issue. Reproduce a refresh after the row stops matching the default condition; done means refresh succeeds when the row exists regardless of that condition.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.