This is a follow-up to #3077815: Basic Search (such as on Title) on Pull Form, where basic search was added.

If there are no filters specified on a channel (other than Entity Type and Bundle, which are required), then the basic search fails to work.

To reproduce:

- Create a new channel. Select an entity type and bundle.
- Add no filters, sorts, or any other configuration to the channel.
- Visit the pull content form, select that site and channel.
- Enter a search term, tab-out to have it search.

A PHP notice will be thrown:

Notice: Undefined index: filter in Drupal\entity_share_client\Form\PullForm->buildEntitiesSelectTable() (line 491 of /app/drupal8/web/modules/contrib/entity_share/modules/entity_share_client/src/Form/PullForm.php). => 

And the search will fail to work.

This can be mitigated just by specifying any filter, such as "created > 0"

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quicksketch created an issue. See original summary.

Grimreaper’s picture

Assigned: Unassigned » Grimreaper
Grimreaper’s picture

Assigned: Grimreaper » Unassigned
Status: Active » Needs review
FileSize
1.15 KB

Hello,

Here is a patch that fixes the bug.

Is it ok for you?

I will wait for your feedback before merging.

quicksketch’s picture

Status: Needs review » Reviewed & tested by the community

Works great.

  • Grimreaper authored 841ae22 on 8.x-2.x
    Issue #3087500 by Grimreaper, quicksketch: Search fails if no filters...
  • Grimreaper authored fccb152 on 8.x-2.x
    Issue #3087500 by Grimreaper, quicksketch: Search fails if no filters...
Grimreaper’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the feedback. This is merged!

  • 821af8b committed on 8.x-2.x
    Revert "Issue #3087500 by Grimreaper, quicksketch: Search fails if no...

Status: Fixed » Closed (fixed)

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