Closed ekes closed 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
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.
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.
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.
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.
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.
Make further issue for development of CTABlockTidied. Just needs functionality clarifying and test.