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

Feature/dev 70 multiple entry authors #12380

Merged
merged 48 commits into from
Jan 2, 2024
Merged
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
b77928f
WIP - adding authors on top of author (for now)
i-just Nov 2, 2022
f2cb202
prep for removing single author bits
i-just Nov 3, 2022
318c6ad
migration moves content and drops old column
i-just Nov 4, 2022
2513237
entry query and element adjustments (WIP)
i-just Nov 4, 2022
9ae85ae
max authors config added to sections
i-just Nov 7, 2022
d3b4dfb
cascade delete author to entry
i-just Nov 7, 2022
83932ac
cleanup
i-just Nov 7, 2022
63724c1
eager loading map update
i-just Nov 7, 2022
30a8bab
cleanup
i-just Nov 8, 2022
2777c9b
Merge branch 'develop' into feature/dev-70-multiple-entry-authors
i-just Nov 21, 2022
110b38e
WIP in authorsIds() method
i-just Nov 22, 2022
7934fef
Merge branch 'develop' into feature/dev-70-multiple-entry-authors
i-just Nov 22, 2022
4bc4e82
update process authors
i-just Nov 22, 2022
10a3e16
tweaks to EntryQuery, Entry and GQL
i-just Nov 22, 2022
5634fd3
migrate authors amend for psql
i-just Nov 22, 2022
17f2a8a
Merge branch '5.0' into feature/dev-70-multiple-entry-authors
i-just Nov 22, 2022
fdef2fb
update to permissions checks
i-just Nov 22, 2022
1da33d2
adjusted comments + bug fix
i-just Nov 28, 2022
fc16e34
clean up
i-just Dec 12, 2022
9fdb68e
tests for multiple entry authors
i-just Dec 12, 2022
9893e86
clean up
i-just Dec 12, 2022
12455af
ecs
i-just Dec 12, 2022
ef43d3e
Merge branch '5.0' into feature/dev-70-multiple-entry-authors
i-just Oct 18, 2023
05f3af9
adjust after sections service logic moved to entries
i-just Oct 18, 2023
5e66412
v5 compatibility
i-just Oct 18, 2023
c46af51
bug fixes
i-just Oct 18, 2023
bbc3aa5
tweak
i-just Oct 18, 2023
9d69df9
Merge branch '5.0' into feature/dev-70-multiple-entry-authors
brandonkelly Dec 29, 2023
40ca339
Bump the schema version
brandonkelly Dec 30, 2023
ca481c1
Merge branch '5.0' into feature/dev-70-multiple-entry-authors
brandonkelly Dec 31, 2023
423e3fc
Changed some code
brandonkelly Dec 31, 2023
03798ff
Merge branch '5.0' into feature/dev-70-multiple-entry-authors
brandonkelly Jan 1, 2024
5d43de2
Batch-insert entry author rows for entrify commands
brandonkelly Jan 1, 2024
60fb6ac
Don't drop support for `authorId`/`author` params
brandonkelly Jan 1, 2024
5981333
authorId → authorIds in the changedattributes table
brandonkelly Jan 1, 2024
69d5117
Missing `@since`
brandonkelly Jan 1, 2024
da9a95d
Move authorIds rule definitions
brandonkelly Jan 1, 2024
b2d71b9
Update translations
brandonkelly Jan 1, 2024
3db2c83
Merge branch '5.0' into feature/dev-70-multiple-entry-authors
brandonkelly Jan 1, 2024
f428a4f
Be strict like canView() etc
brandonkelly Jan 1, 2024
78dc36c
Maybe a little safer
brandonkelly Jan 1, 2024
b6fd4de
No need to prenormalize anymore
brandonkelly Jan 1, 2024
80d8a7e
More cleanup
brandonkelly Jan 1, 2024
b5f0270
Release notes
brandonkelly Jan 1, 2024
2e5cb4a
Cleanup
brandonkelly Jan 2, 2024
ab35f55
Fix some tests
brandonkelly Jan 2, 2024
f956d00
.
brandonkelly Jan 2, 2024
e1d7a09
Fixed test
brandonkelly Jan 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
adjusted comments + bug fix
  • Loading branch information
i-just committed Nov 28, 2022

Unverified

This user has not yet uploaded their public signing key.
commit 1da33d2a29bff96dff14f4ee5b439d0f171e8981
7 changes: 7 additions & 0 deletions src/elements/Entry.php
Original file line number Diff line number Diff line change
@@ -1239,6 +1239,10 @@ public function setAuthorsIds(array|string|int|null $authorsIds): void
$authorsIds = null;
}

if (is_string($authorsIds)) {
$authorsIds = explode(',', $authorsIds);
}

if (is_int($authorsIds)) {
$this->_authorsIds = [$authorsIds];
}
@@ -1248,6 +1252,9 @@ public function setAuthorsIds(array|string|int|null $authorsIds): void
if ($authorId == '') {
return null;
}
if (is_string($authorId)) {
return (int)$authorId;
}
if ($authorId instanceof User) {
return $authorId->id;
}
7 changes: 4 additions & 3 deletions src/elements/db/EntryQuery.php
Original file line number Diff line number Diff line change
@@ -1139,8 +1139,9 @@ protected function cacheTags(): array
*/
private function _processAuthors(array $rows): array
{
// we are now getting multiple rows for one entry because of ->authorId([...]), ->authorsIds([...])
// and the ->innerJoin with entries_authors table
// get authors info
// also, because of ->authorId([...]), ->authorsIds([...]) we are now
// getting multiple rows for one entry
// todo: is there a better way to do this? tried with group_concat but throws mysql error
$distinctRows = [];
if (!empty($rows)) {
@@ -1161,7 +1162,7 @@ private function _processAuthors(array $rows): array

// if authors IDs were passed via authorsIds
// make sure we only return entries which have all and only
// the specified authors assigned to them
// the specified authors from the query
if (!empty($this->authorsIds)) {
if (strtolower(trim($this->authorsIds[0])) === 'not') {
$negativeSearch = true;