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

Issue #3475695 by joshua1234511, richardgaunt, sime, toby-wild: civictheme_media_get_variables not returning anything for civictheme_remote_video media type #1316

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

joshua-salsadigital
Copy link
Collaborator

@joshua-salsadigital joshua-salsadigital commented Nov 13, 2024

https://www.drupal.org/project/civictheme/issues/3475695

Checklist before requesting a review

  • I have formatted the subject to include ticket number as Issue #123456 by drupal_org_username: Issue title
  • I have added a link to the issue tracker
  • I have provided information in Changed section about WHY something was done if this was not a normal implementation
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • I have run new and existing relevant tests locally with my changes, and they passed
  • I have provided screenshots, where applicable

Changed

  1. Updated civictheme_media_get_variables to handle the OEmbed (remote video).

Screenshots

@joshua-salsadigital joshua-salsadigital added the State: Needs review Pull requests needs a review from assigned developers label Nov 13, 2024
@joshua-salsadigital joshua-salsadigital self-assigned this Nov 13, 2024
@joshua-salsadigital joshua-salsadigital force-pushed the feature/3475695-media-variables-support branch from afc024b to f26fc0d Compare November 13, 2024 17:14
'changed' => civictheme_format_datetime($media->getChangedTime(), 'civictheme_short_date'),
];

if ($media->bundle() === 'civictheme_remote_video') {
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can make it more extensible with:

Suggested change
if ($media->bundle() === 'civictheme_remote_video') {
if ($media->getSource() instanceof \Drupal\media\Plugin\media\Source\OEmbed) {

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Also updated to use $source->getMetadata($media, 'url')
and not specific 'field_c_m_oembed_video' field.

Reference
Screenshot 2024-11-19 at 8 53 46 AM

Copy link
Collaborator

@richardgaunt richardgaunt left a comment

Choose a reason for hiding this comment

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

@joshua-salsadigital Minor change to make it more extensible

@richardgaunt richardgaunt added State: Requires more work Pull request was reviewed and reviver(s) asked to work further on the pull request and removed State: Needs review Pull requests needs a review from assigned developers labels Nov 18, 2024
@joshua-salsadigital joshua-salsadigital added State: Needs review Pull requests needs a review from assigned developers and removed State: Requires more work Pull request was reviewed and reviver(s) asked to work further on the pull request labels Nov 19, 2024
Copy link
Collaborator

@richardgaunt richardgaunt left a comment

Choose a reason for hiding this comment

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

@joshua-salsadigital Thanks for reminding me.

@richardgaunt richardgaunt enabled auto-merge (squash) December 16, 2024 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
State: Needs review Pull requests needs a review from assigned developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants