Error: Typed property Drupal\scrapingbot\ScrapingBot::$apiKey must not be accessed before initialization in Drupal\scrapingbot\ScrapingBot->scrapeRaw()

Created on 11 March 2025, 26 days ago

Problem/Motivation

Not able to use scraping bot as an automator.
Getting the following error:

The website encountered an unexpected error. Try again later.

Error: Typed property Drupal\scrapingbot\ScrapingBot::$apiKey must not be accessed before initialization in Drupal\scrapingbot\ScrapingBot->scrapeRaw() (line 169 of modules/contrib/ai_interpolator_scraping_bot/src/ScrapingBot.php).
Drupal\scrapingbot\Plugin\AiAutomatorType\DepthCrawlerRule->scrapeLink() (Line: 323)
Drupal\scrapingbot\Plugin\AiAutomatorType\DepthCrawlerRule->generate() (Line: 70)
Drupal\ai_automators\AiAutomatorRuleRunner->generateResponse() (Line: 70)
Drupal\ai_automators\Plugin\AiAutomatorProcess\DirectSaveProcessing->modify() (Line: 229)
Drupal\ai_automators\AiAutomatorEntityModifier->markFieldForProcessing() (Line: 129)
Drupal\ai_automators\AiAutomatorEntityModifier->saveEntity() (Line: 31)
ai_automators_entity_presave()
call_user_func_array() (Line: 355)
Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}() (Line: 307)
Drupal\Core\Extension\ModuleHandler->invokeAllWith() (Line: 354)
Drupal\Core\Extension\ModuleHandler->invokeAll() (Line: 217)
Drupal\Core\Entity\EntityStorageBase->invokeHook() (Line: 900)
Drupal\Core\Entity\ContentEntityStorageBase->invokeHook() (Line: 529)
Drupal\Core\Entity\EntityStorageBase->doPreSave() (Line: 753)
Drupal\Core\Entity\ContentEntityStorageBase->doPreSave() (Line: 483)
Drupal\Core\Entity\EntityStorageBase->save() (Line: 805)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (Line: 354)
Drupal\Core\Entity\EntityBase->save() (Line: 281)
Drupal\node\NodeForm->save()
call_user_func_array() (Line: 105)

Steps to reproduce

Follow the steps mentioned here: https://git.drupalcode.org/project/scrapingbot#how-to-use-as-ai-automato...

Proposed resolution

NA

Remaining tasks

NA

User interface changes

NA

API changes

NA

Data model changes

NA

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇮🇳India Vivek Panicker Kolkata

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

Comments & Activities

Production build 0.71.5 2024