-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[VUFIND-1674] Show count of saved items in account menu #3836
base: dev
Are you sure you want to change the base?
Conversation
public function handleRequest(Params $params) | ||
{ | ||
$this->disableSessionWrites(); // avoid session write timing bug | ||
$count = $this->user ? count($this->resourceService->getFavorites($this->user)) : 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth creating a new resourceService method that just returns a count to reduce the amount of data pushed around, or is it better to keep this simple and trust the caching?
@@ -107,3 +107,7 @@ | |||
<?=$this->recommend($current)?> | |||
<?php endforeach; ?> | |||
</div> | |||
|
|||
<?php if (!isset($list)): ?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now, the cache only gets invalidated when you go to the favorites page. Maybe it would be better to always invalidate the cache on all list pages, so that list actions cause the favorites total to get recalculated. However, this would make a lot of unnecessary requests or would require the addition of some additional logic to figure out when invalidation is really needed.
This needs more time to mature, so I am moving it to the 11.0 milestone. |
This is an initial proof of concept.
TODO