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 or admin/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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fengtan created an issue. See original summary.

Status: Needs review » Needs work

The last submitted patch, sarnia_error_field_ui_disabled.patch, failed testing.

jmdeleon’s picture

Attached here is a simpler patch that should hopefully accomplish the same goal.

fengtan’s picture

Status: Needs work » Needs review

Makes sense. Moving to 'Needs review' to trigger automated tests.

Status: Needs review » Needs work

The last submitted patch, 3: 2663636-sarnia_error_field_ui_disabled-3.patch, failed testing.

jmdeleon’s picture

Another try at a patch, paring down to just the essentials.

jmdeleon’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 6: 2663636-sarnia_error_field_ui_disabled-6.patch, failed testing.

fengtan’s picture

Well, 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

  • jmdeleon committed b3f3401 on 7.x-1.x
    Issue #2663636 by jmdeleon, fengtan: Fatal errors if field_ui is...
jmdeleon’s picture

Status: Needs work » Reviewed & tested by the community
jmdeleon’s picture

Status: Reviewed & tested by the community » Closed (fixed)