IndexInterface methods getDatasourceIds(), isValidDatasource(), getDatasource() should document what a datasource ID is

Created on 31 May 2024, 10 months ago
Updated 7 August 2024, 8 months ago

Problem/Motivation

AFAICT the $datasource_id parameter to these methods in IndexInterface is just a datasource plugin ID. This makes sense, as a datasource can only be added once to an index.

These methods should document that the $datasource_id is the datasource plugin ID.

Steps to reproduce

Proposed resolution

Remaining tasks

šŸ› Bug report
Status

Active

Version

1.0

Component

Documentation

Created by

šŸ‡¬šŸ‡§United Kingdom joachim

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @joachim
  • First commit to issue fork.
  • Pipeline finished with Success
    5 months ago
    Total: 324s
    #318151
  • šŸ‡¦šŸ‡¹Austria drunken monkey Vienna, Austria

    Thanks for creating this MR!
    However, I see that the code already specifies everywhere (except for removeDatasource(), admittedly ā€“ funnily, that is the one method not mentioned in the issue title) that $datasource_id is a datasource plugin ID, in exactly those words. Therefore, I struggle to see what value these additional sentences provide. Iā€™d very much like input from others before merging this.

    One real problem I see in that area, though, which is not addressed by this issue is that setDatasources() apparently requires the $datasources array to be keyed by the datasource plugin IDs without specifiying this in the documentation.
    Therefore we should either fix the documentation, or the code. (I think this would have blown up if anyone would have used this incorrectly so far, so I think changing the documentation would be fine here.)
    Created šŸ› Fix contract of IndexInterface::setDatasources() Active as a follow-up for that. Iā€™d just fix the minimal problem with the removeDatasource() docs in there unless enough people comment here to support expanding those doc comments.

Production build 0.71.5 2024