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
MyrestFacetsBuilderbehind 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
myfacetis 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
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
Comment #4
sergeydruua commentedComment #6
sergeydruua commented