reason in updated() event
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 25/100
Research direction
Start with the updated(Foo $foo) event and the currentVersion() call shown in the issue. Reproduce the timing that returns the previous version, then trace how the current version and reason are loaded around the update event. Done means the event reliably exposes the current version's reason rather than a cached or previous version.
Written by the indexing model from the issue text.
Description
I am using the reason inside an updated event. It seems like reason is reset before this event is triggered, So I figured I just fetch it from the current version, but for some (likely stupid) reason, I sometimes then get the previous and not the current version. I assume there is some caching going on, so I wonder how I can reliably ensure I get the actual current version and not some cached instance that is no longer valid after the update?
public function updated(Foo $foo)
{
$version = $foo->currentVersion();
$action = $version->reason;
- Dominant language
- PHP
- Stars
- 787
- Forks
- 99
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mpociot/versionable
-
Difficulty 1/5 Under an hour Newbie friendliness 58/100
mpociot/versionable#110 ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
mpociot/versionable#102 · 6 comments · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
mpociot/versionable#101 ·
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 35/100
mpociot/versionable#99 · 3 comments ·
-
Setting the $reason Open
Difficulty 2/5 1-3 hours Newbie friendliness 30/100
mpociot/versionable#96 · 2 comments ·
All issues in mpociot/versionable
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
getgrav/grav-plugin-api#45 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
RSS-Bridge/rss-bridge#5098 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
phingofficial/phing#2025 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
silverstripe/developer-docs#911 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100