Cannot use with a Search API Index view

Created on 27 March 2023, about 2 years ago

Problem/Motivation

This all works very brilliantly with my Content (node) views but I needed to add some links to the header of a Search API Index view and I could not do it; the Ajax dialogue would not open.

Digging deeper I see this message in the log...

Error: Call to a member function id() on bool in Drupal\add_content_by_bundle\Plugin\views\area\AddContentByBundle->buildOptionsForm() (line 83 of modules\contrib\add_content_by_bundle\src\Plugin\views\area\AddContentByBundle.php)

Any ideas anyone? is it bug?
Should I expect to be able to use it with am index-based view and if not then why not?

Thanks

🐛 Bug report
Status

Active

Version

1.2

Component

Miscellaneous

Created by

🇬🇧United Kingdom SirClickALot Somerset

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

Comments & Activities

  • Issue created by @SirClickALot
  • 🇨🇦Canada mandclu

    It wasn't really designed to be used with search index views, but that isn't to say it couldn't be made to work.

    A couple of action items come to mind:
    1. More gracefully handle a situation where the entity type of the view isn't really compatible with the module's intent
    2. Provide a fallback behavior that allows the site builder to choose a compatible entity type

    On the meantime you could create a block node view that shows nothing, and add header buttons for as many content types as you want, and then place that block at the top of your search view.

Production build 0.71.5 2024