Problem/Motivation

When I Add to block on site - Search Api Page search block form its giving error on index

Error: Call to a member function id() on null in Drupal\search_api_page\Form\SearchApiPageBlockForm->buildForm() (line 112 of modules/search_api_page/src/Form/SearchApiPageBlockForm.php).

$form['search_api_page'] = [
'#type' => 'value',
Line 112 '#value' => $search_api_page->id(),
];

Error in Admin Page

Error message

Warning: Undefined array key "search_api_page" in Drupal\search_api_page\Plugin\Block\SearchApiPageBlock->calculateDependencies() (line 116 of modules/search_api_page/src/Plugin/Block/SearchApiPageBlock.php).

Warning: array_flip(): Can only flip string and integer values, entry skipped in Drupal\Core\Entity\EntityStorageBase->loadMultiple() (line 278 of core/lib/Drupal/Core/Entity/EntityStorageBase.php).

When i use normal site of search all works fine and search perfectly. Where is the problem then?

Please help with solution.

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

Tesam created an issue. See original summary.

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

abhishek_gupta1’s picture

Status: Active » Needs review

@Tesam, i have added changes for ": Call to a member function id() on null in" and "Warning: Undefined array key "search_api_page". and created MR. please review it

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

karlshea’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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