Problem/Motivation

Some media could not be retrieved because the source is private or similar, oembed gives a message like "Could not retrieve the remote URL".

Proposed resolution

List the resources that can not be retrieved.

Issue fork xray_audit-3482085

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

eduardo morales alberti’s picture

After talking with @tunic and @lpeidro we decided that this fits better on the submodule insights.
It will try to extract the error related or hook to the fetcher resource.

eduardo morales alberti’s picture

Status: Active » Needs review
StatusFileSize
new50.86 KB
new62.65 KB
new35.99 KB

Ready to review https://git.drupalcode.org/project/xray_audit/-/merge_requests/74#note_4...

The strategy was to create a decorator that registers when a resource gives an exception, it saves on a xray_audit_insight table with the message and the url.

https://git.drupalcode.org/project/xray_audit/-/merge_requests/74/diffs#...

  public function fetchResource($url) {
    try {
      return $this->resourceFetcher->fetchResource($url);
    }
    catch (ResourceException $e) {
      // Log the exception to the xray_audit_insight table.
      $this->insightReport->addInsightData(
        'external_resource',
        $e->getMessage(),
        $url
      );

      throw $e;
    }
  }

We also created a External Resources task on Content Display group.

External resources

If the module insight is enabled then it shows the resources that needs to be reviewed.
External resources needs review

Also, if there there are resources to be reviewed it shows it on the status report:
Status report

eduardo morales alberti’s picture

Solve all threads @tunic

tunic’s picture

Status: Needs review » Reviewed & tested by the community

Thanks, it looks good to me!

I would prefer to wait for comments from @lpeidro before committing this forward but I think it is ok to move it to RTBC.

eduardo morales alberti’s picture

We simplified the code and removed the table "xray_audit_insight", and we recalculated the external resources status on the xray audit and on the insights.

eduardo morales alberti’s picture

Status: Reviewed & tested by the community » Needs work

We will remove the insight as it takes to much time to process on the status report

eduardo morales alberti’s picture

Status: Needs work » Needs review

Ready to review, we removed the insight to avoid excessive loads on status page

lpeidro’s picture

Version: 1.x-dev » 2.x-dev

I change the develop branch (2.x-dev).

It is convenient to adapta the code to the new branch.

lpeidro’s picture

Status: Needs review » Fixed

I have merged the Press Release. Thank you, Edu.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.