localgovdrupal / localgov_services

Provides the pages and navigation for presenting the Services provided by Local Government. A part of the LocalGovDrupal distribution.
GNU General Public License v2.0
3 stars 4 forks source link

[CLOSED] Remove custom node interface : localgov_services_page #2

Closed ekes closed 4 years ago

ekes commented 4 years ago

Issue by ekes Thursday May 14, 2020 at 16:06 GMT _Originally opened as https://github.com/localgovdrupal/localgov_services_private/issues/2_


One of the original specs from the proposal was to 'drupal-ify' the code and remove the custom node interface.

[ Adding a note here for future me : It's a very handy way of separating out preSave, and could even help custom field behaviour per-bundle. However, it requires a system wide entity storage hook to replace the storage class, which won't work if the intention is that these components can become plugable. ]

Within the services modules there is the definition of the modules, and a reference to checking the class type in the CTABlock where it also uses the getter to retrieve the value from the field. This will need to be removed.

ekes commented 4 years ago

Comment by ekes Friday May 15, 2020 at 09:29 GMT


The node interface includes a presave:

It's populating a field_parent_content with either the service sublanding page, or if that's not there the service landing page.

~~ It's also getting related and private topics and merging them. ~~ Now #8

ekes commented 4 years ago

Comment by ekes Friday May 15, 2020 at 09:39 GMT


All other methods (within the services modules) are only used within the ServiceInfo class itself and are safe to go. General review was they are most commonly used in twig, where the field should be available without a get wrapper.

ekes commented 4 years ago

Comment by ekes Friday May 15, 2020 at 13:09 GMT


Parent field is just used for the pathauto. It can be replaced by a custom token, or more flexibly a computed field.

ekes commented 4 years ago

Comment by andybroomfield Friday May 15, 2020 at 16:10 GMT


It's also getting related and private topics and merging them.

This is part of the topics and related links magic Clear Left designed. The private topics is used to weight the returned releated links algorithm, without being displayed on the page.

ekes commented 4 years ago

Comment by ekes Friday May 15, 2020 at 16:28 GMT


It's also getting related and private topics and merging them.

This is part of the topics and related links magic Clear Left designed. The private topics is used to weight the returned releated links algorithm, without being displayed on the page.

Ah that's helpful. I suppose I move this to a presave hook for now, and it can be reviewed when we get to look at the topics handling.