Admin menu -> Content authoring-> Link Checker -> under MAINTENANCE tab -> Clear link data and analyze content for links and Reanalyze content for links

As a click on below links under maintenance tab, it executes batch process, somehow it breaks with below error:

TypeError: Argument 1 passed to Drupal\linkchecker\LinkExtractorService::extractFromEntity() must implement interface Drupal\Core\Entity\FieldableEntityInterface, null given, called in /linkchecker/src/LinkExtractorBatch.php on line 116 in Drupal\linkchecker\LinkExtractorService->extractFromEntity() (line 92 of /linkchecker/src/LinkExtractorService.php)

CommentFileSizeAuthor
#9 3132326-9.patch1.15 KBpavnish

Comments

harshit97 created an issue. See original summary.

harshit97’s picture

Status: Active » Needs work
harshit97’s picture

Issue summary: View changes
harshit97’s picture

Updated below code in linkchecker\src\LinkExtractorBatch.php

+ if($entity instanceof FieldableEntityInterface){
          $links = $this->extractor->extractFromEntity($entity);
          $this->extractor->saveLinkMultiple($links);
          $this->extractor->updateEntityExtractIndex($entity);
 + }
harshit97’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

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

avpaderno’s picture

Status: Closed (fixed) » Active

Until the project code isn't changed, this bug isn't fixed.

pavnish’s picture

Assigned: Unassigned » pavnish
pavnish’s picture

Assigned: pavnish » Unassigned
Status: Active » Needs review
StatusFileSize
new1.15 KB

Please review this patch

avpaderno’s picture

Status: Needs review » Reviewed & tested by the community

The patch fixes the exception shown in the OP.

tomefa’s picture

The patch work also for me and correct the error.

joseph.olstad’s picture

Someone needs to take ownership of this project or find a new co-maintainer.

we need this patch and two others just to get this module to work on recent Drupal releases

#3118940: Route "entity.linkcheckerlink.canonical" does not exist
#3058014-27: Add support for Redirect module
#3132326-9: Link Extract Issue

c-logemann’s picture

In my Testing setups I cannot reproduce this error. Maybe this depends on PHP version. But this is not needed because of the RTBC comments above and there was nothing broken in my test setups :-) So I will commit this small change.

c-logemann’s picture

Status: Reviewed & tested by the community » Fixed

Tanks everyone who helps on coding and testing the fix.

Status: Fixed » Closed (fixed)

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