Problem/Motivation

Several list resources (ReviewsGetResource, NodesDiscountGetResource, NodesDoctorGetResource, NodesPackageGetResource, NodesVideoReviewsGetResource) use \Drupal\search_api\Entity\Index and throw SearchApiException, but search_api is declared neither in myrest.info.yml nor in composer.json. Without it installed these endpoints fatal.

Proposed resolution

  • Add drupal/search_api to the suggest section of composer.json.
  • Guard MyrestHelper::getSearchApiIndexStorage() consumers and return a documented 501/503 response when the index is unavailable.
  • Skip registration of the affected resource plugins when the module is missing.

Remaining tasks

Add guards, update metadata, and cover the missing-module path with a test.

User interface changes

None.

API changes

Search-backed endpoints degrade gracefully instead of fataling.

Issue fork myrest-3615466

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

sergeydruua created an issue. See original summary.

  • sergeydruua committed 66f660eb on 1.0.x
    Issue #3615466: Make search_api an explicit optional integration
    
sergeydruua’s picture

Status: Active » Fixed

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.

sergeydruua’s picture

Status: Fixed » Closed (fixed)