-
Notifications
You must be signed in to change notification settings - Fork 446
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
[OMP] Only one featured monograph is displayed #6088
Comments
Thanks @alexdryden. This sounds like maybe a bug. Are you able to look into it further? It's probably going to be an issue with where the featured items are saved. I think that's an op like |
@NateWr I looked into it a little bit last week. I'm still not super familiar with the architecture, so this may not be the best solution, but it seemed like the best place to patch this would be in the The function is asking for the That solution doesn't break the |
Yeah that looks like it would work, but we try to keep that kind of business logic out of the DAOs. Ideally they should just be for reading and writing data, and the logic which determines what the data looks like should be handled elsewhere. It looks like the problem is in I think there are two options here:
|
Yeah, something like option 2 was where I was heading. I'll check out option 1 first, if for no other reason then to help familiarize myself with more of the code base, and then fall back to option 2 if it seems like more work than I can fit in this week. |
Just adding a +1 here. This bug was recently reported from a hosted OMP install running 3.2.1-1 |
I was working on this right around when my partner got covid and it totally fell off my radar. I can submit a pull request when I'm back in the office next week for option 2 listed above, which is I think what I implemented for us. |
This problem still happens. It's not my intention to propose a proper fix but I think I found the culprit:
When the featured checkbox is ticked, it will add a new entry to features table with default sequence value as 1. I think the proper fix should be calculating sequence value based on the last stored value upon creating it. |
Good hunting, @duozhasht! We've proposed a couple of possible approaches to getting the correct value stored in this comment. I think the second approach is probably the better. We're open to a PR from the community on this, or we'll try to get to it as part of our next major release cycle. |
A similar problem is occurring when saving the features order, limiting the number of featured monographs to 30. This occurs because only items present on the current page of the "Oder Features" tab are saved. Mysql query before save order: SELECT COUNT(*) FROM features;
+----------+
| COUNT(*) |
+----------+
| 50 |
+----------+
1 row in set (0,00 sec)
mysql query after save order: SELECT COUNT(*) FROM features;
+----------+
| COUNT(*) |
+----------+
| 30 |
+----------+
1 row in set (0,00 sec) We have created an issue about this: #7648 |
PRs:
@bozana are you available to review this? I followed a similar approach to what is used for I also fixed a small CSRF issue I encountered (related to migration work done in #9566). I targeted this against main due to the issue's milestone, but can back-port once approved. |
pkp/pkp-lib#6088 set sequence for featured monographs
All well and merged to mein @kaitlinnewson. Thanks a lot! |
@bozana Backported and the new PRs are listed above. |
pkp/pkp-lib#6088 set sequence for featured monographs
pkp/pkp-lib#6088 set sequence for featured monographs
Thanks @kaitlinnewson! |
Version: OMP3.2.0-3
Issue: Featured monographs share the same order index (1) by default unless they are explicitly reordered by the user. As a result only one featured monograph is displayed.
Steps to reproduce:
Here is a diff result for the dbdump before and after explicitly ordering. First one (
<
) is before, second one (>
) is after. The last value for each entry is the the order index,seq
.The text was updated successfully, but these errors were encountered: