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

PER-26: Rework querying. #31

Merged
merged 19 commits into from
Mar 14, 2024
Merged

PER-26: Rework querying. #31

merged 19 commits into from
Mar 14, 2024

Conversation

adam-vessey
Copy link
Contributor

@adam-vessey adam-vessey commented Feb 17, 2024

Should reduce the number of joins when dealing with various multiple
file and media fields in the same query, as it instead builds out a
disjuction in the "join" condition against the LUT.
@adam-vessey adam-vessey added the minor Added functionality that is backwards compatible. label Feb 17, 2024
Track things as metadata on the query?
See: #6 (review)

Some mixed up assertions, assuming that the ::setUp() method changed at
some point mid-implementation, and wasn't carried through?

And that it that the existing implementation was indeed bearing a bug.
... DRY-ing up in progress, with the trait.
Comment on lines +13 to +19
with:
composer_patches: |-
{
"discoverygarden/islandora_hierarchical_access": {
"dependent work from dependency": "https://github.com/discoverygarden/islandora_hierarchical_access/pull/19.patch"
}
}
Copy link
Contributor Author

@adam-vessey adam-vessey Mar 7, 2024

Choose a reason for hiding this comment

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

This can be dropped when discoverygarden/islandora_hierarchical_access#19 is merged (and released).

... could possibly bump our composer.json according to the new release of islandora_hierarchical_access?

Suggested change
with:
composer_patches: |-
{
"discoverygarden/islandora_hierarchical_access": {
"dependent work from dependency": "https://github.com/discoverygarden/islandora_hierarchical_access/pull/19.patch"
}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The changes in discoverygarden/islandora_hierarchical_access#19 revealed some bad assertions in here, where we were expecting more files then should be available: #6 (review)

Better than being left thinking there's a bug where we have
undocumentedly expected there to be a file to exist that we didn't
explicitly create in our `::setUp()`.
Bit of formatting, and using constants.
Other embargoes block access (but exemptions from _any_ are let through).
@adam-vessey adam-vessey marked this pull request as ready for review March 11, 2024 15:08
Comment on lines -58 to -76
/**
* Implements hook_query_TAG_alter() for `media_access` tagged queries.
*/
function embargo_query_media_access_alter(AlterableInterface $query) {
/** @var \Drupal\embargo\Access\QueryTagger $tagger */
$tagger = \Drupal::service('embargo.query_tagger');
$tagger->tagAccess($query, 'media');
}

/**
* Implements hook_query_TAG_alter() for `file_access` tagged queries.
*/
function embargo_query_file_access_alter(AlterableInterface $query) {
/** @var \Drupal\embargo\Access\QueryTagger $tagger */
$tagger = \Drupal::service('embargo.query_tagger');
$tagger->tagAccess($query, 'file');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

media and file are now handled via the event.

nchiasson-dgi and others added 2 commits March 13, 2024 08:51
@nchiasson-dgi nchiasson-dgi merged commit 42ee442 into main Mar 14, 2024
4 checks passed
@nchiasson-dgi nchiasson-dgi deleted the fix/per-26 branch March 14, 2024 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor Added functionality that is backwards compatible.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants