Problem/Motivation

Error: Call to a member function getType() on null in Drupal\facets\Plugin\facets\processor\BooleanItemProcessor->supportsFacet() (line 102 of modules/contrib/facets/src/Plugin/facets/processor/BooleanItemProcessor.php).

Steps to reproduce

When we are creating new facet item in the backend getting call to member function getType() error.

Comments

baskaran created an issue. See original summary.

ramu_bharu’s picture

Hi,

It looks like the field identifier value is not set when we create a new facet. So we have to set field identifier in facet settings page.
I created a patch that will redirect to facet settings page when the field identifier value is null and we don't see the error page.

ramu_bharu’s picture

StatusFileSize
new780 bytes
ramu_bharu’s picture

StatusFileSize
new1.13 KB
baskaran’s picture

Hi @ramu_bharu,

Patch works for me!!.

Thanks.

phily’s picture

Version: 8.x-1.8 » 2.0.0
Status: Active » Needs review

Patch at comment #4 works for me using Drupal 9.3.0 and Facets 2.0.0

Thanks

phily’s picture

Version: 2.0.0 » 2.0.x-dev

move to 2.0.x-dev version tag

mkalkbrenner’s picture

Status: Needs review » Needs work
+++ b/src/Form/FacetForm.php
@@ -143,6 +144,15 @@ class FacetForm extends EntityForm {
+        $facet_settings_path = '/admin/config/search/facets/' . $facets->id() . '/settings';

Don't assemble the path manually here. Use

$facet->toUrl('settings-form')->toString()
beatrizrodrigues’s picture

Assigned: Unassigned » beatrizrodrigues
Status: Needs work » Needs review
StatusFileSize
new1.11 KB
new616 bytes

I did the change that you suggested @mkalkbrenner I hope it's okay and It fits. Sending a patch and a interdiff file. Thanks!

beatrizrodrigues’s picture

Assigned: beatrizrodrigues » Unassigned
phily’s picture

Patch #9 works for me using Drupal 9.3.3 and Facets 2.0.1

mkalkbrenner’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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