Skip to main content

Using Drupal 10, VIews, Solr and Facets has post upgrade to version 10, created the following issue

Symfony\Component\HttpKernel\Exception\BadRequestHttpException: Input value "f" contains a non-scalar value. in Symfony\Component\HttpKernel\HttpKernel->handle() (line 83 of /var/www/html/{project}/vendor/symfony/http-kernel/HttpKernel.php).

This error message indicates that the system is receiving a non-scalar value where a scalar value is expected.  This often happens in web applications when data being passed to the backend doesn't match the expected format, causing issues in processing the request.

Let's create a review process:

Check Facets and Solr Integration

The error might be related to how Facets and Solr are integrated and handle query parameters. Ensure that your Facets configuration is compatible with Drupal 10 and the Solr module version you're using.

Review Custom Code and Hooks

If you have custom code or use hooks to alter queries or parameters for Views, Facets, or Solr, review them for compatibility with Drupal 10. The upgrade could have introduced changes that require adjustments in your custom code.

Update and Patch Modules

Ensure all modules, especially Views, Solr, and Facets, are updated to their latest versions that support Drupal 10. Sometimes, bugs fixed in newer versions can resolve these issues. Also, look for patches that might address this specific problem in the Drupal community or module issue queues.

Examine the Input Value “f”

The error message mentions an input value "f" containing a non-scalar value. This is typically related to form submissions or query parameters. Check the places where this value is generated or modified. It might be a facet or filter parameter that's incorrectly formatted after the upgrade.

Debug and Log

Use debugging tools or Drupal's logging capabilities to trace where the non-scalar value is introduced. This can help identify the specific facet, view, or interaction causing the problem.

 

 

Check Facets and Solr integration

Reviewing the integration between Facets and Solr, especially after an upgrade to Drupal 10, involves several steps. These steps help ensure that both the Facets and the Solr search integration are working correctly and are compatible with each other as well as with the new version of Drupal.

 

1. Ensure Compatibility

Module Versions: First, check that the versions of the Facets and Solr modules you're using are explicitly compatible with Drupal 10. This information is typically available in the module's project page on Drupal.org or in the release notes.

 

2. Review Module Configuration

Facets Configuration: In the Drupal admin interface, navigate to the Facets configuration section and review each facet's settings. Ensure that they are correctly set up to interact with Solr as the search backend. Pay special attention to any custom settings or overrides that might have been in place before the upgrade.

Solr Search API Configuration: Similarly, check the configuration of the Solr search backend (usually through the Search API module settings). Confirm that the connection to the Solr server is working correctly and that indexes are up to date. Look for any warnings or errors in the status report related to Solr.

 

3. Update and Re-index

Update Indexes: If there have been significant changes in the data structure or content types that Solr indexes after the upgrade, you might need to re-index your content. This can be done from the Search API's index configuration page.

 

4. Test Functionality

Frontend Testing: Test the search functionality on the frontend of your site. Check if the facets correctly filter the results and if the search results from Solr are as expected.

Backend Testing: Use the test functionality provided by the Search API module to send queries to the Solr server directly from the Drupal backend. This can help identify issues with the query or response that might not be apparent from frontend testing.

 

5. Check for Errors and Logs

Drupal Logs: Check the Drupal logs (Recent log messages) for any errors or warnings related to Facets or Solr. This can provide clues to misconfigurations or incompatibilities.

Solr Logs: Also review the Solr server logs for errors or warnings. Issues here could indicate problems with the queries sent from Drupal or with the Solr schema.


 

 

Related articles