-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce config entity for managing GDPR settings. #7
base: features/consent
Are you sure you want to change the base?
Conversation
…ith missing method on versions older than 8.5
*/ | ||
public static function create(array $array) { | ||
$field = new GdprField($array['bundle'], $array['name']); | ||
$field->rtf = $array['rtf']; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
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? 😛
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Introduces a config entity for storing GDPR field settings with a separate form which resolves the issues with base fields not being editable.
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:
For editable fields, GDPR settings can still be edited through the field settings form, as before.