🇮🇳India @kulpratap2002

Account created on 27 September 2024, 9 months ago
#

Recent comments

🇮🇳India kulpratap2002

@tim-diels I've updated the autofill behavior to include a more robust slugification process that properly removes consecutive hyphens and handles custom replacements.

Please review.
Thanks

🇮🇳India kulpratap2002

@harlor, I have done the changes as per your suggestions.
Please review.

🇮🇳India kulpratap2002

Since the MR was merged, please change the state of the issue.
Thanks.

🇮🇳India kulpratap2002

@lostcarpark Thanks, done the changes as per your suggestion.
Please review.

🇮🇳India kulpratap2002

@avpaderno If everything looks good now, can we move forward?

🇮🇳India kulpratap2002

I have updated the MR with the patch.

🇮🇳India kulpratap2002

@bigbabert Thank you for your suggestions,

But the ExtensionDiscovery service scans the entire filesystem and returns all available modules—whether enabled or disabled—including core, contributed, and custom modules. This makes it ideal for use cases requiring a comprehensive list of modules. In contrast, extension.list.module (or ModuleExtensionList) only lists currently installed and enabled modules, better suited for runtime logic such as plugin management or routing requiring active modules.

In my module, users can generate README files even for disabled modules, so we use ExtensionDiscovery to ensure those modules are included in the selection list. Additionally, we exclude modules located under core/modules to avoid cluttering the list with core system modules not relevant for README generation. Using ExtensionDiscovery allows us to provide a more complete and relevant module list for our use case, while extension.list.module would restrict us to only enabled modules and miss disabled but potentially important modules.

Also, the module is installing fine on my Drupal 11 fresh site. I have attached a video for reference.

Thank you.

🇮🇳India kulpratap2002

@bigbabert Thanks for the suggestion.

But I think it would become too complex if we had to read the main project composer.json file to determine the custom and the contrib folders.

So I updated the GenerateReadmeForm and ReadmeGeneratorCommandsto use a reliable method for collecting only top-level custom and contrib modules using ExtensionDiscovery.

src/Form/GenerateReadmeForm.php

public function getTopLevelCustomAndContribModules(): array {
    $modules = [];
    $discovery = new ExtensionDiscovery(DRUPAL_ROOT);
    $discovery->setProfileDirectories([]);
    $all_modules = $discovery->scan('module');

    foreach ($all_modules as $machine_name => $extension) {
      $module_path = $extension->getPath();

      if (str_starts_with($module_path, 'core/')) {
        continue;
      }
      $path_parts = explode('/', $module_path);
      $modules_index = array_search('modules', $path_parts);

      if ($modules_index !== FALSE) {
        $after_modules = array_slice($path_parts, $modules_index + 1);
        if (count($after_modules) !== 2) {
          continue;
        }
      }

      $info = $this->infoParser->parse($extension->getPathname());
      $modules[$machine_name] = $info['name'] ?? $machine_name;
    }

    asort($modules);
    return $modules;
  }

ReadmeGeneratorCommands

 public function generate(string $module): void {
    $discovery = new ExtensionDiscovery(DRUPAL_ROOT);
    $discovery->setProfileDirectories([]);
    $all_modules = $discovery->scan('module');

    if (!isset($all_modules[$module])) {
      $this->output()->writeln("Module '$module' not found in the filesystem.");
      return;
    }
    $extension = $all_modules[$module];
    $relative_path = $extension->getPath();

    if (str_starts_with($relative_path, 'core/')) {
      $this->output()->writeln("Core module '$module' is not supported.");
      return;
    }

    $module_path = DRUPAL_ROOT . '/' . $relative_path;
    $scanner = new CodebaseScanner($module_path);
    $moduleData = $scanner->scan();

    $config = $this->configFactory->get('ai_readme_generator.settings')->get();
    $apiKey = $config['api_key'] ?? NULL;
    $chatEndpoint = $config['chat_endpoint'] ?? NULL;
    $model = $config['model'] ?? NULL;

    if (empty($apiKey) || empty($chatEndpoint) || empty($model)) {
      $this->output()->writeln('<error>Please fill the AI configuration form first!</error>');
      return;
    }
    $ai = new AIResponse($config);
    $summary = $ai->summarizeArray($moduleData);

    $readme_path = $module_path . '/README.md';
    file_put_contents($readme_path, $summary);

    $this->output()->writeln("✅ README.md generated at: $readme_path");
  }

Please review the above code. If it's correct, I will update it in the module.

🇮🇳India kulpratap2002

@avpaderno Thank you for the review.
I've made the suggested changes.
Kindly have a look and let me know if anything else needs to be updated.
Thanks.

🇮🇳India kulpratap2002

@vishal.kadam Thank you for the review.
I've made the suggested changes.
Kindly have a look and let me know if anything else needs to be updated.
Thanks

🇮🇳India kulpratap2002

I have resolved the styling issue.
Please review.

🇮🇳India kulpratap2002

In Drupal 11, Select2 is preferred over Chosen due to its active maintenance, better accessibility, and modern features. Chosen is no longer supported or updated, and Select2 provides enhanced compatibility with current web standards, offering improved support for accessibility, search functionality, and responsive design. This makes Select2 a better fit for Drupal 11's forward-looking goals. The solution now works seamlessly with both Drupal 10 and Drupal 11. That's why I have changed the chosen to select2.

Thanks
Please review.

🇮🇳India kulpratap2002

Created an MR for the solution.
Please review.

🇮🇳India kulpratap2002

The error occurred because the module attempted to call $entity->toUrl('yoast-analysis-analyse') on entities that do not define the 'yoast-analysis-analyse' link template (e.g., field_config). To fix this, I added a condition to check if the link template exists using $entity->getEntityType()->hasLinkTemplate('yoast-analysis-analyse') before calling toUrl().

I have resolved the error.
Please review.

🇮🇳India kulpratap2002

@nidhi27 Thank you for reviewing it.
I think the namespace has just been removed by mistake, now I have corrected it also the GitLab pipeline passed with no errors and warnings.
Please review.

🇮🇳India kulpratap2002

I created an MR for the proposed resolution and tested this, and it is working as designed.

🇮🇳India kulpratap2002

@hoanglv I think you forgot to give the credit.

🇮🇳India kulpratap2002

The MR resolved the error, so moving this to RTBC.

Attaching a screenshot for reference.

🇮🇳India kulpratap2002

@shivam_tiwari Fixed the error, Please review.

🇮🇳India kulpratap2002

@shivam_tiwari I have made the suggested changes, Please review.

🇮🇳India kulpratap2002

I have tried the things below

1. Debugging Class Loading & Autoload Issues

  • Verified Composer autoloading: lando composer dump-autoload -o
  • Checked CKEditor AI Agent’s namespace in composer.json
  • Findings: No immediate resolution; issue persisted when OpenAI was enabled.

2. Checking Dependency Conflicts

  • Checked module dependencies:
    lando drush pm:list --status=enabled | grep openai
  • Investigated if OpenAI modifies dependency injection.
  • Findings:

    OpenAI requires guzzlehttp/guzzle, which could affect service resolution.

    No direct conflicts found, but OpenAI modifies service injection.

3. Testing OpenAI Event Subscriber & Dependency Injection Conflicts

  • Disabled OpenAI’s Event Subscriber in openai.services.yml.
  • Rebuilt cache and tested again (still Issue persisted).
  • Debugged class resolution:
    $resolver = \Drupal::service('class_resolver'); dpm($resolver->getInstanceFromDefinition('Drupal\ckeditor_ai_agent\Form\AiAgentSettingsForm'));
🇮🇳India kulpratap2002

I have fixed the buttons' style and the failing phpcs and cspell jobs.

🇮🇳India kulpratap2002

Also, the placeholder is missing. Instead of the field, it displays the last search text as the placeholder.

🇮🇳India kulpratap2002

kul.pratap made their first commit to this issue’s fork.

🇮🇳India kulpratap2002

Also tested this and working fine for me.

🇮🇳India kulpratap2002

kul.pratap changed the visibility of the branch 3513598-typeerror-arrayfilter-argument to active.

🇮🇳India kulpratap2002

kul.pratap changed the visibility of the branch 3513598-typeerror-arrayfilter-argument to hidden.

🇮🇳India kulpratap2002

@vladimiraus, I have only changed one file, not 1000 files. All other commits are not done by me, I have only done one commit.

🇮🇳India kulpratap2002

@gurkawal Your changes working as expected and i have tested this on my site, you have created an option to change the "RESET" button text accordinglly to the need of user.

Attaching screenchosts for reference.

Before:

After:

Changes after changing lable:

🇮🇳India kulpratap2002

After changes, the warning is gone I have tested it on my site.
Please review.

🇮🇳India kulpratap2002

@penyaskito, I cannot reproduce this error. I can see the dashboard icon on the Drupal CMS installation, and the dashboard module version is 2.0.0.

Attaching screenshot for reference :

🇮🇳India kulpratap2002

I have added the String Interpolation.
Please review

🇮🇳India kulpratap2002

I have tested this on my site and there are no issues, Gitlab CI has been added to it and a functional test has also been added to this and all the Gitlab pipelines are green which means it doesn't have warnings and errors.
So moving this issue to RTBC.

🇮🇳India kulpratap2002

I’ve addressed the TypeError in ParagraphEditForm::save() by adding a check for $this->rootParent before calling shouldCreateNewRevision().

Since the missing rootParent seems to be caused by a bug in the All Entity Preview module, I opted for a middle-ground approach:

If rootParent is missing, a warning is logged to help with debugging.
The form still triggers a save—defaulting to creating a new revision— to prevent potential data loss.
I didn’t use a hard error (like throwing an exception) to avoid breaking content workflows. Let me know if you'd prefer stricter error handling or further adjustments!

🇮🇳India kulpratap2002

@jaydeep_patel The problem is that the logo's default size is too large. Since CSS is coming from the CDN, we can't adjust the image size, so the option is to change the logo's default size. After changing the logo's size, it looks good.
The other option is to add the width:50% for the class .pico img so that if someone could upload the logo with a different size then it can't affect the logo size.

Production build 0.71.5 2024