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

DDST-554: New roles added to Creator vs Contributor mapping #16

Closed
wants to merge 6 commits into from

Conversation

prashant-dgi
Copy link
Contributor

No description provided.


// Add the resolved image URL to the elements array.
$this->elements[$dest][] = $resolved_image_url;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

So this was already setting a thumbnail?

... but it's doing an up-front lookup just to use the deferred thing? Should probably drop the up-front lookup to just always do the deferred thing?

Kinda want to suggest making use of the URL generator plugins, instead of directly using the underlying route.

@adam-vessey adam-vessey added the minor Added functionality that is backwards compatible. label Oct 15, 2024
Comment on lines 408 to 411
$url = $this->urlGenerator->generateFromRoute('dgi_image_discovery.deferred_resolution', [
'node' => $node_id,
'style' => $style_id,
], ['absolute' => TRUE]);
Copy link
Contributor

Choose a reason for hiding this comment

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

Not the intended URL Generator plugin (is this service even plugin based? Dunno)? Like, was meaning the plugins for the image discovery, in https://github.com/discoverygarden/dgi_image_discovery/tree/main/src/Plugin/dgi_image_discovery/url_generator

... so, using the related plugin manager and getting an instance of the desired plugin. Not sure if it's necessary here to make it fully configurable, but could? Not much configuration on either.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@adam-vessey I made code changes, please review.

@@ -389,11 +402,23 @@ public function addThumbnail(ContentEntityInterface $entity, $dest) {
$event = $this->imageDiscovery->getImage($entity);
Copy link
Contributor

Choose a reason for hiding this comment

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

This is still doing an unnecessary lookup. Why bother keeping this if doing the deferred resolution, which expects to handle the lookup separately?

@adam-vessey
Copy link
Contributor

Also, the latest commit introduced a number of coding standards issues:

 FILE: ...gi_standard_oai/dgi_standard_oai/src/Plugin/OaiMetadataMap/DgiStandard.php
--------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 4 LINES
--------------------------------------------------------------------------------
  11 | ERROR | [x] Use statements should be sorted alphabetically. The first
     |       |     wrong one is
     |       |     Drupal\Core\Plugin\ContainerFactoryPluginInterface.
     |       |     (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
 407 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
     |       |     question marks, colons, or closing parentheses
     |       |     (Drupal.Commenting.InlineComment.InvalidEndChar)
 411 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
     |       |     question marks, colons, or closing parentheses
     |       |     (Drupal.Commenting.InlineComment.InvalidEndChar)
 414 | ERROR | [x] Inline comments must end in full-stops, exclamation marks,
     |       |     question marks, colons, or closing parentheses
     |       |     (Drupal.Commenting.InlineComment.InvalidEndChar)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

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