"Source database" should be mandatory

Created on 15 April 2025, 9 days ago

Problem/Motivation

If the module is supposed to work only with Search API or Vector databases, in that case the field provided in the block configuration Source data -> Source database should be mandatory field because without that search block does not work (which is correct) but does not even shows user friendly message like "Search server/index not configured" etc.

Steps to reproduce

  • Enable the ai_search_block module
  • Place the block from block layout "AI Search"
  • In the block configuration form the field "Source database" should be required

Proposed resolution

Make the field required

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ“Œ Task
Status

Active

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia prashant.c Dharamshala

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @prashant.c
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium wouters_f Leuven

    Oh yes you are absolutely right.
    Please provide a merge request, ill see when i have time to fix this

  • haritha c โ†’ made their first commit to this issueโ€™s fork.

  • haritha c โ†’ changed the visibility of the branch 3519312-source-database-should to hidden.

  • haritha c โ†’ changed the visibility of the branch 3519312-source-database-should to hidden.

  • Pipeline finished with Failed
    9 days ago
    Total: 172s
    #474218
  • haritha c โ†’ changed the visibility of the branch 3519312-source-database-should to active.

  • haritha c โ†’ changed the visibility of the branch 3519312-source-database to hidden.

  • Pipeline finished with Failed
    9 days ago
    Total: 429s
    #474222
  • I have updated the code to make the "Source database" field required in the block configuration form by adding:

    '#required' => TRUE

    This ensures that the search block cannot be saved without selecting a source, which helps prevent misconfiguration.

    However, the merge request pipeline initially failed due to PHPStan static analysis and/or PHPCS code style issues.

    If anyone could guide me on how to resolve this pipeline issue, I would greatly appreciate it.

    Thank you!

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia prashant.c Dharamshala

    @haritha_C

    Please check under the "Failed jobs" on this URL: https://git.drupalcode.org/project/ai_search_block/-/merge_requests/11/p...

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia prashant.c Dharamshala

    You may fix the PHPCS issues in this one https://www.drupal.org/project/ai_search_block/issues/3515395 ๐Ÿ“Œ Fix coding standards violations in AI Talk With Node module Active

  • Pipeline finished with Failed
    8 days ago
    Total: 1638s
    #474836
  • Pipeline finished with Canceled
    8 days ago
    Total: 2377s
    #474852
  • Pipeline finished with Failed
    8 days ago
    Total: 186s
    #474900
  • Pipeline finished with Failed
    8 days ago
    #475544
  • Pipeline finished with Failed
    8 days ago
    Total: 137s
    #475572
  • Pipeline finished with Failed
    7 days ago
    Total: 371s
    #475608
  • Pipeline finished with Failed
    7 days ago
    Total: 247s
    #475617
  • Pipeline finished with Failed
    7 days ago
    Total: 152s
    #475618
  • Pipeline finished with Failed
    7 days ago
    Total: 191s
    #475622
  • Pipeline finished with Failed
    7 days ago
    Total: 142s
    #475629
  • Pipeline finished with Failed
    7 days ago
    Total: 230s
    #475642
  • Pipeline finished with Failed
    7 days ago
    Total: 165s
    #475653
  • Pipeline finished with Failed
    7 days ago
    Total: 241s
    #475933
  • Pipeline finished with Failed
    7 days ago
    Total: 150s
    #475953
  • Pipeline finished with Failed
    7 days ago
    Total: 162s
    #475962
  • Pipeline finished with Failed
    7 days ago
    Total: 148s
    #475997
  • Pipeline finished with Failed
    7 days ago
    Total: 155s
    #476001
  • Pipeline finished with Failed
    7 days ago
    Total: 148s
    #476008
  • Pipeline finished with Failed
    7 days ago
    Total: 197s
    #476024
  • Pipeline finished with Failed
    7 days ago
    Total: 146s
    #476036
  • Pipeline finished with Failed
    7 days ago
    Total: 248s
    #476039
  • Pipeline finished with Failed
    7 days ago
    Total: 146s
    #476047
  • Pipeline finished with Failed
    6 days ago
    Total: 245s
    #476378
  • Pipeline finished with Success
    6 days ago
    Total: 199s
    #476382
  • Hi @prashant.c,

    Thanks for your response.
    I've resolved all the pipeline and PHPCS issues in this merge request itself:
    ๐Ÿ”— https://git.drupalcode.org/issue/ai_search_block-3519312/-/tree/3519312-...

    Kindly review and let me know if anything else is needed.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sagartiwari

    I am reviewing this.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sagartiwari

    The Provided MR fixes the issue, although PHPCS still shows some issues.

    ----------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AND 6 WARNINGS AFFECTING 7 LINES
    ----------------------------------------------------------------------------------------------------------
    6 | WARNING | [ ] Line exceeds 80 characters; contains 104 characters
    29 | WARNING | [ ] Line exceeds 80 characters; contains 91 characters
    31 | WARNING | [ ] Line exceeds 80 characters; contains 87 characters
    37 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
    50 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
    68 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
    75 | ERROR | [x] Expected 1 newline at end of file; 3 found
    ----------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------------------------------

    FILE: /home/sagar/projects/contributions/contrib_project/modules/contrib/ai_search_block-3519312/modules/ai_search_block_log/README.md
    --------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------------------------------------
    4 | ERROR | [x] Expected 1 newline at end of file; 2 found
    --------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------------------------------------------------------------

    FILE: /home/sagar/projects/contributions/contrib_project/modules/contrib/ai_search_block-3519312/modules/ai_talk_with_node/css/ai_talk_with_node.css
    ----------------------------------------------------------------------------------------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 2 LINES
    ----------------------------------------------------------------------------------------------------------------------------------------------------
    50 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
    51 | ERROR | [x] Expected 1 space after colon in style definition; 0 found
    ----------------------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ----------------------------------------------------------------------------------------------------------------------------------------------------

    Thanks.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sagartiwari
Production build 0.71.5 2024