Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Steps to reproduce:
- Create a fresh Drupal 7 instance
- Make sure module field_ui is disabled
- Install and enable Sarnia
- Go to
admin/config/search/search_api/add_server
and create a Sarnia server named, for instance, 'myserver' - Go to
admin/config/search/search_api/server/myserver/sarnia/display
oradmin/config/search/search_api/server/myserver/sarnia/fields
Expected result: page with admin UI to configure fields.
Actual result: blank screen with the following in Apache logs:
PHP Fatal error: Call to undefined function field_ui_inactive_instances() in /var/www/html/d7/modules/field_ui/field_ui.admin.inc on line 57
Proposed resolution
The code responsible for displaying these pages seems to assume that field_ui is enabled. A solution could be to display the pages only if field_ui is actually enabled and document this in the README file - see patch attached, basically I just put the menu links inside a if (module_exists('field_ui')) {
block.
Comment | File | Size | Author |
---|---|---|---|
#6 | 2663636-sarnia_error_field_ui_disabled-6.patch | 486 bytes | jmdeleon |
| |||
#3 | 2663636-sarnia_error_field_ui_disabled-3.patch | 1.79 KB | jmdeleon |
| |||
sarnia_error_field_ui_disabled.patch | 8.2 KB | fengtan | |
|
Comments
Comment #3
jmdeleon CreditAttribution: jmdeleon commentedAttached here is a simpler patch that should hopefully accomplish the same goal.
Comment #4
fengtanMakes sense. Moving to 'Needs review' to trigger automated tests.
Comment #6
jmdeleon CreditAttribution: jmdeleon commentedAnother try at a patch, paring down to just the essentials.
Comment #7
jmdeleon CreditAttribution: jmdeleon commentedComment #9
fengtanWell, not sure why the testbot complains but the changeset looks good to me.
Here is the error that the testbot returned:
16:09:40 ERROR: No valid tests were specified.
https://dispatcher.drupalci.org/job/default/86926/console
Comment #11
jmdeleon CreditAttribution: jmdeleon commentedComment #12
jmdeleon CreditAttribution: jmdeleon commented