Problem/Motivation

[warning] Undefined variable $extra_fields aichat.module:69
[warning] Undefined variable $extra_fields aiprompt_content.module:23

these fields are not defined anywhere but they are a return value for some functions.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork aichat-3416591

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

SocialNicheGuru created an issue. See original summary.

mindaugasd’s picture

Priority: Major » Minor

[warning] Undefined variable $extra_fields aiprompt_content.module:23

in aiprompt case, it is used here: https://git.drupalcode.org/project/aiprompt/-/blob/1.0.x/src/Traits/AIPr...

[warning] Undefined variable $extra_fields aichat.module:69

in aichat case, I don't find it being already used, but there is future intention to use it.

How did you find the bug? Does it have impact? It is not "major" bug, I am downgrading to "minor".

abhishek_gupta1’s picture

Assigned: Unassigned » abhishek_gupta1

abhishek_gupta1’s picture

Status: Active » Needs review

@SocialNicheGuru, I have fixed the issue. please kindly review the mR

mindaugasd’s picture

From the merge request now I see what @SocialNicheGuru meant while previously understood the issue wrong.

I also forgot that this issue was in the past already #3391876: Undefined variable $extra_fields in aiprompt_content_entity_extra_field_info() within my issue queues.

On the other hand, @abhishek_gupta1, you produced a low quality merge request for the second time like in the issue I referenced above.

This line is too much info, because it is self evident that variable is being initialized.
// Initialize $extra_fields as an empty array.

Please don't credit farm. Neither of your @abhishek_gupta1 contributions will be recorded. You won't be so lucky as other credit farmers were already here: #3367843-3: Fix the issues reported by phpcs

For comparison - I have not recorded credit for myself after creating a module in the first place after spending hundreds of hours. Contributions should be for providing value, not for farming credit.

  • mindaugasd committed 86b27c87 on 1.0.x
    Issue #3416591:   [warning] Undefined variable $extra_fields aichat....
mindaugasd’s picture

Status: Needs review » Fixed

socialnicheguru’s picture

Please record credit for yourself. You did develop the module!

mindaugasd’s picture

It is not possible to record credit for the module, only for issues (after each issue is completed I believe).

socialnicheguru’s picture

That was my roundabout way of just saying job well done.

Status: Fixed » Closed (fixed)

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

ressa’s picture

Thank you @mindaugasd, I just want to say that I also really appreciate your big efforts in the AI-space in Drupal.

I only today realized how far your initiative https://www.drupal.org/project/artificial_intelligence_initiative has gotten, with https://www.drupal.org/project/aipersona, https://www.drupal.org/project/aichat, https://www.drupal.org/project/aiwork, and the rest of your Drupal AI modules.