Problem/Motivation

The recipe the module is developed against declares several fields with a different type from the sites the code was written for. The code reads those fields the way the sites store them, so on the development site four listing and detail endpoints answer with a fatal error instead of a payload:

  • field_facets references taxonomy terms, and on thirteen node bundles; the sites reference myfacet entities from the bundle that holds the listing settings. MyfacetManager::normalizeMyfacets() calls isActive() on what it gets and fatals on a term.
  • field_article_image, field_doctor_photo and field_photo_preview are image fields; on the sites they reference media of the image type, and field_doctor_certificates, field_doctor_photos and the term field field_main_img — media as well — are missing altogether.

A development site whose model differs from the one the code expects tests neither: the errors hide every key behind them, and a green run on it says nothing about a real site.

Proposed resolution

  • Give these fields the types, cardinalities and bundles the sites use, and fill them: media of the image type with real files, myfacet entities — with the characteristics they point at — referenced from the bundles that hold listing settings.
  • Add a check that compares the field storages the recipe creates with a list taken from the sites' configuration, so that the types cannot drift again unnoticed.
  • Verify on the endpoints themselves: every endpoint that fatals today answers with a payload whose facet and image keys carry values.

Remaining tasks

Everything.

Issue fork myrest-3623216

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

sergeydruua created an issue. See original summary.

  • sergeydruua committed d4e2b57e on 1.0.x
    Issue #3623216: Answer the facets of a listing on a site whose facet...
sergeydruua’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

sergeydruua’s picture

Status: Fixed » Closed (fixed)