๐Ÿ‡ฎ๐Ÿ‡ณIndia @saranyamariappan

Account created on 26 October 2012, about 12 years ago
#

Recent comments

๐Ÿ‡ฎ๐Ÿ‡ณIndia saranyamariappan

Hi @ Umbra โ†’ ,

    I have been facing this same issue on Drupal 10 multisite setup for couple of days and I luckily found the fix for it and works!!!

    1. Copy services.yml to your subsite (File path: /var/www/html/web/sites/<subsite-name>/services.yml)

    2. Create settings.php to your subsite (File path: /var/www/html/web/sites/<subsite-name>/settings.php)

    3. On services.yml:

          Please make changes as below code ( I run React App on the http://localhost:3000):            

cors.config:
    enabled: true
    # Specify allowed headers, like 'x-allowed-header'.
    allowedHeaders: ["access-control-allow-origin","*"]
    # Specify allowed request methods, specify ['*'] to allow all possible ones.
    allowedMethods: ['*']
    # Configure requests allowed from specific origins. Do not include trailing
    # slashes with URLs.
    allowedOrigins: ['*','http://localhost:3000']
    # Sets the Access-Control-Expose-Headers header.
    exposedHeaders: false
    # Sets the Access-Control-Max-Age header.
    maxAge: false
    # Sets the Access-Control-Allow-Credentials header.
    supportsCredentials: false

     4. On settings.php confirm you have 

$settings['container_yamls'][] = $app_root . '/' . $site_path . '/services.yml';

        You can also add this line in the /sites/default/settings.php and include the file in the subsite-name/settings.php (I have used this way in my use case)     

if (file_exists($app_root . "/sites/default/settings.ddev.php")) {
    include $app_root . "/sites/default/settings.ddev.php";
  }

     5. Clear the cache once you have made the changes. It will work.

๐Ÿ‡ฎ๐Ÿ‡ณIndia saranyamariappan

Hi @ murilohp โ†’ , @ clarkssquared โ†’ ,

I have applied the patch on #2 ๐Ÿ› Error: Argument #2 ($haystack) must be of type array, null given Needs review and it working fine on 2.0.x-dev. In addition, I am able to reproduce the issue mentioned on #3 ๐Ÿ› Error: Argument #2 ($haystack) must be of type array, null given Needs review and even I would agree to create it as an another issue.

Apart from, I found an issue when submitting the Search Page form on /admin/config/search/pages. This time the error is from the deprecated core service has been used. I have updated it and created a patch. Please review and let me know.

๐Ÿ‡ฎ๐Ÿ‡ณIndia saranyamariappan

Attaching this screenshot for your better understanding.

๐Ÿ‡ฎ๐Ÿ‡ณIndia saranyamariappan

Hi @ Kevinquillen โ†’ ,

I want to install and use the OpenAI and its submodules to generate text for my Basic Page Content Type. I have created account on platform.openai.com and I have added my OpenAI Key copied from the openai.com on the settings forms of my local D10. But I am getting Website encountered error on the CKEditor.

When I check the watchdog, I got

OpenAI\Exceptions\ErrorException: You exceeded your current quota, please check your plan and billing details. in OpenAI\Transporters\HttpTransporter->throwIfJsonError() (line 130 of /var/www/html/vendor/openai-php/client/src/Transporters/HttpTransporter.php).

๐Ÿ‡ฎ๐Ÿ‡ณIndia saranyamariappan

Hi @ droprocker โ†’ ,

I am facing the same issue, do you have any solutions for this? Kindly let me know.

๐Ÿ‡ฎ๐Ÿ‡ณIndia saranyamariappan

I have tried to install the openai on my fresh Drupal10 and I really excited to see the wonders that openai can do on my local Drupal setup while creating content on Basic Page content type on Basic HTML CKEditor but it throws Website encountered error.

When I do check the watchdog, I got OpenAI\Exceptions\ErrorException: You exceeded your current quota, please check your plan and billing details. in OpenAI\Transporters\HttpTransporter->throwIfJsonError() (line 130 of /var/www/html/vendor/openai-php/client/src/Transporters/HttpTransporter.php).

Do we have any sandbox accounts to playaround on openai before going for paid version. Please advise. I am documenting this openai setup and all cases to mentor my team.

Thanks in advance.

๐Ÿ‡ฎ๐Ÿ‡ณIndia saranyamariappan

Hi,

I would like to be maintainer of this module. I got a chance to use it on D7 and when I was migrating the D7 to D9, this module has no support for D9. So I would like to take up this. I would be really great if I get an opportunity to be a maintainer.

Thanks in advance.
Saranya

๐Ÿ‡ฎ๐Ÿ‡ณIndia saranyamariappan

We have our Composer running with PHP 7.4 and Drupal 9.4.8, using "drupal/captcha": "^1.2" [copied from my composer.json], I have fixed it with ob_clean() for timebeing. We are in process of upgrading to PHP 8.1 in another couple of weeks and I will check the same issue with Captcha 2.x and confirm if the issue still persists. As of now, we can close the ticket(as it is edge case for specific project).

Thanks for all who has spent their time on this issue queue.

๐Ÿ‡ฎ๐Ÿ‡ณIndia saranyamariappan

Please find below the details you are requesting,

TypeError: preg_match(): Argument #2 ($subject) must be of type string, array given in C:\wamp64\www\\docroot\core\lib\Drupal\Core\StreamWrapper\StreamWrapperManager.php on line 287 #0 C:\wamp64\www\\docroot\core\lib\Drupal\Core\StreamWrapper\StreamWrapperManager.php(287): preg_match('/^([\\w\\-]+):\\/\\...', Array, NULL)
#1 C:\wamp64\www\\docroot\core\lib\Drupal\Core\StreamWrapper\StreamWrapperManager.php(104): Drupal\Core\StreamWrapper\StreamWrapperManager::getScheme(Array)
#2 C:\wamp64\www\\docroot\core\lib\Drupal\Core\File\FileSystem.php(135): Drupal\Core\StreamWrapper\StreamWrapperManager->getViaUri(Array)
#3 C:\wamp64\www\\docroot\modules\contrib\s3fs\src\S3fsFileService.php(152): Drupal\Core\File\FileSystem->realpath(Array)
#4 C:\wamp64\www\\docroot\modules\contrib\captcha\modules\image_captcha\src\Service\ImageCaptchaRenderService.php(335): Drupal\s3fs\S3fsFileService->realpath(Array)
#5 C:\wamp64\www\\docroot\modules\contrib\captcha\modules\image_captcha\src\Service\ImageCaptchaRenderService.php(118): Drupal\image_captcha\Service\ImageCaptchaRenderService->printString(Object(GdImage), 180, 60, Array, 30, '5hEQE')
#6 C:\wamp64\www\\docroot\modules\contrib\captcha\modules\image_captcha\src\Controller\CaptchaImageGeneratorController.php(123): Drupal\image_captcha\Service\ImageCaptchaRenderService->generateImage('5hEQE')
#7 [internal function]: Drupal\image_captcha\Controller\CaptchaImageGeneratorController->image(Object(Symfony\Component\HttpFoundation\Request))
#8 C:\wamp64\www\\docroot\core\lib\Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)

/image-captcha-generate/80/1691138045 - StatusCode is 200

๐Ÿ‡ฎ๐Ÿ‡ณIndia saranyamariappan

@Anybody โ†’ , @Grevil โ†’

I have updated the captcha module to 2.0.4, My local PHP version (likely WAMP64) is PHP 8.1.13, my composer.json previously had PHP:7.4 and this time I have updated it to PHP 8.1. I did drush updb followed by drush cr as well.

I had PHP error.log

TypeError: preg_match(): Argument #2 ($subject) must be of type string, array given in C:\wamp64\www\\docroot\core\lib\Drupal\Core\StreamWrapper\StreamWrapperManager.php on line 256 #0 C:\wamp64\www\\docroot\core\lib\Drupal\Core\StreamWrapper\StreamWrapperManager.php(256): preg_match('/^([\\w\\-]+):\\/\\...', Array, NULL)
#1 C:\wamp64\www\\docroot\core\lib\Drupal\Core\StreamWrapper\StreamWrapperManager.php(103): Drupal\Core\StreamWrapper\StreamWrapperManager::getScheme(Array)
#2 C:\wamp64\www\\docroot\core\lib\Drupal\Core\File\FileSystem.php(135): Drupal\Core\StreamWrapper\StreamWrapperManager->getViaUri(Array)

I have applied the Patch mentioned on https://www.drupal.org/project/captcha/issues/3368540 ๐Ÿ› Error 500 in image_captcha image Closed: cannot reproduce

and now the PHP error.log has no errors reported. But still the Image Captcha and Font Preview is not working. When I inspected the /image-captcha-generate/80/1691138045 no watchdog error and PHP error.log.

Please let me know how to proceed from here.

In Addition, I would like to highlight here that,
My Drupal version is 9.4.8 and I ran composer require 'drupal/captcha:^2.0' copied from the Captcha module page. I totally believed that this composer require would work on my local without any error as it was mentioned

Works with Drupal: >=9.4 <11

but I got the error attached. Please make note of it. If it is mentioned >=9.4, then it should work with 9.4.8 but it is requiring 10, Please clarify this as well.

๐Ÿ‡ฎ๐Ÿ‡ณIndia saranyamariappan

Hi @ anybody โ†’ ,

The Image captcha is not rendering on any of the form that I configure it, on my project. Please find the screenshots of the Image Response URL where you could see only the broken image. This is happening for Font Preview as well. Adding ob_clean() at public function image() {} and public function getFont($token) {} is fixing the issue on my local. Please share your thoughts on this, also let me know if you need any.

๐Ÿ‡ฎ๐Ÿ‡ณIndia saranyamariappan

The issue that I'm facing is a different one and I would like to reopen the issue.

๐Ÿ‡ฎ๐Ÿ‡ณIndia saranyamariappan

I have a different case where I have to temporarily connect to a 2nd DB or 3rd DB and make some query request, build an array of options from that Database table and switch back to the current Database. The connection was working perfect on the higher level server(Dev,Staging & Production as they were in AWS) but the same code is throwing error on my lcoal. So I have found a solution to fix that WSOD on local.

use Drupal\Core\Database\Database;
use Drupal\Core\Entity\EntityStorageException;

function buildOptionforSelect ($newdbkey) {

if (is_null($newdbkey)) {
    Database::setActiveConnection('DB_3');
  }
  else {
    Database::setActiveConnection($newdbkey);
  }
try {
   $option = [];
    if (<strong>Database::isActiveConnection()</strong>) { //without this line I faced WSOD on my local.
      $connection = Database::getConnection();
      if ($connection->getKey() != 'default') {
        //Build something for $option = [];
      }
   }
}
catch (EntityStorageException $e) {
    \Drupal::logger('DBHandshake')->error($e->getMessage());
  }
Database::setActiveConnection();
return $options;
}

Hope this might be helpful for other cases.

Production build 0.71.5 2024