Account created on 8 December 2020, over 4 years ago
  • Engineer Drupal - Backend at QED42 
#

Merge Requests

More

Recent comments

🇮🇳India annmarysruthy

Raised MR !598 for removing the dependency injection for current user. Kindly review.

🇮🇳India annmarysruthy

Raised MR !119 . Kindly review.

🇮🇳India annmarysruthy

I was able to replicate the issue as described. I tested the solution suggested in the proposed resolution by manually replacing the [agent_instructions] token using str_replace(), and it resolved the problem in my testing.

Alternatively, another viable approach would be to formally declare the [agent_instructions] token via hook_token_info() and implement its replacement logic in hook_tokens().

It would be great to hear other thoughts

🇮🇳India annmarysruthy

Hi @anjaliprasannan Is n't this issue a duplicate of https://www.drupal.org/project/ai/issues/3523327 🐛 Select fields toogle not working for content suggestion sections Active .

🇮🇳India annmarysruthy

@marcus_johansson No. There is a remaining part of solution: On the runner make sure to run the secured_system_prompt and replace the tokens and use this.

I could not fix this part. Therefore, Updated the issue description with remaining task and unassigned myself.

🇮🇳India annmarysruthy

annmarysruthy made their first commit to this issue’s fork.

🇮🇳India annmarysruthy

@marcus_johansson Could you please clarify a few details:

  • Is the intention to update only the System Prompt field within ai_agents/src/Form/AiAgentForm.php, or are there other locations that need to be updated as well?
  • Could you elaborate on the purpose and use case for introducing a separate "System Prompt" in addition to "Agent Instructions"?
🇮🇳India annmarysruthy

@smustgrave added commits for review comments. Kindly review.

Checked the existing tests and could not find one related to sorting. Therefore I created a new test.

🇮🇳India annmarysruthy

I was able to reproduce the issue by following these steps:

  1. Enabled the "Convert line breaks into HTML" filter for a text format at /admin/config/content/formats.
  2. Created a node using that text format.
  3. Entered Test in the body using the "Source" view in CKEditor, ensuring no extra whitespace or newlines were present.
  4. Saved the node and viewed the output on the frontend.

Even though the saved source remains

Test

, the rendered output includes a line break (
) between "Test" and the tag.

_filter_autop() function in filter.module is responsible for converting line breaks into
and wrapping text in

tags. Within this function, there's a $block regex pattern that defines all block-level elements:
$block = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|option|form|map|area|blockquote|address|math|input|p|h[1-6]|fieldset|legend|hr|article|aside|details|figcaption|figure|footer|header|hgroup|menu|nav|section|summary)';
Since is listed as a block-level element,a newline is added before any tag. Later in the processing, this newline gets transformed into

Proposed Resolution:
According to HTML specifications, is an inline-level element, not a block-level one. Therefore, it should not be included in the $block list used by _filter_autop().

Removing input from the $block list resolves the issue, as the newline is no longer added before the tag, and no
is inserted.

🇮🇳India annmarysruthy

Checked all occurrences of function_exists() and changed 6 files. In my opinion, Rest of the occurrences are better kept as function_exists() itself. Kindly review MR

🇮🇳India annmarysruthy

Fixed remaining violations and phpstan issue. Kindly review

🇮🇳India annmarysruthy

Fixed remaining violations. Kindly review

🇮🇳India annmarysruthy

annmarysruthy made their first commit to this issue’s fork.

🇮🇳India annmarysruthy

@quietone Should we replace all existences of function_exists() with is_callable() ?

🇮🇳India annmarysruthy

Replicated the issue. The below changes in core/modules/comment/src/Plugin/views/sort/StatisticsLastUpdated.php could fix the issue:

<?php

namespace Drupal\comment\Plugin\views\sort;

use Drupal\views\Attribute\ViewsSort;
use Drupal\views\Plugin\views\sort\Date;

/**
 * Sort handler for the newer of last comment / entity updated.
 *
 * @ingroup views_sort_handlers
 */
#[ViewsSort("comment_ces_last_updated")]
class StatisticsLastUpdated extends Date {

  /**
   * The node table.
   */
  // phpcs:ignore Drupal.NamingConventions.ValidVariableName.LowerCamelName, Drupal.Commenting.VariableComment.Missing
  protected ?string $node_table;

  /**
   * The field alias.
   */
  // phpcs:ignore Drupal.NamingConventions.ValidVariableName.LowerCamelName, Drupal.Commenting.VariableComment.Missing
  protected ?string $field_alias;

  /**
   * {@inheritdoc}
   */
  public function query() {
    $this->ensureMyTable();
    $this->node_table = $this->query->ensureTable('node_field_data', $this->relationship);
    $this->query->addField($this->node_table, 'changed');
    $this->field_alias = $this->query->addOrderBy(NULL, "GREATEST(" . $this->node_table . ".changed, " . $this->tableAlias . ".last_comment_timestamp)", $this->options['order'], $this->tableAlias . '_' . $this->field);
  }

}

In the above solution, issue is fixed with fewer changes than the proposed solution in the issue: making $field_alias nullable and using the proper table (node_field_data instead of node).

🇮🇳India annmarysruthy

Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies .

🇮🇳India annmarysruthy

Deprecated the block and removed it from theme and profile. still getting a few test failures in merge request !11835.

🇮🇳India annmarysruthy

@acbramley Can I skip deprecating the block and directly remove it? But what if the block is currently being used in sites.

🇮🇳India annmarysruthy

annmarysruthy changed the visibility of the branch 3518990-deprecate-syndicateblock to hidden.

🇮🇳India annmarysruthy

Hi @prashant.c, I was unable to replicate the issue. tried with openai(different models) and gemini.

🇮🇳India annmarysruthy

Raised an MR #2 for improving the readability of code snippets in the Chat Generation Explorer.

🇮🇳India annmarysruthy

Changed validation error message to "This value is not a valid extension name." Kindly review MR.

🇮🇳India annmarysruthy

Reviewed the MR. Changes look good to me. Also ignoring the sniff in files using testN() seems to be fine.

🇮🇳India annmarysruthy

I've raised an MR!11764 implementing the suggested solution for this issue. The PR refactors the HookCollectorPass::checkForProceduralOnlyHooks() method to make it more reusable by other components.

Kindly review.

🇮🇳India annmarysruthy

Since this is being used in core and contrib modules, Can I create a CR and add a deprecation notice for Drupal.behaviors.fillUserInfoFromBrowser.

🇮🇳India annmarysruthy

Given the potential GDPR implications and the increasing security expectations around personal data handling, Drupal.behaviors.fillUserInfoFromBrowser could be removed from form.js. I think this can be safely removed in a minor release as it doesn’t break core form functionality.

We could:

  1. Remove the fillUserInfoFromBrowser behavior entirely from form.js bypassing deprecations
  2. Split remaining behaviors into separate files with their own libraries
  3. Update dependencies in existing modules to reference the new libraries
  4. Add a change record documenting both the removal and restructuring
🇮🇳India annmarysruthy

Raised MR!11722. Updated getDefinitionsByType($type) to ensure type is always treated as an array by casting it with (array) to prevent WSOD.

Kindly review

🇮🇳India annmarysruthy

Was able to replicate the issue with steps mentioned in description.

The issue occurs because the source and target parameters are explicitly set to NULL in the ContentTranslationRouteSubscriber.php file while defining the translation add route. This results in incorrect route processing, leading to duplicate "Add" links in the breadcrumb and an unexpected error when clicked.

if ($entity_type->hasLinkTemplate('drupal:content-translation-add')) {
  $route = new Route(
    $entity_type->getLinkTemplate('drupal:content-translation-add'),
    [
      '_controller' => '\Drupal\content_translation\Controller\ContentTranslationController::add',
      'source' => NULL,
      'target' => NULL,
      '_title' => 'Add',
      'entity_type_id' => $entity_type_id,
    ],

Removing the source and target parameters from the route definition allows Drupal to handle them dynamically based on context, preventing duplicate breadcrumb links:

if ($entity_type->hasLinkTemplate('drupal:content-translation-add')) {
  $route = new Route(
    $entity_type->getLinkTemplate('drupal:content-translation-add'),
    [
      '_controller' => '\Drupal\content_translation\Controller\ContentTranslationController::add',
      '_title' => 'Add',
      'entity_type_id' => $entity_type_id,
    ],

This change removes the duplicate "Add" breadcrumb links.The breadcrumb structure will now be:
Home > Page Title > Translations.
this ensures breadcrumb consistency with how Drupal structures breadcrumbs in other areas, such as when adding a content type (Home > Administration > Structure > Content types).

Would love to hear thoughts from others on this approach

🇮🇳India annmarysruthy

Added a check for empty vocabulary as per review comment. Also validation will occur only when translate is enabled in CK Editor.

Thanks for the input @mrdalesmith. Kindly review changes.

🇮🇳India annmarysruthy

Added validation in CkEditor AI tools - Translate settings. When a vocabulary is selected for translate settings, validation checks if the terms in selected vocabulary are languages supported in drupal. Otherwise an error message with the invalid terms is displayed.

Kindly review and test.

🇮🇳India annmarysruthy

Resolved all comments and resolved conflict in MR. Kindly review @borisson_.

🇮🇳India annmarysruthy

Reviewed and tested the MR. In configuration -> AI -> AI translate settings, an accordion 'Translation default behaviour' is now present. A checkbox 'Mark new translation as unpublished' is present

Tested Scenarios:

1. If checkbox is enabled and no content workflow applies to a content type, the translated node will be unpublished irrespective of state of source entity.
2. If checkbox is disabled and no content workflow applies to a content type, the status of translated node will be the same as the status of source entity.
3. If a content moderation workflow applies to a content type, then status of translated node will be same as default state in workflow.

Moving to RTBC.

🇮🇳India annmarysruthy

On applying the current MR, the automated field values update on each node save if 'Edit when changed' checkbox is enabled. This is not a recommended practice. Also the checkbox is labelled 'Edit when changed', the user is not warned that content of automated fields changes everytime on node save.

Proposed Resolutions:

  1. Retrieve tokens used in prompt and check if token values used have changed - This is a tough one
  2. On selecting 'Advanced Mode(Token)' ,Hide 'Edit when changed' checkbox or Rename the label and description of checkbox, so that user will know that on enabling the checkbox, the automated field value changes on every edit and this adds to load'
🇮🇳India annmarysruthy

@borisson_ made change as per one comment and for the other one, added reply in MR. Kindly check. Thanks for the review

🇮🇳India annmarysruthy

Tested the changes and Changes look good. Moving to RTBC.

🇮🇳India annmarysruthy

Reviewed MR !490. Tested the functionality and disable option is working fine.

I have a concern about re-sort option. Once we disable a field in AI Automator Run Order, On clicking the re-sort the disabled field is enabled and sorted. Shouldn't we only consider enabled fields while re-sorting?

Example scenario: If there is a large number of fields in 'AI Automator Run Order' , user disables one or more fields and needs to re-sort the enabled fields.

🇮🇳India annmarysruthy

Reviewed the MR. Issue is fixed. Thanks @anjaliprasannan

🇮🇳India annmarysruthy

@jbuttler Icould not replicate the issue. I followed these steps while trying to replicate the issue:

  1. Configure the AI Assistant to use RAG access check
  2. Index content type 'article' (5 items)
  3. Login as a non-admin user
  4. Try interacting with chatbot

Kindly let me know if there is any step I missed

🇮🇳India annmarysruthy

In the block configuration, a checkbox 'Display title' is present. However, for the chatbot block, this option is not relevant. The title should only be displayed inside the chatbot modal, which is already happening regardless of whether 'Display title' is enabled or disabled.

To improve clarity, should we hide the 'Display title' option in the block configuration form specifically for the chatbot block? This would prevent confusion while ensuring the chatbot title is displayed correctly within the modal.

Inviting suggestions on this approach.

🇮🇳India annmarysruthy

Tried replicating issue in local ddev drupal 11 setup.

  1. cache is already enabled in site.
  2. Installed Milvus VDB Provider module
  3. Tried creating a new server and No VDB provider found
  4. Configured Milvus VDB Provider module and connected successfully
  5. On creating a new server, Milvus DB is now available without clearing cache
Production build 0.71.5 2024