Problem/Motivation

Facet handling is six methods and roughly 360 lines in MyrestHelper: getFacetsStructure(), getFacetsAlias(), getFacetsAliasByCategoryIdAndGetF(), getFacetLinksByCharacteristics() and isNoindexFacetsPage(). It is the only part of the helper that touches the optional myfacet module, so today every consumer of the helper carries that optional dependency.

Proposed resolution

  • Extract the group into MyrestFacetsBuilder behind an interface, taking the alias manager, the language manager and the optional myfacet manager.
  • Resolve the four outbound calls (getLangcode(), the node and term storages, isNoindex()) by giving the service its own language handling and storage accessors.
  • Keep the facade delegating, with the methods deprecated.
  • Make the service degrade cleanly when myfacet is absent, in line with issue 27.

Remaining tasks

Extract the group and cover the alias building with tests.

User interface changes

None.

API changes

New MyrestFacetsBuilderInterface. Facade methods deprecated.

Issue fork myrest-3616668

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 3c820c69 on 1.0.x
    Issue #3616668: Extract the facets builder out of the helper
    
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)