Skip to content

Conversation

@JeremySkinner
Copy link

Introduces a config entity for storing GDPR field settings with a separate form which resolves the issues with base fields not being editable.

image

Clicking the edit link next to the field on the GDPR field list page takes you to a separate page where the settings can be modified:

image

For editable fields, GDPR settings can still be edited through the field settings form, as before.

*/
public static function create(array $array) {
$field = new GdprField($array['bundle'], $array['name']);
$field->rtf = $array['rtf'];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets call $array $values instead, and use new static($values['bundle'] ... ) as we don't need to explicitly name the class in a static method.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you push the branch? 😛

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I pushed develop. I'll merge it to here too.

*/
public function setField($bundle, $field_name, $enabled, $rta, $rtf, $sanitizer, $notes) {
$this->bundles[$bundle][$field_name] = [
'bundle' => $bundle,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this could be more generic. rather than having to pass every field in as a separate parameter. $bundle and $field_name are still good to force as they are necessary for any update.

  public function setField($bundle, $field_name, $values) {

    $values['bundle'] = $bundle;
    $values['name'] = $field_name;

    foreach ($values as $key => $value) {
      $this->bundles[$bundle][$field_name][$key] = $value;
    }

This way we can pass anything in with values, either less than all fields or add more fields without having to change the function.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants