The coding period for GSoC 2016 started last week from 23rd May and now students are required to start coding for their respective projects. As part of GSoC’16 I have been working on Porting Comment Alter module to Drupal 8 under mentorship of boobaa and czigor.
The first week of GSoC’16 coding period is over now. During this week I was able to accomplish following tasks:
hook_form_FORM_ID_alter
. This provides an interface to select any field we want to be altered by the comment and also hide alteration from diff. So by using the hook_form_FORM_ID_alter
we could add these extra options on the field_config_edit_form but there was a change from the D7 version here. Earlier additional field properties were directly stored in the database just with the addition of those custom fields in the form_alter but now we need to use ThirdPartySettings
to store the values.ThirdPartySettings
. Content_translation module in core was a good example which used ThirdPartySettings and it even also implemented hook_form_FORM_ID_alter
for field_config_edit_form. There were two methods by which we could have used ThirdPartySettings
in our module. The one we are using was to use the ThirdPartySettingsInterface
provided for FieldConfigInterface
. The other one was to create our own builder function. We are not using the other method because it will increase the complexity as we would have to add our own builder function inside which we would set the ThirdPartySettings
to store our changes. But it would be independent and will not be affected if any other module also uses ThirdPartySettings.Finally with the use of ThirdPartySettings
we have completed our first function which provides an altered FieldConfigInterface
. My mentors have already reviewed the code for the work which I did in this week. If anyone is interested, my progress can be followed here.