Skip to content
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

pkp/pkp-lib#11087 consider masthead options in the old UserForm #11128

Open
wants to merge 2 commits into
base: stable-3_5_0
Choose a base branch
from

Conversation

bozana
Copy link
Collaborator

@bozana bozana commented Mar 19, 2025

s. #11087

Copy link
Member

@asmecher asmecher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple changes to request!

@bozana bozana force-pushed the 11087-3_5_0 branch 2 times, most recently from aa1b581 to 00911a2 Compare March 20, 2025 10:37
@@ -100,6 +100,11 @@ public function scopeWithMasthead(Builder $query): Builder
return $query->where('user_user_groups.masthead', 1);
}

public function scopeWithMastheadOff(Builder $query): Builder
{
return $query->where('user_user_groups.masthead', 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe too late to change this for 3.5.0, but I think when we introduce enumerations, we should use the same values in the DB that we do in PHP-land. This introduces string constants (null, on, off, all) in PHP, but different numeric constants in the DB (1, 0, presumably other values). It would be better just to use one set of constants, even if they're numeric.

Copy link
Collaborator Author

@bozana bozana Mar 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm... 🤔
These constants are originally meant to be for the user Collector, for filtering there: If one would like to filter by mastheadStatusOff i.e. to get users that are not displayed on the masthead, it would consider both masthead = 0 in the DB table user_groups, as well as masthead = 0 or null in the DB table user_user_groups. Also mastheadStatusAll would get all users no matter what masthead status they have.
But then these constants are also used for user-user-groups functions, but I think this is not necessary.
I can change it, and provide a second commit, and then you can take a look...
Thanks!

@bozana bozana force-pushed the 11087-3_5_0 branch 4 times, most recently from 5a4d688 to c8b6763 Compare March 21, 2025 14:32
@bozana
Copy link
Collaborator Author

bozana commented Mar 21, 2025

Hi @asmecher, I changed the way those enumerations are used, s. second commit. Could you please take a look?
Thanks a lot!

@CLAassistant
Copy link

CLAassistant commented Mar 21, 2025

CLA assistant check
All committers have signed the CLA.

@asmecher
Copy link
Member

@bozana, I think something happened to the PRs -- there are a bunch of conflicts and other code now involved. Can you take a look?

@bozana
Copy link
Collaborator Author

bozana commented Mar 21, 2025

Ah, sorry @asmecher, I pushed the wrong branch... 🙈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants