The interface in src/ExternalLibrary/Utility/LibraryIdAccessorInterface.php is misnamed--LibraryAccessorInterface (no "Id"), which is already declared in src/ExternalLibrary/Utility/LibraryIdAccessorInterface and thus causes a PHP fatal error if the code is parsed (e.g., when scanning for deprecated code use).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Kingdutch created an issue. See original summary.

Kingdutch’s picture

Assigned: Kingdutch » Unassigned
Status: Active » Needs review
FileSize
566 bytes

Patch attached

DuneBL’s picture

This patch is really useful.
Thank you

Dinesh18’s picture

Status: Needs review » Reviewed & tested by the community

#2 looks good to be. Changing the status to RTBC

ñull’s picture

Patch #2 fixed this issue for me:

Interface 'Drupal\libraries\ExternalLibrary\Utility\LibraryIdAccessorInterface' not found in modules/contrib/libraries/src/ExternalLibrary/Exception/LibraryDefinitionNotFoundException.php

I only discovered this patch after reducing my search string to LibraryIdAccessorInterface and I really wonder now why after 9 months this isn't submitted to a release version yet.

balazswmann’s picture

I can also confirm this bug, but patch #2 fixed the issue for me.

alex_optim’s picture

Good for me.

NWOM’s picture

#2 worked for me as well. Thank you!

TravisCarden’s picture

Title: interface LibraryIdAccessorInterface misnamed » Misnamed interface causes "Fatal error: Cannot declare interface Drupal\libraries\ExternalLibrary\Utility\LibraryAccessorIdInterface"
Issue summary: View changes

Because the misnamed interface is already declared elsewhere, this actually causes a PHP fatal error if the duplicate declaration is ever interpreted (see updated summary). This patch should be merged.

TravisCarden’s picture

Issue summary: View changes
phenaproxima’s picture

Priority: Normal » Major

+1 RTBC on this. It can utterly break the Libraries API, so escalating it to Major.

  • tstoeckler committed 3b7ae61 on 8.x-3.x
    Issue #2882709 by Kingdutch: Fix "LibraryIdAccessorInterface" name
    
tstoeckler’s picture

Status: Reviewed & tested by the community » Fixed

Committed this.

Note that because the whole "new" API in 8.x-3.x which this interface is a part of is completely unused (as far as I know of) because we never got around to completing it, which is why issues like this can happen. Not sure I can realistically promise that that situation will change anytime soon seeing the lack of progress in the last years...

tstoeckler’s picture

Oh, sorry, forgot the most important part: Thanks @everyone for the patch and the reviews!! The amount of confirmation allowed to me commit this basically unseen.

Status: Fixed » Closed (fixed)

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