Create an example search plugin for the Content Entity Example for integrating custom entity data into the core search system.

Issue fork examples-2643048

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

kentr created an issue. See original summary.

kentr’s picture

Issue tags: +Plugin system, +examples
kentr’s picture

Status: Active » Needs review
StatusFileSize
new33.3 KB
jkopel’s picture

Category: Task » Feature request
Status: Needs review » Needs work
Issue tags: +Needs tests

Patch intalls cleanly.
Should probably include some documentation indicating what the plugin does at content_entity_example_contact/list and also indicate that one has to add a search page for "content entity example contacts" in order to make use of the plugin.

The patch introduces an error when creating search pages in the UI (for any entity type).
To reproduce:
1. Apply patch
2. Enable content_entity_example
3. Add a search page

Type	php
Date	Saturday, January 30, 2016 - 14:46
User	d8
Location	http://d8/admin/config/search/pages
Referrer	http://d8/admin/config/search/pages/add/content_entity_example_contact_search
Message	Symfony\Component\Routing\Exception\RouteNotFoundException: Route "search.view_content_entity_example_contacts" does not exist. in Drupal\Core\Routing\RouteProvider->getRouteByName() (line 191 of /core/lib/Drupal/Core/Routing/RouteProvider.php).
Severity	Error
Hostname	127.0.0.1
Operations	

This seems to happen regardless of which entity type I try to add a search page for.
The pages do get created, and the plugin/search seems to work just fine once the page is there.

mile23’s picture

Could we make this into a separate module which depends on content_entity_example?

That way we can do a better job of illustrating only one thing with each module.

kentr’s picture

Could we make this into a separate module which depends on content_entity_example?

Good point.

kentr’s picture

Status: Needs work » Needs review
StatusFileSize
new35.64 KB

This patch:

  • Contains the example in an independent module: search_plugin_example.
  • Adds usage instructions to content_entity_example_contact/list.

I couldn't reproduce the error mentioned in #4 when testing on core `8.0.3`.

Status: Needs review » Needs work

The last submitted patch, 7: example-search-plugin-2643048-7-D8.patch, failed testing.

kentr’s picture

Assigned: kentr » Unassigned

I don't know why the patch failed testing. In manual testing, it applied and worked as expected without introducing errors.

Unassigning myself from the issue until I have more time to work on it.

mile23’s picture

It seems some of this patch made its way to https://www.drupal.org/docs/8/api/entity-api/making-the-content-entity-s... (or vice-versa).

avpaderno’s picture

Component: Content Entity Example » Code
Category: Feature request » Task
Issue tags: -Search API, -Plugin system, -examples +Needs merge request

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

avpaderno’s picture

Component: Code » New modules
avpaderno’s picture

Status: Needs work » Closed (outdated)

Since the Search module is going to be deprecated and removed from Drupal core, and since a search plugin is a plugin, I am closing this issue as outdated.

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.